[postgis-tickets] [PostGIS] #2764: Strange result from ST_Intersection after converting between geom and geog

PostGIS trac at osgeo.org
Thu Jun 19 03:27:01 PDT 2014


#2764: Strange result from ST_Intersection after converting between geom and geog
---------------------------+------------------------------------------------
 Reporter:  realityexists  |       Owner:  pramsey
     Type:  defect         |      Status:  new    
 Priority:  medium         |   Milestone:         
Component:  postgis        |     Version:  2.1.x  
 Keywords:                 |  
---------------------------+------------------------------------------------
 I'm getting some strange behaviour from ST_Intersection. I want to find
 the intersections between many polygons/multi-polygons and many
 linestrings and to do this faster I split the polygons into tiles using
 ST_Intersection(geom), as recommended on postgis-users. I then use
 ST_Intersection(geog) on the resulting tiles with my lines. This generally
 works, but one particular multi-polygon is causing problems, even though
 it's not near the dateline.

 One of the tiles for this polygon ends up being POLYGON((-3 2,-3 2,-3 1,-3
 1,-3 2)). This is clearly not valid. When intersected with a LINESTRING
 that just touches it the entire LINESTRING is returned, which is
 incorrect.

 It wouldn't be so bad if I could filter it out as invalid, but
 ST_IsValid() returns true. (It returns false for the above text, but not
 for the original tile, so some precision must be getting lost in
 ST_AsText.)

 The attached repro should clarify things. Note that I had to save it using
 ST_AsBinary, because after round-tripping through ST_AsText or ST_AsEWKT I
 can no longer reproduce.

 I'm not really sure what SHOULD happen here, but pretty sure it's not
 this. :)

 POSTGIS="2.1.3 r12547" GEOS="3.4.2-CAPI-1.8.2 r0" PROJ="Rel. 4.8.0, 6
 March 2012" GDAL="GDAL 1.10.0, released 2013/04/24" LIBXML="2.7.8"
 LIBJSON="UNKNOWN" RASTER

 PostgreSQL 9.2.8, compiled by Visual C++ build 1600, 64-bit running on
 Windows 7

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2764>
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-tickets mailing list