scales

scales

The registry of spatial scales (geo/scales.yaml).

Functions

Name Description
ancestors Coarser scales a unit of scale nests in, in breadth-first order.
scale_of The scale a geo ID belongs to, from the ID patterns (e.g. a municipality ID -> "municipality").
scales All registered scales, keyed by id.
table The registry of spatial scales as a table, one row per scale (geo.scales()).

ancestors

scales.ancestors(scale, ref=None)

Coarser scales a unit of scale nests in, in breadth-first order.

Administrative scales follow parent; a scale whose units are unions of scale units (a grouping, such as statistical regions) is also an ancestor. The parent chain of each level comes before the groupings of that level, e.g. municipality -> [province, department, country].

scale_of

scales.scale_of(geo_id, ref=None)

The scale a geo ID belongs to, from the ID patterns (e.g. a municipality ID -> "municipality").

scales

scales.scales(active_only=False, ref=None)

All registered scales, keyed by id.

table

scales.table(active_only=False, ref=None)

The registry of spatial scales as a table, one row per scale (geo.scales()).

Columns: label, kind (admin, grouping, grid, custom), parent (the coarser scale it nests in), children, id_pattern, example and status (active or planned). active_only=True hides planned scales.

Example

!pip install -q geo4bolivia
import geo4bolivia as geo
import plotly.express as px

geo.scales()                               # ids, labels, parents, ID patterns
label kind parent children id_pattern example status
scale
country Country admin None None ^BO$ BO active
department Department admin country None ^BO-\d{2}$ BO-04 active
province Province admin department None ^BO-\d{2}-\d{2}$ BO-04-17 active
municipality Municipality (343) admin province None ^BO-\d{2}-\d{2}-\d{2}$ BO-04-17-04 active
municipality_ine Municipality (current INE map) custom None None ^BO-INE-\d{6}$ BO-INE-020101 planned
grid10k 10 km grid cell grid None None ^BO-G10K-r\d{3}c\d{3}$ BO-G10K-r012c034 planned