Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- import geopandas as gpd
- import osr
- shp_file = '/data/user/shapefiles/aleutian-atba/Aleutian_ATBAs.shp'
- prj_file = '/data/user/shapefiles/aleutian-atba/Aleutian_ATBAs.prj'
- # load shapefiles
- shapes = gpd.read_file(shp_file)
- # read in the projection file and apply
- with open(prj_file, 'r') as prj_ref:
- prj = prj_ref.readline()
- srs = osr.SpatialReference()
- srs.ImportFromESRI([prj])
- proj4 = srs.ExportToProj4()
- shapes.crs = proj4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement