I drew 2 shapefiles - point.shp and line.shp. Line.shp has some lines intersecting points in point.shp. I converted the shapefile to PostgreSQL, but how can I make a spatial query to select a line from one point to another point ?
Thanks all.
|
I drew 2 shapefiles - point.shp and line.shp. Line.shp has some lines intersecting points in point.shp. I converted the shapefile to PostgreSQL, but how can I make a spatial query to select a line from one point to another point ? Thanks all. |
|||||||
|
|
Doing this from memory, but it should be as simple as this. Replace the_geom with the name of your geometry column.
|
|||
|
|
|
You need to use a topology. In this case a topology in the form of a graph. You can use pgRouting (http://pgrouting.org/) in order to achieve that. Take a look at http://underdark.wordpress.com/2011/02/07/a-beginners-guide-to-pgrouting/. Also, you will need to break those lines at the points. pgRouting needs the begin point and the endpoint of each line. I think you will find out this by yourself. |
|||
|
|