lundi 1 décembre 2014

Creating new lines from existing lines based on points lying along the lines


I am pretty new to PostGIS and I have a problem I just can't figure how to start. I have a table of lines(id, name, the_geom) and a table of points (id, name, the_geom). Each point is located on a line and a line might have 1 or more points etc. How can I create new lines from each line using points along the line given just the lines and points tables. For example, line ABCDEFG is a single line with its unique name and unique id in the lines table. How can I create new lines AB, BC, CD, DE, EF, FG such that they all have the same name as line ABCDEFG but different id, and their new geometry into a new table of lines using postgis? Note that A and G are the start and end of line ABCDEFG and not actual points in the points table. Thanks for your help.


line with points lying along





Aucun commentaire:

Enregistrer un commentaire