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 ()?

+2


source to share


4 answers


For posterity:



http://bitbucket.org/miracle2k/pyutils/changeset/156c60ec88f8/

+2


source


In another forum, I suggested overriding the (simple) PostGIS algorithm in Python using Shapely .



+2


source


For posterity, these features are available in Shapely 1.2.

+2


source


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.

0


source







All Articles