Opened 16 years ago

Last modified 15 years ago

#22 closed defect (fixed)

contains/within relationship problem

Reported by: b...@… Owned by:
Priority: medium Milestone:
Component: postgis Version:
Keywords: Cc:

Description

What steps will reproduce the problem?

  1. CREATE TABLE test (id int PRIMARY KEY, geom geometry);
  2. INSERT INTO test VALUES (1,'POLYGON((4 9,6 9,6 11,4 11,4 9))');
  3. SELECT * FROM test WHERE within(geom,'POLYGON((0 0,10 0,20 10,10 20,0

20,-10 10,0 0))');

What is the expected output? What do you see instead? The result should be the created row. I got nothing. This is not normal as the first polygon is within the second polygon.

What version of the product are you using? On what operating system? postgresql 8.3.1, proj 4.6.0,geos 3.0.0, postgis 1.3.3 (POSTGIS='1.3.3' GEOS='3.0.0-CAPI-1.4.1' PROJ='Rel. 4.6.0, 21 Dec 2007' USE_STATS) Running on Linux 2.6.23.1

Please provide any additional information below. It works on the following combination: postgresql 8.2.7, proj 4.6.0, geos 2.2.3, postgis 1.2.1 (POSTGIS='1.2.1' GEOS='2.2.3-CAPI-1.1.1' PROJ='Rel. 4.6.0, 21 Dec 2007' USE_STATS)

It also works using geos 2.2.3 instead of 3.0 POSTGIS='1.3.3' GEOS='2.2.3-CAPI-1.1.1' PROJ='Rel. 4.6.0, 21 Dec 2007' USE_STATS

also running on Linux.

It is clearly a geos problem.

Change History (3)

comment:1 by mcayland, 16 years ago

Could it be possible that you are being hit by this bug: http://www.nabble.com/ST_Contains-doesn't-work--to14946025.html

There is a fix within GEOS SVN here: http://trac.osgeo.org/geos/changeset/2124

So could you try checking out GEOS SVN HEAD and re-compiling to see if this resolves the issue for you?

Many thanks,

Mark.

comment:2 by pramsey, 16 years ago

This is fixed in GEOS trunk.

comment:3 by mcayland, 15 years ago

No feedback from original reporter - closing based on Paul's comment above.

ATB,

Mark.

Note: See TracTickets for help on using tickets.