Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data = {'Site 1': '31.336968, -109.560959',
- 'Site 2': '31.347745, -108.229963',
- 'Site 3': '32.277621, -107.734724',
- 'Site 4': '31.655494, -106.420484',
- 'Site 5': '30.295053, -104.014528'}
- import geopandas as gpd
- from shapely.geometry import Point
- gdf_locations = gpd.read_file('/Users/admin/Downloads/tl_2016_us_zcta510/tl_2016_us_zcta510.shp')
- [Longitude] [Latitude]
- x = np.array((-73.986946106, 40.284328461))
- x_pnt = Point(x)
- filter = gdf_locations['geometry'].contains(x_pnt)
- print(gdf_locations.loc[filter, 'GEOID10'])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement