Nearest neighbor between point layer and line layer?

المشرف العام

Administrator
طاقم الإدارة
I've asked this question several times on stackoverflow and irc between #qgis and #postgis and I also tried to code it or implement it my self in postgis with no real answer.

Using programming (most preferably python), I'd like to draw a line from a point layer, to its projection on the nearest line of a line or polygon layer.

As of now most of my data is in ESRI's shape and postgis formats; however, I'd rather stay away from a postgis solution as I'm predominantly a shp + qgis user.

An ideal solution would be to implement GDAL/OGR with python or similar libraries

  • Using the GDAL/OGR libraries where should I start? would it be possible to give a solution plan?
  • Can I use NetworkX to do the nearest neighbor analysis?
  • Is this actually possible?
If it's easier, the points could connect to the segment end point instead of a projected point



أكثر...
 
أعلى