Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a shp file with the latitudes and longitudes for the boundaries for various geographic regions. I'd like to convert the shp file into lists of just latitudes and longitudes for the regions. I'll then use these lists in my program to determine which region a specific point resides in. Is there a quick way to do this conversion or will I have to read up on the APIs? Even converting the shp file into GML would be a help as I could easily access that programmatically.

share|improve this question
2 will convert shp to gml – Mapperz Sep 26 '12 at 15:08
up vote 6 down vote accepted

You can use Python shapefile library pyshp

>>> import shapefile
>>> sf = shapefile.Reader("shapefiles/blockgroups")
>>> shapes = sf.shapes()
>>> # Read the bounding box from the 4th shape
>>> shapes[3].bbox
[-122.485792, 37.786931000000003, -122.446285, 37.811019000000002]
>>>#  Read the 8th point in the 4th shape
>>> shapes[3].points[7]
[-122.471063, 37.787402999999998]

i hope it helps you....

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.