Opened 14 years ago

Closed 14 years ago

#397 closed defect (invalid)

Defect in within function

Reported by: svenanders Owned by: pramsey
Priority: medium Milestone:
Component: postgis Version: 1.4
Keywords: Cc:

Description

I have two boundarys , first one is Schleswig Holstein a state of Germany the second one is the village "Hohe Elbe." There are both from OpenStreetMap. Hohe Elbe is in Schleswig Holstein but the Within function tells is always false.

select sh.geom=GeomUnion(hoElbG.geom,sh.geom) as union, Within(hoElbG.geom,sh.geom),Within(sh.geom,hoElbG.geom), hoElbG.geom=intersection(hoElbG.geom,sh.geom) as intersection, isvalid(hoElbG.geom),isvalid(sh.geom) from boundary_test hoElbG, boundary_test sh where hoElbG.id=158057 and sh.id=51529;

gives

union | within | within | intersection | isvalid | isvalid


t | f | f | t | t | t

POSTGIS="1.4.1" GEOS="3.2.0-CAPI-1.6.0" PROJ="Rel. 4.6.0, 21 Dec 2007" USE_STATS Postgresql 8.3 Debian lenny.

Attachments (1)

boundary_test.sql (200.1 KB ) - added by svenanders 14 years ago.
pg_dump of the table

Download all attachments as: .zip

Change History (3)

by svenanders, 14 years ago

Attachment: boundary_test.sql added

pg_dump of the table

comment:1 by pramsey, 14 years ago

There is a slight sliver of the small geometry that extends beyond the bounds of the large one:

select st_astext(st_difference(b.geom, a.geom)) from 
(select geom from boundary_test where id = 51529) a,
(select geom from boundary_test where id = 158057) b;
 POLYGON((
10.3251428466302 53.4497880952386,
10.3250776 53.4498083,10.3251442 53.4497893,
10.3251428466302 53.4497880952386))

Replace the '=' with ST_Equals in your test matrix above to get a more reliable test.

comment:2 by pramsey, 14 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.