Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import geopandas as gpd
- from shapely.geometry import Point
- area = gpd.GeoDataFrame.from_file('areas.shp')
- print area.crs
- {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}
- location['geometry'] = location.Geolocation.apply(lambda x: Point(eval(x)))
- gdf = gpd.GeoDataFrame(location, geometry='geometry', crs={'init': 'epsg:4326'})
- area = area.to_crs({'init': 'epsg:4326'})
- merged = gpd.sjoin(area, gdf, op='intersects')
Add Comment
Please, Sign In to add comment