rgugik is an R package for downloading open data from resources of Polish Head Office of Geodesy and Cartography including:
It is also possible to geocode addresses or objects using the
geocodePL_get()
function.
Corresponding functions
Function | Input | Dastaset EN | Dataset PL |
---|---|---|---|
ortho_request() ,
tile_download() |
geometry | Orthophotomap | Ortofotomapa |
geodb_download() |
voivodeship | General Geographic Database | Baza Danych Obiektów Ogólnogeograficznych |
topodb_download() |
county | Topographic Database | Baza Danych Obiektów Topograficznych |
emuia_download() |
commune | Register of Towns, Streets and Addresses | Ewidencja Miejscowości, Ulic i Adresów |
geonames_download() |
type | State Register of Geographical Names | Państwowy Rejestr Nazw Geograficznych |
borders_get() ,
borders_download() |
type | State Register of Borders | Państwowy Rejestr Granic |
parcel_get() |
parcel ID, coordinates | Location of cadastral parcels | Lokalizacja działek katastralnych |
models3D_download() |
county | 3D models of buildings | Modele 3D budynków |
DEM_request() ,
tile_download() |
geometry | Digital elevation models | Cyfrowe modele wysokościowe |
There are the additional functions for obtaining digital terrain model:
pointDTM_get()
for small areas (high resolution
grid)pointDTM100_download()
for voivodeships areas (low
resolution grid)minmaxDTM_get()
to find the minimum and maximum
elevation (small areas)The names of administrative units and their IDs can be obtained using these functions:
voivodeship_names()
(16)county_names()
(380)commune_names()
(2477)You can install the released version from CRAN with:
install.packages("rgugik")
You can install the development version from GitHub with:
# install.packages("remotes")
::install_github("kadyb/rgugik") remotes
ortho_request()
- returns a data frame with metadata
and links to the orthoimages for a given geometry (point, line or
polygon)tile_download()
- downloads orthoimages based on the
data frame obtained using the ortho_request()
functionlibrary(rgugik)
library(sf)
library(stars)
= system.file("datasets/search_area.gpkg", package = "rgugik")
polygon_path = read_sf(polygon_path)
polygon
= ortho_request(polygon)
req_df
# select the oldest image
= req_df[req_df$year == 2001, ]
req_df
# print metadata
t(req_df)
#> 5
#> sheetID "N-33-130-D-b-2-3"
#> year "2001"
#> resolution "1"
#> composition "RGB"
#> sensor "Satellite"
#> CRS "PL-1992"
#> isFilled "TRUE"
#> URL "https://opendata.geoportal.gov.pl/ortofotomapa/41/41_3756_N-33-130-D-b-2-3.tif"
#> seriesID "41"
#> sha1 "312c81963a31e268fc20c442733c48e1aa33838f"
#> date "2001-01-01"
#> filename "41_3756_N-33-130-D-b-2-3"
# download image
tile_download(req_df)
#> 1/1
= read_stars("41_3756_N-33-130-D-b-2-3.tif")
img plot(st_rgb(img), main = NULL)
library(rgugik)
library(sf)
# get counties from opolskie voivodeship (TERYT 16)
= county_names
counties = counties[substr(counties$TERYT, 1, 2) == "16", "TERYT"]
counties = borders_get(TERYT = counties)
counties_geom plot(st_geometry(counties_geom), main = "Opolskie")
More advanced examples of the practical (step by step) use of this package can be found in the vignettes:
Head Office of Geodesy and Cartography in Poland is the main source of the provided data. The data is made available in accordance with the Act of May 17, 1989 Geodetic and Cartographic Law (amended on 16 April 2020).
All datasets can be explored interactively using the Geoportal.
Contributions to this package are welcome. The preferred method of contribution is through a GitHub pull request. Feel also free to contact us by creating an issue. More detailed information can be found in the CONTRIBUTING document.
Maintainers and contributors must follow this repository’s CODE OF CONDUCT.
To cite rgugik in publications, please use the following article:
Dyba, K. and Nowosad, J. (2021). rgugik: Search and Retrieve Spatial Data from the Polish Head Office of Geodesy and Cartography in R. Journal of Open Source Software, 6(59), 2948, https://doi.org/10.21105/joss.02948
BibTeX version can be obtained with
citation("rgugik")
.
If you don’t feel familiar with R, there is a similar QGIS tool in the EnviroSolutions repository.