2

Is there a way to get line segments from a linestring using points with lat/lng coordinates?

ST_Line_Substring is taking float8 start/end points. Is there a way to replace the float8 with lat/lng? I have also seen ST_pointN but I have random points that are not the same as the linestrng edges. ST_Split is useful but I need to install postgis 2.0 and that will require a configuration of my whole system which is in my plan but not yet..

Regards, A

5
  • Do you want to move or snap a Lines Vertices to other Points? Or do you want to create a New LineString from points that are close to your existing LineString? I don't fully understand your question.
    – klewis
    Dec 29, 2011 at 17:22
  • Is this what you are trying to do? Going from left to right, take a linestring, give points on the linesting and return the the all the points in between?
    – Nate
    Dec 29, 2011 at 17:35
  • I 'll explain step by step. I am buffering a polygon and getting its boundary which returns a linestring in which the start and end are the same point. Then, I have random points on the buffered linestring and I want to use them to cut the linestring into pieces. I have written down methods that involve st_split or st_dumppoints but these functions are all in other postgis versions. I hope this makes sense. THX!
    – Antony
    Dec 30, 2011 at 10:13
  • Which version of postgis are you using st_dumppoints has existed since 1.5. ST_SPlit is new in upcoming PostGIS 2.0
    – Regina Obe
    Jan 15, 2012 at 4:33
  • hi, i am now usign 1.5 but i will definatelly install 2.0 once it gets a bit more stable. Anyway, what I did to solve this issue was to get the npoint count and create a dictionary in my code with vertex id as key and point geom as value. I could then use postgis 1.3 functions to come around my problem. Of course when 2.0 is installed, i will be able to greatly optimise my code :)
    – Antony
    Jan 16, 2012 at 12:02

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.