0

I want to read a shapefile using pyshp:

sf = shapefile.Reader(('/tmp/India_PCs_Boundary_4_2_19/India_PCs_Boundary.shp'))

but when I look at the result, the polygons look all squishy and distorted; they're supposed to exactly cover India, but they don't.

One theory for what might have happened is that I did not read the .prj file correctly, and the .prj file contained some sort of projection data that would un-distort the polygons.

When I read the pyshp documentation, it says:

You specify the base filename of the shapefile or the complete filename of any of the shapefile component files.... OR any of the other 5+ formats which are potentially part of a shapefile. The library does not care about file extensions.

But it does not mention .prj specifically.

Does pyshp, by default, read .prj files correctly? If not, is there a way to get it to do so?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.