Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. import pandas as pd
  2. import geopandas as gpd
  3. import osr
  4.  
  5. shp_file = '/data/user/shapefiles/aleutian-atba/Aleutian_ATBAs.shp'
  6. prj_file = '/data/user/shapefiles/aleutian-atba/Aleutian_ATBAs.prj'
  7.  
  8. # load shapefiles
  9. shapes = gpd.read_file(shp_file)
  10.  
  11. # read in the projection file and apply
  12. with open(prj_file, 'r') as prj_ref:
  13. prj = prj_ref.readline()
  14.  
  15. srs = osr.SpatialReference()
  16. srs.ImportFromESRI([prj])
  17. proj4 = srs.ExportToProj4()
  18.  
  19. shapes.crs = proj4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement