[postgis-devel] issues with line_substring() and 4d lines

Alex Mayrhofer axelm-postgis at nona.net
Tue Jan 17 23:06:28 PST 2006


Hi,

it seems to me as if there is a bug in line_substring() when performing the 
function on 4D lines:

sketch=# select asewkt(line_substring(geomfromewkt('SRID=4326;LINESTRING(0 0 
0 0, 1 1 1 1, 2 2 2 2, 3 3 3 3, 4 4 4 4)'), 0.5, 0.8));

                       asewkt
---------------------------------------------------
  SRID=4326;LINESTRING(2 2 0 0,3 3 2 2,3.2 3.2 0 0)
(1 row)

Please note the third output value - there is a problem with the Z and M 
value (i'd assume them to be 0 as well) [it looks like a copy of the 
previous points corrdinates).

I can reproduce similar issues with more complex geometries as well:

SRID=4326;LINESTRING(16.3116663381532 48.1343234522231 0 0,16.311761 
48.134512 16.311517 48.134026,16.31199 48.135002 16.311761 
48.134512,16.311828 48.135112 16.31199 48.135002,16.311463 48.135228 
16.311828 48.135112,16.311485 48.135325 16.311463 48.135228,16.311978 
48.135789 16.311485 48.135325,16.312465 48.136218 16.311978 
48.135789,16.312534 48.136492 16.312465 48.136218, ...

(original Z and M contain altitude and ctime, so those output values are for 
sure out of range of the input values, and seem to originate from X and Y 
values).

Additionally, a question: are there any plans to extend the various linear 
referencing functions to also interpolate Z (and optionally M) values?

thanks,

Alex
---
http://nona.net/features/map/



More information about the postgis-devel mailing list