SHARE
TWEET

Untitled

a guest Mar 20th, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top