[postgis-tickets] [PostGIS] #2825: ST_Intersection broken with Z coordinates
PostGIS
trac at osgeo.org
Mon Jul 7 09:58:39 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):
I just posted that on freenode:
{{{
with linestring as (select ST_GeomFromText('LINESTRING Z (-1 -1 0, -0.5
-0.5 1, 0 0 2, 0.5 0.5 3, 1 1 4, 1.5 1.5 5, 2 2 6)', 4326) 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
}}}
Result is as expected: "LINESTRING Z (0 0 2,0.5 0.5 3,1 1 4)"
But with a slightly longer linestring:
{{{
with linestring as (select ST_GeomFromText('LINESTRING Z (-20.00 -20.00 0,
-19.95 -19.95 1, [...], 19.990 19.990 7998, 19.995 19.995 7999)', 4326) 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
}}}
"MULTILINESTRING Z ((0 0 400,0.005 0.005 2200.55),(0.005 0.005
2200.55,0.01 0.01 2201.1),(0.01 0.01 2201.1,0.015 0.015 2201.65),(0.015
0.015 2201.65,0.02 0.02 2202.2),(0.02 0.02 2202.2,0.025 0.025
2202.75),(0.025 0.025 2202.75,0.03 0.03 2203.3),(0.03 0.03 2 (...)"
The z coordinates of the result are somehow mixed up, while the x/y
coordinates seem to be right (the z at 0 0 should be 4000, at 0.005 0.005
it should be 4001 ...). The returned values don't make any sense in my
eyes.
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2825#comment:2>
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