Python Script For A Geography Function

Python script which uses shapely and and pyshp libraries

http://code.google.com/p/pyshp/
http://toblerity.github.com/shapely/

Use pyshp to import my shapefile (.shp), which I provide. The shapefile has 200 multipolygons with a “name” attribute, you can read with pyshp read() function

Input to script is an (x,y) coordinate

Use shapely contains() function on the shape objects derived above to see whether the (x,y) point is inside any of the multipolygons, and if true, the name of the …

Leave a Reply

Your email address will not be published. Required fields are marked *