Guest User

Untitled

a guest
Jul 20th, 2018
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. import geopandas as gpd
  2. from shapely.geometry import Point
  3. area = gpd.GeoDataFrame.from_file('areas.shp')
  4. print area.crs
  5.  
  6. {u'lon_0': -91.8666666667, u'datum': u'NAD83', u'y_0': 3000000, u'no_defs': True, u'proj': u'lcc', u'x_0': 6200000, u'units': u'm', u'lat_2': 77, u'lat_1': 49, u'lat_0': 63.390675}
  7.  
  8. location['geometry'] = location.Geolocation.apply(lambda x: Point(eval(x)))
  9. gdf = gpd.GeoDataFrame(location, geometry='geometry', crs={'init': 'epsg:4326'})
  10.  
  11. area = area.to_crs({'init': 'epsg:4326'})
  12.  
  13. merged = gpd.sjoin(area, gdf, op='intersects')
Add Comment
Please, Sign In to add comment