Ticket #397 (closed defect: invalid)

Opened 3 years ago

Last modified 3 years ago

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

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

Change History

Changed 3 years ago by svenanders

pg_dump of the table

Changed 3 years ago by pramsey

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.

Changed 3 years ago by pramsey

  • status changed from new to closed
  • resolution set to invalid
Note: See TracTickets for help on using tickets.