{"id":31956690,"url":"https://github.com/petrbouchal/pragr","last_synced_at":"2026-07-29T11:31:33.696Z","repository":{"id":147818201,"uuid":"186895587","full_name":"petrbouchal/pragr","owner":"petrbouchal","description":"Tools for visualising Prague data in R","archived":false,"fork":false,"pushed_at":"2022-12-17T21:26:15.000Z","size":27590,"stargazers_count":4,"open_issues_count":22,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-01-29T11:45:36.881Z","etag":null,"topics":["czech-republic","gis","maps","open-data","prague","prague-geodata","r","rstats","rstats-package"],"latest_commit_sha":null,"homepage":"https://petrbouchal.xyz/pragr/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/petrbouchal.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-05-15T20:08:28.000Z","updated_at":"2022-12-17T11:09:38.000Z","dependencies_parsed_at":"2023-04-09T02:33:49.709Z","dependency_job_id":null,"html_url":"https://github.com/petrbouchal/pragr","commit_stats":{"total_commits":196,"total_committers":2,"mean_commits":98.0,"dds":"0.010204081632653073","last_synced_commit":"858fbb96f69eda9ac0922e8dfbc966948e545073"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/petrbouchal/pragr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrbouchal%2Fpragr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrbouchal%2Fpragr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrbouchal%2Fpragr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrbouchal%2Fpragr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/petrbouchal","download_url":"https://codeload.github.com/petrbouchal/pragr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrbouchal%2Fpragr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279019140,"owners_count":26086685,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["czech-republic","gis","maps","open-data","prague","prague-geodata","r","rstats","rstats-package"],"created_at":"2025-10-14T14:52:45.600Z","updated_at":"2025-10-14T14:52:52.618Z","avatar_url":"https://github.com/petrbouchal.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  warning = F,\n  dev = \"ragg_png\",\n  fig.width = 10,\n  out.width = \"100%\",\n  dpi = 300,\n  fig.asp = .7,\n  fig.retina = 3,\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# pragr: use Prague geodata in R \u003ca href='https://petrbouchal.github.io/pragr'\u003e\u003cimg src='man/figures/logo.png' align=\"right\" height=\"138.5\" /\u003e\u003c/a\u003e\n\n\u003c!-- badges: start --\u003e\n[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)\n[![CRAN status](https://www.r-pkg.org/badges/version/pragr)](https://CRAN.R-project.org/package=pragr)\n[![R-CMD-check](https://github.com/petrbouchal/pragr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/petrbouchal/pragr/actions/workflows/R-CMD-check.yaml)\n\u003c!-- badges: end --\u003e\n\n```{r, results='asis', echo=FALSE}\n\nif(pkgdown:::dev_mode(pkgdown:::read_desc()$get_version(), pkgdown:::read_desc()$get_version()) == \"devel\") {\n  meta_dest \u003c- pkgdown:::read_meta(\".\")$development$destination\n  meta_base_url \u003c- pkgdown:::read_meta(\".\")$url\n  if(is.null(meta_dest)) {\n    dst \u003c- \"dev\"\n  } else {\n    dst \u003c- meta_dest\n  }\n  \n  devurl \u003c- paste0(meta_base_url, \"/\", dst)\n  \n  cat(paste0(\"\u003e Note: this is the documentation for the latest released version (the github release). Documentation for the current development version (reflecting the state of the master branch) is at [\", devurl, \"](\", devurl,\").\"))\n}\n\n```\n\n`pragr` aims to provide tools for visualising data about Prague. Currently, it makes Prague raster geodata accessible for use in R via `ggplot2`. \n\nIt also provides a set of utilities and shortcuts to simplify handling data about Prague.\n\n## Installation\nYou can install the current version of `pragr` from GitHub with:\n\n``` r\nremotes::install_github(\"petrbouchal/pragr\")\n```\n\n## What it does\n\nCurrently, the 📦 enables you to do two things:\n\n1. Add raster tiles from the Prague geoopen data portal to a `ggplot2` object (`prg_tile()`)\n2. Add other raster layer to a `ggplot2` object (`prg_basemap()`)\n\nThe basic logic of the two core functions is that given a simple feature dataset, they provide the tiles or image to create the base map for those coordinates.\n\nIt relies on the REST API of ArcGis map/image services that power the geoportal, using documentation for the following operations (endpoints):\n\n- [Image Tile endpoint](https://developers.arcgis.com/rest/services-reference/image-tile.htm)\n- [Export Image endoint](https://developers.arcgis.com/rest/services-reference/export-image.htm)\n- [Export Map (image) endpoint](https://developers.arcgis.com/rest/services-reference/export-map.htm)\n\nAdditionally, the package provides\n\n- quick access to a number of codes that identify Prague in various administrative or statistical registers.\n- a function for downloading official Prague admin geodata (admin boundaries etc.)\n- square and hex tiles for equal-area plotting\n- a grid object suitable for use in the `geofacet::facet_geo()` function.\n- basic demographic data about Prague districts\n\n## Credit, inspiration and extensibility\n\nThe approach draws heavily on code provided by @[yutannihilation](https://github.com/yutannihilation) in her [blog post](https://yutani.rbind.io/post/2018-06-09-plot-osm-tiles/) on using OpenStreetMap tiles in 📦 `ggplot2`.\n\nThe approach should be generalisable to other ArcGIS-driven servers with the same REST API, though the package as it now is assumes a projected CRS measured in meters, specifically the Krovak CRS (EPSG 5514).\n\n## Usage\n\n```{r setup}\nlibrary(pragr)\nlibrary(dplyr)\nlibrary(sf)\nlibrary(ggplot2)\n```\n\n```{r load-data}\npraha1 \u003c- CzechData::load_RUIAN_settlement(prg_kod, \"MOMC_P\", WGS84 = F) %\u003e% \n  filter(nazev == 'Praha 1')\n```\n\nNote that the possible values of the `tile_service` and `image_service` parameters can be found in `prg_endpoints`.\n\n```{r example-tiles}\nggplot() +\n  prg_tile(data = praha1, zoom = 10, alpha = 1, buffer = 200,\n           tile_service = 'orto') + \n  geom_sf(data = praha1, colour = alpha(\"red\", 0.6), fill = NA, shape = \"dotted\") +\n  theme_void()\n```\n\nThe `layer` parameter can take values that you can find by inspecting the given image service (see note on sources below).\n\n```{r example-base}\nggplot() +\n  prg_basemap(data = praha1, alpha = 1, buffer = 200, width = 1000,\n              image_service = 'cisarske_otisky_1840_velke', layer = 1) + \n  geom_sf(data = praha1, colour = alpha(\"red\", 0.6), fill = NA, shape = \"dotted\") +\n  theme_void()\n```\n\n## What's in a name?\n\nThe name of the package refers to [Karel Prager](https://en.wikipedia.org/wiki/Karel_Prager), a renowned Czech modernist architect. Among other things, he designed - and for a long time worked in - the office buildings in which the [Institute for Planning and Development](https://iprpraha.cz), Prague's public urban planning body, is housed today.\n\nThe institute's excellent data team develops and maintains the data and software infrastructure for Prague's geographical data on which this package - and much of Prague's planning, government and business - relies.\n\nPrag is of course how the city was once called by its many German-speaking inhabitants.\n\n## Data sources:\n\nMost map/image services are accessible via \u003chttp://www.geoportalpraha.cz/cs/clanek/22/mapove-sluzby\u003e\n\nA more technical route to lists of services is via\n\n- \u003chttps://tiles.arcgis.com/tiles/SBTXIEUGWbqzUecw/arcgis/rest/services\u003e for all tile services, including the in-preparation Metropolitan Plan\n- \u003chttp://gs-pub.iprpraha.cz/arcgis/rest/services/\u003e for most tile, image as well as feature servers\n- \u003chttps://gs.iprpraha.cz/arcgis/rest/services/\u003e for undocumented services, including the Atlas 5000 map collection which contains data from the 2016 ÚAP (Core Spatial Analytics) report for Prague, in the [`/uap/` collection](https://gs.iprpraha.cz/arcgis/rest/services/uap) The [`/urk/` collection](https://gs.iprpraha.cz/arcgis/rest/services/urk) contains some interesting data (incl. construction limits ([stavební uzávěry](https://gs.iprpraha.cz/arcgis/rest/services/urk/StavebniUzavery/MapServer)) or the spread of the build-up area over time ([vývoj Prahy](https://gs.iprpraha.cz/arcgis/rest/services/urk/vyvoj_prahy/MapServer))).\n\nMany of these services can be used in WMS mode, i.e. as tiles for `leaflet` maps, or as feature layers for webmaps - see the [web article](/articles/web.html) for an example.\n\nThere has recently been a migration from the \"mpp.*\" servers to the \"gs[-pub]*\" servers; see \u003chttp://app.iprpraha.cz/apl/app/service_viewer/\u003e for the translation. Some services still run on \u003chttp://mpp.iprpraha.cz/arcgis/rest/services\u003e but presumably these will go away at some point. For now, this is the only place where the full current Spatial plan lives (\u003chttp://mpp.iprpraha.cz/arcgis/rest/services/PUP\u003e).\n\nFor some of the services, shortcut notation is implemented for use in the tile/basemap functions. See `prg_endpoints`. **Not all endpoint metadata in `prg_endoints` has been updated to reflect the new URLs.**\n\n## Note on geodata about Prague\n\nThere will be a [vignette](articles/data-sources.html) or `vignette(\"data-sources\", package = \"pragr\")`.\n\n# See also:\n\n- [CzechData](https://jancaha.github.io/CzechData)\n- [RCzechia](https://github.com/jlacko/RCzechia)\n- [czso](https://github.com/petrbouchal/czso)\n- [GiscoR](https://dieghernan.github.io/giscoR/)\n\n\n## Acknowledgments\n\n- Most importantly, IPR Praha for providing the open data!\n- The approach draws heavily on code provided by @[yutannihilation](https://github.com/yutannihilation) in her [blog post]\n- logo designed using the 📦 bunny by @[dmi3kno](https://github.com/dmi3kno) following his [blog post]([https://www.ddrive.no/post/making-hex-and-twittercard-with-bunny-and-magick/])\n- font in logo is Trivia Serif by [František Štorm](https://stormtype.com)\n\n## Code of Conduct\n  \nPlease note that the pragr project is released with a [Contributor Code of Conduct](https://petrbouchal.github.io/pragr/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetrbouchal%2Fpragr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpetrbouchal%2Fpragr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetrbouchal%2Fpragr/lists"}