[postgis-tickets] [PostGIS] #2638: geography ST_Intersects bugginess with Polygon/multilinestring M

PostGIS trac at osgeo.org
Wed Feb 5 21:38:39 PST 2014


#2638: geography ST_Intersects bugginess with Polygon/multilinestring M
---------------------+------------------------------------------------------
 Reporter:  robe     |       Owner:  pramsey      
     Type:  defect   |      Status:  new          
 Priority:  medium   |   Milestone:  PostGIS 2.0.5
Component:  postgis  |     Version:  2.1.x        
 Keywords:           |  
---------------------+------------------------------------------------------
 {{{
 SELECT ST_Intersects(geog1, geog2) As g1_in_g2, ST_Intersects(geog2,geog1)
 As g2_in_g1, _ST_DistanceUncached(geog1,geog2) As dist_unc
  , _ST_DistanceTree(geog1,geog2) As dtree_g1_g2
  , _ST_DistanceTree(geog2,geog1) As dtree_g2_g1
 FROM ST_GeogFromText('MULTILINESTRING M ((-71.0821 50.3036 1,50 -71
 1),(-56.0821 50.3036 1,50 -56 1),(-41.0821 50.3036 1,50 -41 1),(-26.0821
 50.3036 1,50 -26 1),(-11.0821 50.3036 1,50 -11 1),(3.9179 50.3036 1,50 4
 1),(18.9179 50.3036 1,50 19 1),(33.9179 50.3036 1,50 34 1),(48.9179
 50.3036 1,50 49 1),(-71.0821 50.3036 2,50 -71 2),(-56.0821 50.3036 2,50
 -56 2),(-41.0821 50.3036 2,50 -41 2),(-26.0821 50.3036 2,50 -26
 2),(-11.0821 50.3036 2,50 -11 2),(3.9179 50.3036 2,50 4 2),(18.9179
 50.3036 2,50 19 2),(33.9179 50.3036 2,50 34 2),(48.9179 50.3036 2,50 49
 2))') As geog1,
 ST_GeogFromText('MULTIPOLYGON M (((0 0 2,10 0 1,10 10 -2,0 10 -5,0 0
 -5),(5 5 6,7 5 6,7 7 6,5 7 10,5 5 -2)))') As geog2;
 }}}


 POSTGIS="2.1.2dev r12220" 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.4, compiled by Visual C++ build
 1600, 32-bit


 {{{
  g1_in_g2 | g2_in_g1 | dist_unc | dtree_g1_g2 | dtree_g2_g1
 ----------+----------+----------+-------------+-------------
  t        | f        |        0 |           0 |           0
 (1 row)
 }}}

 In PostGIS 2.0
 POSTGIS="2.0.4" 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"
 (core procs from "2.0.4" need upgrade) RASTER (raster procs from "2.0.4"
 need upgrade) PostgreSQL 9.2.4, compiled by Visual C++ build 1600, 32-bit


 {{{
 SELECT ST_Intersects(geog1, geog2) As g1_in_g2, ST_Intersects(geog2,geog1)
 As g2_in_g1
  , ST_Distance(geog1,geog2) As dist_g1_g2, ST_Distance(geog2,geog1) As
 dist_g2_g1
 FROM ST_GeogFromText('MULTILINESTRING M ((-71.0821 50.3036 1,50 -71
 1),(-56.0821 50.3036 1,50 -56 1),(-41.0821 50.3036 1,50 -41 1),(-26.0821
 50.3036 1,50 -26 1),(-11.0821 50.3036 1,50 -11 1),(3.9179 50.3036 1,50 4
 1),(18.9179 50.3036 1,50 19 1),(33.9179 50.3036 1,50 34 1),(48.9179
 50.3036 1,50 49 1),(-71.0821 50.3036 2,50 -71 2),(-56.0821 50.3036 2,50
 -56 2),(-41.0821 50.3036 2,50 -41 2),(-26.0821 50.3036 2,50 -26
 2),(-11.0821 50.3036 2,50 -11 2),(3.9179 50.3036 2,50 4 2),(18.9179
 50.3036 2,50 19 2),(33.9179 50.3036 2,50 34 2),(48.9179 50.3036 2,50 49
 2))') As geog1,
 ST_GeogFromText('MULTIPOLYGON M (((0 0 2,10 0 1,10 10 -2,0 10 -5,0 0
 -5),(5 5 6,7 5 6,7 7 6,5 7 10,5 5 -2)))') As geog2;

  g1_in_g2 | g2_in_g1 |    dist_g1_g2    |    dist_g2_g1
 ----------+----------+------------------+------------------
  t        | f        | 184534.350787176 | 184534.350787176
 }}}



 There seems to be a bug in both 2.1.2 and 2.0.4

 For 2.0.4 I was able to get the ST_Intersects to flip flop (f, f) and then
 when I ran it again one became a true as you see above

 Anyway clearly the answer is flawed however you look at it.

 I still need to check if the issue shows with plain 2D for this.  I didn't
 see it in the regression output but it may have just been dum luck

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2638>
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