[postgis-devel] [PostGIS] #652: ST_IsValid and adjacent polygons

PostGIS trac at osgeo.org
Wed Oct 27 01:54:13 PDT 2010


#652: ST_IsValid and adjacent polygons
--------------------------------------------+-------------------------------
 Reporter:  gaosgeo                         |       Owner:  pramsey      
     Type:  defect                          |      Status:  new          
 Priority:  medium                          |   Milestone:  PostGIS 1.5.3
Component:  postgis                         |     Version:  1.5.X        
 Keywords:  ST_IsValid, Self-Intersections  |  
--------------------------------------------+-------------------------------
 Hi,

 It seems that ST_IsValid (and thus ST_IsValidReason) throws errors
 inconsequently. See following examples (both 2D and 3D):

 A) 2D: These two polygons are adjacent in (0 1) and (1 1)

 SELECT ST_isvalidreason(ST_GeomFromEWKT('MULTIPOLYGON(
 ((0 0, 1 0, 1 1, 0 1, 0 0)),
 ((0 1, 1 1, 1 2, 0 2, 0 1)))'));

 ==> Self-intersection[0 1]

 Shifting one vertex to (0 0.9), no other error is thrown. What about Self-
 Intersection in (1 1) then?.

 SELECT ST_IsValidReason(ST_GeomFromEWKT('MULTIPOLYGON(
 ((0 0, 1 0, 1 1, 0 0.9, 0 0)),
 ((0 1, 1 1, 1 2, 0 2, 0 1)))'));

 ==> Valid Geometry

 B) 3D: Same errors with same polygons, but lying at different z-values.

 SELECT ST_isvalidreason(ST_Geometryfromtext('MULTIPOLYGON(
 ((0 0 0, 1 0 0, 1 1 0, 0 1 0, 0 0 0)),
 ((0 1 1, 1 1 1, 1 2 1, 0 2 1, 0 1 1)))'));

 ==> Self-intersection[0 1 0.5]

 Any hints?

 I'm using:

 - POSTGIS="1.5.2" GEOS="3.2.2-CAPI-1.6.2" PROJ="Rel. 4.6.1, 21 August
 2008" LIBXML="2.7.6" USE_STATS

 - PostgreSQL 8.4.4, compiled by Visual C++ build 1400, 32-bit on Windows 7
 64-bit

 I attach a short file with the given examples.
 Thank you and best Regards,

 ga

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/652>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-devel mailing list