PMTilesBR

Geospatial tiled datasets for spatial visualization and analysis in Brazil.
Author

Daniel Vartanian, Camila N.Fernandes, & Mariana Giannotti

Published

April 4, 2026

Overview

This website hosts PMTiles files for spatial visualization and analysis in Brazil.

PMTiles is a format for storing and serving tiled geospatial data. It is designed to be efficient, scalable, and easy to use, making it ideal for web applications and data visualization.

Learn more about PMTiles and how to use them in the following sections.

The map below shows Brazil municipality boundaries as PMTiles, sourced from the geobr R package (Pereira & Goncalves, n.d.).

Click and drag to pan. Right-click and drag to rotate. Hover over a shape to see the municipality name. Use the controls to zoom, take a screenshot, or view in fullscreen.

Why Use PMTiles?

When working with complex geometries in web mapping applications like Mapbox, MapLibre, and Leaflet, performance can become a real problem. Shapes with many vertices make rendering slow, bloat file sizes, and generally make life harder. PMTiles addresses this by letting you serve precompiled tiles directly from the web, rather than bundling them into your application.

Collections

PMTilesBR includes several collections of PMTiles files sourced from popular geospatial R packages. Below is an overview of each one:

See the Usage section for instructions on how to access and use the PMTiles files.

Not all parameter combinations may be available. Refer to pmtiles.yaml for the full list of available PMTiles files.

Unless you really need to, use the simplified versions of the files, which are smaller and faster to load. The non-simplified versions are available for those who need the highest level of detail, but they may not be necessary for most applications.

Sourced from the geobr R package (Pereira & Goncalves, n.d.).

Parameters

  • Code: "all" (for all municipalities) or a specific municipality code (e.g., 3550308 for São Paulo)
  • Year: 1872-2024
  • Simplified: TRUE/FALSE
  • Minimum Zoom: 0-22
  • Maximum Zoom: 0-22

View

File: https://tiles.pmtiles.com.br/geobr/read_municipality/code-all-year-2024-simplified-TRUE-min_zoom-2-max_zoom-10.pmtiles

H3 Grids

This collection also counts with PMTiles files that were processed with the h3jsr R package (O’Brien, 2023), which converts spatial data into H3 grids (Uber Technologies, n.d.). These files have an additional res parameter that indicates the H3 resolution used for processing. The higher the resolution, the more detailed the grid will be, but also the larger the file size and the slower the rendering.

To use this version of the files, add h3jsr and res parameters to the URL. For example, to access the H3 version of the file with municipality code 3550308, year 2024, without simplified geometries, zoom levels 2-10, and H3 resolution 9, the URL would be:

File: https://tiles.pmtiles.com.br/geobr/read_municipality/h3jsr/res-9/code-3550308-year-2024-simplified-FALSE-min_zoom-2-max_zoom-10.pmtiles

If you’re seeing missing hexagons when using these files, it’s likely you are trying to match a H3 grid made with a simplified geometry with an H3 grid made with a non-simplified geometry. To fix this, make sure to use the same value for the simplified parameter in both the source function and the PMTiles file.

Sourced from the geobr R package (Pereira & Goncalves, n.d.).

Parameters

  • Year: 1872-2020
  • Code: "all" (for all states) or a specific state code (e.g., 35 for São Paulo)
  • Simplified: TRUE/FALSE
  • Minimum Zoom: 0-22
  • Maximum Zoom: 0-22

View

File: https://tiles.pmtiles.com.br/geobr/read_state/code-all-year-2020-simplified-TRUE-min_zoom-2-max_zoom-10.pmtiles

Sourced from the geobr R package (Pereira & Goncalves, n.d.).

Parameters

  • Year: 2000-2020
  • Simplified: TRUE/FALSE
  • Minimum Zoom: 0-22
  • Maximum Zoom: 0-22

View

File: https://tiles.pmtiles.com.br/geobr/read_region/year-2020-simplified-TRUE-min_zoom-2-max_zoom-10.pmtiles

Sourced from the geobr R package (Pereira & Goncalves, n.d.).

Parameters

  • Years: 1872-2020
  • Simplified: TRUE/FALSE
  • Minimum Zoom: 0-22
  • Maximum Zoom: 0-22

View

File: https://tiles.pmtiles.com.br/geobr/read_country/year-2020-simplified-TRUE-min_zoom-2-max_zoom-10.pmtiles

Sourced from the geodata R package (Hijmans et al., 2024).

Parameters

  • Country: ISO 3166-1 alpha-3 standard (e.g., BRA, ITA, or USA)
  • Level: 0-1
  • Version: "latest"/"4.1"/"4.0"/"3.6"
  • Resolution: 1-2
  • Minimum Zoom: 0-22
  • Maximum Zoom: 0-22

View

File: https://tiles.pmtiles.com.br/geodata/gadm/country-ARM-level-0-version-latest-resolution-1-min_zoom-2-max_zoom-10.pmtiles

Sourced from the geodata R package (Hijmans et al., 2024).

Parameters

  • Level: 0
  • Version: "latest"/"3.6"
  • Resolution: 1-5
  • Minimum Zoom: 0-22
  • Maximum Zoom: 0-22

The resolution parameter always comes after version, to match with the gadm() function.

View

File: https://tiles.pmtiles.com.br/geodata/world/level-0-version-latest-resolution-5-min_zoom-0-max_zoom-6.pmtiles

Usage

All files are hosted at https://tiles.pmtiles.com.br and follow a consistent URL structure based on the collection, source function, parameters, and zoom levels. The sections below cover how to access the files, inspect their metadata, and use them in your applications.

For a complete list of available PMTiles files and their metadata, see pmtiles.yaml.

Collections

PMTilesBR have different collections of tiles for you to choose. These collections are typically sourced from popular R packages for geospatial data, such as geobr (Pereira & Goncalves, n.d.) and geodata (Hijmans et al., 2024). Each collection has its own set of parameters that you can use to get the specific tiles you need. See the Collections section to learn more.

Patterns

To access the PMTiles files, construct a URL following this naming pattern:

https://tiles.pmtiles.com.br/
├─ {collection}/
    ├─ {function}/
        ├─ {parameters-values}-{min_zoom-value}-{max_zoom-value}.pmtiles

Where:

  • collection: The data collection name, typically the source R package (e.g., geobr).
  • function: The function used to source the data (e.g., read_municipality).
  • parameters-values: The parameter names and values passed to the function.
  • min_zoom-value: The minimum zoom level.
  • max_zoom-value: The maximum zoom level.

All files include min_zoom and max_zoom in their names. Unlisted parameters use their default values.

For example, a file from the geobr package using read_municipality() with municipality code 3550308, year 2024, simplified geometries, and zoom levels 2-10 would be:

https://tiles.pmtiles.com.br/geobr/read_municipality/code-3550308-year-2024-simplified-TRUE-min_zoom-2-max_zoom-10.pmtiles

Use pmtiles.io to easily inspect each PMTiles file before using.

Example

The simplest way to load a PMTiles file is to pass its URL directly to your application. Here is an example using R and the mapgl package (Walker, 2026):

library(dplyr)
library(geobr)
library(mapgl)
library(pmtiles) # github.com/walkerke/pmtiles
library(purrr)
code <- "all"
year <- 2020
simplified <- TRUE
min_zoom <- 2
max_zoom <- 10
pmtiles_file <- file.path(
  "https://tiles.pmtiles.com.br",
  "geobr",
  "read_state",
  paste0(
    # fmt: skip
    paste(
      "code", code,
      "year", year,
      "simplified", simplified,
      "min_zoom", min_zoom,
      "max_zoom", max_zoom,
      sep = "-"
    ),
    ".pmtiles"
  )
)
pmtiles_layer <-
  pmtiles_file |>
  pm_show(tilejson = TRUE) |>
  pluck("vector_layers", 1, "id")
state_data <-
  code |>
  read_state(
    year = year,
    simplified = simplified
  ) |>
  filter(
    # MG, ES, RJ, SP
    code_state %in% c(31, 32, 33, 35)
  )
scale_fill_mapgl <- match_expr(
  column = "code_state",
  values = state_data |>
    pull(code_state),
  stops = c(
    "#efd46a", # MG
    "#db5025", # ES
    "#070808", # RJ
    "#db5025" # SP
  ),
  default = "#868489"
)
maplibre(
  # c(xmin, ymin, xmax, ymax)
  bounds = c(-51.0, -26, -39.6, -13.5),
  projection = "mercator",
) |>
  add_pmtiles_source(
    id = "state_boundaries",
    url = pmtiles_file,
    source_type = "vector"
  ) |>
  add_fill_layer(
    id = "fill",
    source = "state_boundaries",
    source_layer = pmtiles_layer,
    fill_color = scale_fill_mapgl,
    tooltip = "name_state",
    hover_options = list(
      fill_color = get_brand_color("gray-l50"),
      fill_opacity = 1
    ),
    # fmt: skip
    filter = list(
      "in",
      list("get", "code_state"),
      list("literal", list(35, 33, 31, 32))
    )
  ) |>
  add_line_layer(
    id = "outline",
    source = "state_boundaries",
    source_layer = pmtiles_layer,
    line_color = "white",
    line_width = 1
  )

H3 Grids

Some collections also include files with geometries indexed using the h3jsr R package (O’Brien, 2023), which converts spatial data into H3 hexagonal grids (Uber Technologies, n.d.). These files include additional parameters in their URLs, such as the H3 resolution level. See geobr::read_municipality in the Collections section for examples and details.

Metadata

One way to check for a PMTiles file metadata is to use the pm_show() function from the pmtiles R package (Walker, 2025). This function retrieves the metadata of a PMTiles file, including the bounds, zoom levels, and the fields available. Here is an example:

file <- file.path(
  "https://tiles.pmtiles.com.br",
  "geobr",
  "read_municipality",
  paste0(
    # fmt: skip
    paste(
      "code", 3550308,
      "year", 2024,
      "simplified", TRUE,
      "min_zoom", 2,
      "max_zoom", 10,
      sep = "-"
    ),
    ".pmtiles"
  )
)
file |>
  pm_show(tilejson = TRUE) |>
  pluck("vector_layers", 1, "fields")
#> $abbrev_state
#> [1] "String"
#> 
#> $code_muni
#> [1] "Number"
#> 
#> $code_region
#> [1] "Number"
#> 
#> $code_state
#> [1] "Number"
#> 
#> $name_muni
#> [1] "String"
#> 
#> $name_region
#> [1] "String"
#> 
#> $name_region_en
#> [1] "String"
#> 
#> $name_state
#> [1] "String"

The PMTiles layer id is always the name of the source function.

file |>
  pm_show(tilejson = TRUE) |>
  pluck("vector_layers", 1, "id")
#> [1] "read_municipality"

Questions and Requests

If you have any questions about the data, how to use it, or if you want to request a specific PMTiles file, please visit the Discussions tab of the project code repository. We will do our best to assist you and consider your requests for future updates.

Citation

When using this data, you must also cite the original data sources.

To cite this work, please use the following format:

Vartanian, D., Fernandes, C. N., & Giannotti, M. A. (2026). PMTilesBR: Tiled geospatial data for Brazil [Computer software]. Center for Metropolitan Studies, University of São Paulo. https://doi.org/10.5281/zenodo.19157888

A BibLaTeX entry for LaTeX users is:

@software{vartanian2026,
  title = {PMTilesBR: Tiled geospatial data for Brazil},
  author = {{Daniel Vartanian} and {Camila Nastari Fernandes} and {Mariana Abrantes Giannotti}},
  year = {2026},
  address = {São Paulo},
  institution = {Center for Metropolitan Studies, University of São Paulo},
  langid = {en},
  doi = {https://doi.org/10.5281/zenodo.19157888}
}

License

License: GPLv3 License: CC BY-NC-SA 4.0

The original data sources may be subject to their own licensing terms and conditions.

The code in this website is licensed under the GNU General Public License Version 3. All PMTiles files are released under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International license.

Copyright (C) 2026 Center for Metropolitan Studies

The code in this website is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your option)
any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>.

Acknowledgments

This project was developed with support from the Center for Metropolitan Studies (CEM) based at the School of Philosophy, Letters and Human Sciences (FFLCH) of the University of São Paulo (USP) and at the Brazilian Center for Analysis and Planning (CEBRAP).

This project was financed, in part, by the São Paulo Research Foundation (FAPESP), Brazil. Process Number 2025/17879-2.

References

Hijmans, R. J., Barbosa, M., Ghosh, A., & Mandel, A. (2024). geodata: Download geographic data [Computer software]. https://doi.org/10.32614/CRAN.package.geodata
O’Brien, L. (2023). h3jsr: Access Uber’s H3 library [Computer software]. https://doi.org/10.32614/CRAN.package.h3jsr
Pereira, R. H. M., & Goncalves, C. N. (n.d.). geobr: Download official spatial data sets of Brazil [Computer software]. https://doi.org/10.32614/CRAN.package.geobr
Uber Technologies. (n.d.). H3: A hexagonal hierarchical geospatial indexing system [Dataset]. https://h3geo.org
Walker, K. (2025). pmtiles: R Interface to PMTiles [Computer software]. https://github.com/walkerke/pmtiles
Walker, K. (2026). mapgl: Interactive Maps with ’Mapbox GL JS’ and ’MapLibre GL JS [Computer software]. https://walker-data.com/mapgl