Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

share|improve this question
    
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 '11 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 '11 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 '11 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 –  LR1234567 Jan 15 '12 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 '12 at 12:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.