-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch.json
More file actions
65 lines (65 loc) · 15.8 KB
/
search.json
File metadata and controls
65 lines (65 loc) · 15.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
[
{
"objectID": "index.html",
"href": "index.html",
"title": "PMTilesBR",
"section": "",
"text": "This website hosts PMTiles files for spatial visualization and analysis in Brazil.\nPMTiles 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.\nLearn more about PMTiles and how to use them in the following sections.\n\n\n\n\n\n\n\nThe map below shows Brazil municipality boundaries as PMTiles, sourced from the geobr R package (Pereira & Goncalves, n.d.).\n\n\n\n\n\n\n\n\n\nClick 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."
},
{
"objectID": "index.html#overview",
"href": "index.html#overview",
"title": "PMTilesBR",
"section": "",
"text": "This website hosts PMTiles files for spatial visualization and analysis in Brazil.\nPMTiles 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.\nLearn more about PMTiles and how to use them in the following sections.\n\n\n\n\n\n\n\nThe map below shows Brazil municipality boundaries as PMTiles, sourced from the geobr R package (Pereira & Goncalves, n.d.).\n\n\n\n\n\n\n\n\n\nClick 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."
},
{
"objectID": "index.html#why-use-pmtiles",
"href": "index.html#why-use-pmtiles",
"title": "PMTilesBR",
"section": "Why Use PMTiles?",
"text": "Why Use PMTiles?\nWhen 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."
},
{
"objectID": "index.html#collections-1",
"href": "index.html#collections-1",
"title": "PMTilesBR",
"section": "Collections",
"text": "Collections\nPMTilesBR includes several collections of PMTiles files sourced from popular geospatial R packages. Below is an overview of each one:\n\n\n\n\n\n\nSee the Usage section for instructions on how to access and use the PMTiles files.\n\n\n\n\n\n\n\n\n\nNot all parameter combinations may be available. Refer to pmtiles.yaml for the full list of available PMTiles files.\n\n\n\n\n\n\n\n\n\nUnless 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.\n\n\n\n\n\ngeobr::read_municipality\ngeobr::read_state\ngeobr::read_region\ngeobr::read_country\ngeodata::gadm\ngeodata::world\n\n\n\nSourced from the geobr R package (Pereira & Goncalves, n.d.).\nParameters\n\nCode: \"all\" (for all municipalities) or a specific municipality code (e.g., 3550308 for São Paulo)\nYear: 1872-2024\nSimplified: TRUE/FALSE\n\nMinimum Zoom: 0-22\nMaximum Zoom: 0-22\nView\nFile: https://tiles.pmtiles.com.br/geobr/read_municipality/code-all-year-2024-simplified-TRUE-min_zoom-2-max_zoom-10.pmtiles\n\n\n\n\n\n\nH3 Grids\nThis 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.\nTo 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:\nFile: https://tiles.pmtiles.com.br/geobr/read_municipality/h3jsr/res-9/code-3550308-year-2024-simplified-FALSE-min_zoom-2-max_zoom-10.pmtiles\n\n\n\n\n\n\nIf 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.\n\n\n\n\n\n\n\n\n\n\n\n\nSourced from the geobr R package (Pereira & Goncalves, n.d.).\nParameters\n\nYear: 1872-2020\nCode: \"all\" (for all states) or a specific state code (e.g., 35 for São Paulo)\nSimplified: TRUE/FALSE\n\nMinimum Zoom: 0-22\nMaximum Zoom: 0-22\nView\nFile: https://tiles.pmtiles.com.br/geobr/read_state/code-all-year-2020-simplified-TRUE-min_zoom-2-max_zoom-10.pmtiles\n\n\n\n\n\n\n\n\n\nSourced from the geobr R package (Pereira & Goncalves, n.d.).\nParameters\n\nYear: 2000-2020\nSimplified: TRUE/FALSE\n\nMinimum Zoom: 0-22\nMaximum Zoom: 0-22\nView\nFile: https://tiles.pmtiles.com.br/geobr/read_region/year-2020-simplified-TRUE-min_zoom-2-max_zoom-10.pmtiles\n\n\n\n\n\n\n\n\n\nSourced from the geobr R package (Pereira & Goncalves, n.d.).\nParameters\n\nYears: 1872-2020\nSimplified: TRUE/FALSE\n\nMinimum Zoom: 0-22\nMaximum Zoom: 0-22\nView\nFile: https://tiles.pmtiles.com.br/geobr/read_country/year-2020-simplified-TRUE-min_zoom-2-max_zoom-10.pmtiles\n\n\n\n\n\n\n\n\n\nSourced from the geodata R package (Hijmans et al., 2024).\nParameters\n\nCountry: ISO 3166-1 alpha-3 standard (e.g., BRA, ITA, or USA)\nLevel: 0-1\nVersion: \"latest\"/\"4.1\"/\"4.0\"/\"3.6\"\n\nResolution: 1-2\nMinimum Zoom: 0-22\nMaximum Zoom: 0-22\nView\nFile: https://tiles.pmtiles.com.br/geodata/gadm/country-ARM-level-0-version-latest-resolution-1-min_zoom-2-max_zoom-10.pmtiles\n\n\n\n\n\n\n\n\n\nSourced from the geodata R package (Hijmans et al., 2024).\nParameters\n\nLevel: 0\nVersion: \"latest\"/\"3.6\"\n\nResolution: 1-5\nMinimum Zoom: 0-22\nMaximum Zoom: 0-22\n\nThe resolution parameter always comes after version, to match with the gadm() function.\nView\nFile: https://tiles.pmtiles.com.br/geodata/world/level-0-version-latest-resolution-5-min_zoom-0-max_zoom-6.pmtiles"
},
{
"objectID": "index.html#usage",
"href": "index.html#usage",
"title": "PMTilesBR",
"section": "Usage",
"text": "Usage\nAll 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.\nFor a complete list of available PMTiles files and their metadata, see pmtiles.yaml.\nCollections\nPMTilesBR 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.\nPatterns\nTo access the PMTiles files, construct a URL following this naming pattern:\nhttps://tiles.pmtiles.com.br/\n├─ {collection}/\n ├─ {function}/\n ├─ {parameters-values}-{min_zoom-value}-{max_zoom-value}.pmtiles\nWhere:\n\n\ncollection: The data collection name, typically the source R package (e.g., geobr).\n\nfunction: The function used to source the data (e.g., read_municipality()).\n\nparameters-values: The parameter names and values passed to the function.\n\nmin_zoom-value: The minimum zoom level.\n\nmax_zoom-value: The maximum zoom level.\n\nAll files include min_zoom and max_zoom in their names. Unlisted parameters use their default values.\nFor 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:\nhttps://tiles.pmtiles.com.br/geobr/read_municipality/code-3550308-year-2024-simplified-TRUE-min_zoom-2-max_zoom-10.pmtiles\n\n\n\n\n\n\nUse pmtiles.io to easily inspect each PMTiles file before using.\n\n\n\nExample\nThe 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):\n\nlibrary(dplyr)\nlibrary(geobr)\nlibrary(mapgl)\nlibrary(pmtiles) # github.com/walkerke/pmtiles\nlibrary(purrr)\n\n\ncode <- \"all\"\nyear <- 2020\nsimplified <- TRUE\nmin_zoom <- 2\nmax_zoom <- 10\n\n\npmtiles_file <- file.path(\n \"https://tiles.pmtiles.com.br\",\n \"geobr\",\n \"read_state\",\n paste0(\n # fmt: skip\n paste(\n \"code\", code,\n \"year\", year,\n \"simplified\", simplified,\n \"min_zoom\", min_zoom,\n \"max_zoom\", max_zoom,\n sep = \"-\"\n ),\n \".pmtiles\"\n )\n)\n\n\npmtiles_layer <-\n pmtiles_file |>\n pm_show(tilejson = TRUE) |>\n pluck(\"vector_layers\", 1, \"id\")\n\n\nstate_data <-\n code |>\n read_state(\n year = year,\n simplified = simplified\n ) |>\n filter(\n # MG, ES, RJ, SP\n code_state %in% c(31, 32, 33, 35)\n )\n\n\nscale_fill_mapgl <- match_expr(\n column = \"code_state\",\n values = state_data |>\n pull(code_state),\n stops = c(\n \"#efd46a\", # MG\n \"#db5025\", # ES\n \"#070808\", # RJ\n \"#db5025\" # SP\n ),\n default = \"#868489\"\n)\n\n\nmaplibre(\n # c(xmin, ymin, xmax, ymax)\n bounds = c(-51.0, -26, -39.6, -13.5),\n projection = \"mercator\",\n) |>\n add_pmtiles_source(\n id = \"state_boundaries\",\n url = pmtiles_file,\n source_type = \"vector\"\n ) |>\n add_fill_layer(\n id = \"fill\",\n source = \"state_boundaries\",\n source_layer = pmtiles_layer,\n fill_color = scale_fill_mapgl,\n tooltip = \"name_state\",\n hover_options = list(\n fill_color = get_brand_color(\"gray-l50\"),\n fill_opacity = 1\n ),\n # fmt: skip\n filter = list(\n \"in\",\n list(\"get\", \"code_state\"),\n list(\"literal\", list(35, 33, 31, 32))\n )\n ) |>\n add_line_layer(\n id = \"outline\",\n source = \"state_boundaries\",\n source_layer = pmtiles_layer,\n line_color = \"white\",\n line_width = 1\n )\n\n\n\n\n\nH3 Grids\nSome 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.\nMetadata\nOne 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:\n\nlibrary(pmtiles)\nlibrary(purrr)\n\n\nfile <- file.path(\n \"https://tiles.pmtiles.com.br\",\n \"geobr\",\n \"read_municipality\",\n paste0(\n # fmt: skip\n paste(\n \"code\", 3550308,\n \"year\", 2024,\n \"simplified\", TRUE,\n \"min_zoom\", 2,\n \"max_zoom\", 10,\n sep = \"-\"\n ),\n \".pmtiles\"\n )\n)\n\n\nfile |>\n pm_show(tilejson = TRUE) |>\n pluck(\"vector_layers\", 1, \"fields\")\n#> $abbrev_state\n#> [1] \"String\"\n#> \n#> $code_muni\n#> [1] \"Number\"\n#> \n#> $code_region\n#> [1] \"Number\"\n#> \n#> $code_state\n#> [1] \"Number\"\n#> \n#> $name_muni\n#> [1] \"String\"\n#> \n#> $name_region\n#> [1] \"String\"\n#> \n#> $name_region_en\n#> [1] \"String\"\n#> \n#> $name_state\n#> [1] \"String\"\n\nThe PMTiles layer id is always the name of the source function.\n\nfile |>\n pm_show(tilejson = TRUE) |>\n pluck(\"vector_layers\", 1, \"id\")\n#> [1] \"read_municipality\"\n\nQuestions and Requests\nIf 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."
},
{
"objectID": "index.html#citation",
"href": "index.html#citation",
"title": "PMTilesBR",
"section": "Citation",
"text": "Citation\n\n\n\n\n\n\nWhen using this data, you must also cite the original data sources.\n\n\n\nTo cite this work, please use the following format:\nVartanian, 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\nA BibLaTeX entry for LaTeX users is:\n@software{vartanian2026,\n title = {PMTilesBR: Tiled geospatial data for Brazil},\n author = {{Daniel Vartanian} and {Camila Nastari Fernandes} and {Mariana Abrantes Giannotti}},\n year = {2026},\n address = {São Paulo},\n institution = {Center for Metropolitan Studies, University of São Paulo},\n langid = {en},\n doi = {https://doi.org/10.5281/zenodo.19157888}\n}"
},
{
"objectID": "index.html#license",
"href": "index.html#license",
"title": "PMTilesBR",
"section": "License",
"text": "License\n\n \n\n\n\n\n\n\n\nThe original data sources may be subject to their own licensing terms and conditions.\n\n\n\nThe 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.\nCopyright (C) 2026 Center for Metropolitan Studies\n\nThe code in this website is free software: you can redistribute it and/or\nmodify it under the terms of the GNU General Public License as published by the\nFree Software Foundation, either version 3 of the License, or (at your option)\nany later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY\nWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A\nPARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with\nthis program. If not, see <https://www.gnu.org/licenses/>."
},
{
"objectID": "index.html#acknowledgments",
"href": "index.html#acknowledgments",
"title": "PMTilesBR",
"section": "Acknowledgments",
"text": "Acknowledgments\n\n\n\n\nThis work 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).\n\n\n\n\n\n\nThis study was financed, in part, by the São Paulo Research Foundation (FAPESP), Brazil. Process Number 2025/17879-2."
},
{
"objectID": "index.html#references",
"href": "index.html#references",
"title": "PMTilesBR",
"section": "References",
"text": "References\n\n\nHijmans, R. J., Barbosa, M., Ghosh, A., & Mandel, A. (2024). geodata: Download geographic data [Computer software]. https://doi.org/10.32614/CRAN.package.geodata\n\n\nO’Brien, L. (2023). h3jsr: Access Uber’s H3 library [Computer software]. https://doi.org/10.32614/CRAN.package.h3jsr\n\n\nPereira, 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\n\n\nUber Technologies. (n.d.). H3: A hexagonal hierarchical geospatial indexing system [Dataset]. https://h3geo.org\n\n\nWalker, K. (2025). pmtiles: R Interface to PMTiles [Computer software]. https://github.com/walkerke/pmtiles\n\n\nWalker, K. (2026). mapgl: Interactive Maps with ’Mapbox GL JS’ and ’MapLibre GL JS’ [Computer software]. https://walker-data.com/mapgl"
}
]