Skip to content

Instantly share code, notes, and snippets.

@ivopbernardo
Created May 5, 2022 21:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivopbernardo/2192ac015ee85afb28a3a2ec4af4b122 to your computer and use it in GitHub Desktop.
Save ivopbernardo/2192ac015ee85afb28a3a2ec4af4b122 to your computer and use it in GitHub Desktop.
GeoData DareData Blog
# Read data directly from the portuguese gov website.
parishes_url = "zip+https://dados.gov.pt/s/resources/freguesias-de-portugal/20181112-195834/cont-aad-caop2017.zip"
parishes = gpd.read_file(parishes_url)
# Left Join the house data to the parishes data, if house is `within` parish.
house_data_gdf = gpd.sjoin(house_data_gdf, parishes, how="left", op="within")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment