I use geopandas
's to_file()
method to read a shapefile into a geopandas object. The shapefile has a valid .prj
file with a ESRI WKT style projection information:
PROJCS["Slovenia_1996_Slovene_National_Grid",GEOGCS["GCS_Slovenia 1996",DATUM["D_Slovenia_Geodetic_Datum_1996",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",500000],PARAMETER["false_northing",-5000000],UNIT["Meter",1]]
With this, a created geodataframe has a crs attribute set as a dictionary, which I find it hard to work with, compared to proj4 string or epsg codes:
{u'lon_0': 15, u'k': 0.9999, u'ellps': u'GRS80', u'y_0': -5000000, u'no_defs': True, u'proj': u'tmerc', u'x_0': 500000, u'units': u'm', u'lat_0': 0}
Geopandas projection docs make it clear that .crs
method accepts many different forms of crs information (epsg codes, dictionaries, proj4 strings,...), but it seems that there there is no control about the desired format when writing geopandas to shapefile.
Question: Is there any way to specifiy the desired crs formatting or any built-in method to switch between the diffent formattings of crs attribute?