2

As occurred in this question: Add CRS to a shapefile in Geopandas?

f.shp has not crs

This code:

 shp=gpd.read_file('f.shp')
 shp.crs = {'init' :'epsg:2100'} 
 out=path
 shp.to_file(out)

doesn't store the crs in the proj file and when I open it in Arcmap it says that it doesn't have a crs.

Although

shp.crs

gives

{'init': 'epsg:2100'}

How can I make it have the assigned crs when I export it?

I also tried:

shp.to_file(out,crs_wkt='2100')

so it provides the crs while exporting but that didn't fix it.

  • 1
    Obviously, I don't have your input file "f.shp", but I just ran your code on a random shapefile at hand, and everything worked. PRJ file was successfully created and had expected contents beginning PROJCS["GGRS87_Greek_Grid", etc. Using GeoPandas 0.3.0. – Lee Hachadoorian Jul 19 '18 at 19:11
  • Can you provide a reproducible example? (and specify which version of geopandas you are using?) – joris Jul 26 '18 at 12:38

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.