[postgis-tickets] [PostGIS] #2825: ST_Intersection broken with Z coordinates

PostGIS trac at osgeo.org
Mon Jul 7 10:53:04 PDT 2014


#2825: ST_Intersection broken with Z coordinates
---------------------+------------------------------------------------------
 Reporter:  TBL      |       Owner:  pramsey      
     Type:  defect   |      Status:  new          
 Priority:  medium   |   Milestone:  PostGIS 2.1.4
Component:  postgis  |     Version:  2.1.x        
 Keywords:           |  
---------------------+------------------------------------------------------

Comment(by TBL):

 Sorry, I fucked up the example. Try this one:

 {{{
 with linestring as (
   select st_makeline(
     (select
 st_setsrid(st_makeline(st_makepoint((a-400)/20.0,(a-400)/20.0,a)),4326)
 from generate_series(0,800) as a),
     (select
 st_setsrid(st_makeline(st_makepoint(-(a-1200)/20.0,-(a-1200)/20.0,a)),4326)
 from generate_series(801,1600) as a)
   ) as geom
 ),
 polygon as (select ST_GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))',
 4326) as geom)
 select st_astext(st_intersection(linestring.geom, polygon.geom)) from
 linestring, polygon
 }}}

 Expected output would be

 {{{
 MULTILINESTRING Z ((0 0 400, 0.05 0.05 401, [...], 0.95 0.95 419, 1 1
 420),
                    (1 1 1080, 0.95 0.95 1181, [...], 0.05 0.05 1199, 0 0
 1200))
 }}}

 instead I get

 {{{
 MULTILINESTRING Z ((0 0 800,0.05 0.05 800),(0.05 0.05 800,0.1 0.1
 800),(0.1 0.1 800,0.15 0.15 800),(0.15 0.15 800,0.2 0.2 800),(0.2 0.2
 800,0.25 0.25 800),(0.25 0.25 800,0.3 0.3 800),(0.3 0.3 800,0.35 0.35
 800),(0.35 0.35 800,0.4 0.4 800),(0.4 0.4 800,0.45 (...)
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2825#comment:4>
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