Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. data = {'Site 1': '31.336968, -109.560959',
  2. 'Site 2': '31.347745, -108.229963',
  3. 'Site 3': '32.277621, -107.734724',
  4. 'Site 4': '31.655494, -106.420484',
  5. 'Site 5': '30.295053, -104.014528'}
  6.  
  7. import geopandas as gpd
  8. from shapely.geometry import Point
  9. gdf_locations = gpd.read_file('/Users/admin/Downloads/tl_2016_us_zcta510/tl_2016_us_zcta510.shp')
  10.  
  11. [Longitude] [Latitude]
  12. x = np.array((-73.986946106, 40.284328461))
  13. x_pnt = Point(x)
  14. filter = gdf_locations['geometry'].contains(x_pnt)
  15. print(gdf_locations.loc[filter, 'GEOID10'])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement