codespearhead / geoboundaries

Download the vector file of the boundaries of administrative divisions anywhere in the world

Home Page:https://github.com/codespearhead/geoboundaries

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool




Download the vector file of the boundaries of administrative divisions anywhere in the world


Project Goal

Enable developers to generate updated vectors of boundaries of administrative divisions from OpenStreetMap via ready-to-go code snippets.

Introduction

Note: For other countries, pick a more appropriate tag you can find by looking through the tags of the desired administrative division in your country, which can by found by looking up some of said divisions on OpenStreetMap.

TODO: Explain what OpenStreetMap and the Overpass API are

All examples can be run online via Overpass Turbo.

TODO: Explain ISO3166-2

Code Snippets

  1. Get all Brazilian territories / borders
[out:json];
rel["ISO3166-1"="BR"];
out geom;
  1. Get all Brazilian Geographic Regions
[out:json];
area["ISO3166-1"="BR"];
relation["admin_level"="3"](area);
out geom;
  1. Get all Brazilian States
[out:json];
area["ISO3166-1"="BR"];
relation["admin_level"="5"](area);
out geom;
  1. Get a specific Brazilian State
[out:json];
area["ISO3166-1"="BR"]->.searchArea;
relation["ISO3166-2"="BR-AM"](area.searchArea);
out geom;
  1. Get a specific Brazilian City
[out:json];
area["ISO3166-1"="BR"]->.searchArea;
relation["is_in:state"="Amazonas"]["name"="Manaus"](area.searchArea);
out geom;
  1. Get all official neighborhoods in a Brazilian city (might be outdated)
[out:json];
area["ISO3166-1"="BR"]->.searchArea;
area["is_in:state"="Amazonas"]->.searchArea;
relation["admin_level"~"10"]["border_type"!="district"](area.searchArea);
out geom;

About

Download the vector file of the boundaries of administrative divisions anywhere in the world

https://github.com/codespearhead/geoboundaries

License:Apache License 2.0


Languages

Language:Python 76.0%Language:JavaScript 24.0%