# Historical municipal meshes

#### Renato Prado Siqueira

    library(brazilmaps)

## Inventory

`brmap_editions()` is the authoritative installed inventory. It records feature counts, compressed file sizes, checksums, processing metadata and exact IBGE source URLs.

    inventory <- brmap_editions()
    inventory[c("year", "n_features", "md5")]
    #>   year n_features                              md5
    #> 1 2000       5508 1be4a02624d2460629b84d020708999b
    #> 2 2001       5561 b8df8cf8381f914886d51292a426d555
    #> 3 2007       5564 7edccbdca3ca8f1d29a26473076ac9ad
    #> 4 2010       5565 5ee6fed71c95a72552e8449c4a6da22b
    #> 5 2023       5570 468f8575f7cb28193622c0e287ae1eb1
    #> 6 2025       5571 4b48235c90b1536505627ea723165b5d

Every row represents a bundled milestone. Within each consecutive run with the same municipality count, the package keeps only the latest official edition. This preserves every change in the number of municipalities while leaving more space for less aggressive geometry simplification.

## Select an edition

    mesh_2000 <- get_brmap("municipality", year = 2000)
    mesh_2010 <- get_brmap("municipality", year = 2010)
    mesh_current <- get_brmap("municipality")

    c(
      `2000` = nrow(mesh_2000),
      `2010` = nrow(mesh_2010),
      current = nrow(mesh_current)
    )
    #>    2000    2010 current
    #>    5508    5565    5571

An unavailable year produces an informative error instead of silently substituting another edition.

## Compare a state through time

    go_2000 <- get_brmap(
      "municipality", year = 2000, filters = list(state = 52)
    )
    go_current <- get_brmap("municipality", filters = list(state = 52))

    plot_brmap(go_2000) +
      ggplot2::labs(title = "Municipal mesh of Goiás — 2000")

The geometry is simplified consistently for visualization, retaining 5% of weighted Visvalingam vertices. Do not calculate legal areas or cadastral boundaries from these objects.

## Hierarchy and historical codes

`state_code` and `region_code` are stored with each edition. Immediate, intermediate, microregion and mesoregion fields are attached from the installed current DTB when a municipality code can be matched. Consequently, filtering a historical edition by a current regional division is a present-day classification of the historical geometry, not a reconstruction of that division in the selected year.

All objects are returned in SIRGAS 2000 (EPSG:4674), including early meshes whose source datum was SAD69.