SELECT ST_AsText(ST_Segmentize(ST_GeomFromText('LINESTRING(0 0, 10 0)'), 3));
gives LINESTRING(0 0,3 0,6 0,9 0,10 0)
but the expected result is LINESTRING(0 0,2.5 0,5 0,7.5 0,10 0)
. How can this be done?
See for example the documentation for qgis:densifygeometriesgivenaninterval:
"E.g. specifying a distance 3 would cause the segment [0 0] -> [10 0] to be converted to [0 0] -> [2.5 0] -> [5 0] -> [7.5 0] -> [10 0], since 3 extra nodes are required on the segment and spacing these at 2.5 increments allows them to be evenly spaced over the segment."
No comments:
Post a Comment