You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I'm reading some inputs which are in projections EPSG:26796 and ESRI:102696. I noticed that ogrinfo and ogr2ogr have some awareness of these and can tell me about them and even automatically convert to other projections when warranted. I had a look through the pyshp code (eg shapefile.Reader._Reader__dbfHeader()), and I don't find a way to inspect or even a hook for where I might get started to find this out. Any chance of a patch to provide something like a shapefile.Reader.projection field?
The text was updated successfully, but these errors were encountered:
The shapefile projection information is stored in the .prj file, which is in Well Known Text (WKT) format. Having some way to easily gain access the the .prj file might be a good feature.
In order to reproject this, you could use pyCRS to convert the WKT format to a PROJ.4 string. Then you could use pyproj to reproject the data. However, pyshp seems to be a very slim API that doesn't try to do everything for you. If a feature like this added, the requirements should be optional.
Agree, that would be a good feature. I guess we could just read it in the same way we read the shp, shx, and dbf files, and remember to close it as well.
What would be a good way to access it, maybe storing it as a string in a .proj attribute?
Fiona has a .crs attribute documented (coordinate reference system) , but that is for the dictionary of the PROJ.4 projection string.
Fiona also has a less documented .crs_wkt attribute, which give the WKT representation. (Behind the scenes it calls the underlying OGR for this info, through get_crs_wkt().)
Hello,
I'm reading some inputs which are in projections EPSG:26796 and ESRI:102696. I noticed that ogrinfo and ogr2ogr have some awareness of these and can tell me about them and even automatically convert to other projections when warranted. I had a look through the pyshp code (eg
shapefile.Reader._Reader__dbfHeader()
), and I don't find a way to inspect or even a hook for where I might get started to find this out. Any chance of a patch to provide something like ashapefile.Reader.projection
field?The text was updated successfully, but these errors were encountered: