a guest Mar 20th, 2019 72 Never
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()
- proj4 = srs.ExportToProj4()
- shapes.crs = proj4
RAW Paste Data