GeoLevel¶
Enum representing the geographic level of a territorial division.
Values¶
| Member | spatial |
metadata |
Description |
|---|---|---|---|
COUNTRY |
"paises" |
"paises" |
Brazil (country level) |
REGION |
"regiao" |
"regioes" |
Macro-regions |
INTERMEDIATE_REGION |
"regiao-intermediaria" |
"regioes-intermediarias" |
Intermediate regions |
IMMEDIATE_REGION |
"regiao-imediata" |
"regioes-imediatas" |
Immediate regions |
STATE |
"UF" |
"estados" |
Federative units |
MUNICIPALITY |
"municipio" |
"municipios" |
Municipalities |
Member attributes¶
Each GeoLevel member exposes two sub-attributes used internally:
| Attribute | Type | Usage |
|---|---|---|
.spatial |
SpatialLevel |
intrarregiao parameter of the mesh API |
.metadata |
Metadata |
URL segment of the localities API |
Usage¶
from geodata import GeoData, GeoLevel, Quality
geodata = GeoData(GeoLevel.MUNICIPALITY, Quality.LOW)
print(geodata.polygons.head())
Iterate over all levels:
GeoLevel is also used internally by GeoLocator to iterate through all boundary layers.