GIS: line_locate_point () in Python
I get started a lot when it comes to GIS, but I think I understand the basics - it doesn't seem to be difficult. But: all these acronyms and different libraries, GEOS, GDAL, PROJ, PCL, Shaply, OpenGEO, OGR, OGC, OWS and what is wrong, seeming depending on the number of others, overwhelm me a little.
Here's what I would like to do: Given the number of points and a linear line, I want to locate on the line closest to a specific point. In other words, what PostGIS line_locate_point () does:
http://postgis.refractions.net/documentation/manual-1.3/ch06.html#line_locate_point
Also, I want to use plain Python. In which library or libraries should I generally take a look at this spatial computation in Python, and is there one out there that specifically supports the equivalent of line_locate_point ()?
For posterity:
http://bitbucket.org/miracle2k/pyutils/changeset/156c60ec88f8/
In another forum, I suggested overriding the (simple) PostGIS algorithm in Python using Shapely .
For posterity, these features are available in Shapely 1.2.
All you need is Shapely, if you have shapefiles for points and line lines, the line.distance (point) loop in for will do the trick. With this, you can find the closest point to the line or vice versa. Be sure to check out GDAL, Fiona, Shapely to complete this.