Title: | Search and Retrieve Spatial Data from 'GUGiK' |
---|---|
Description: | Automatic open data acquisition from resources of Polish Head Office of Geodesy and Cartography ('Główny Urząd Geodezji i Kartografii') (<https://www.gov.pl/web/gugik>). Available datasets include various types of numeric, raster and vector data, such as orthophotomaps, digital elevation models (digital terrain models, digital surface model, point clouds), state register of borders, spatial databases, geometries of cadastral parcels, 3D models of buildings, and more. It is also possible to geocode addresses or objects using the geocodePL_get() function. |
Authors: | Krzysztof Dyba [aut, cre] , Jakub Nowosad [aut] , Maciej Beręsewicz [ctb] , GUGiK [ctb] (source of the data) |
Maintainer: | Krzysztof Dyba <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.4.2 |
Built: | 2024-11-08 23:18:50 UTC |
Source: | https://github.com/kadyb/rgugik |
Download State Register of Borders
borders_download(type, outdir = ".", unzip = TRUE, ...)
borders_download(type, outdir = ".", unzip = TRUE, ...)
type |
"administrative units", "special units" or "addresses" |
outdir |
(optional) name of the output directory; by default, files are saved in the working directory |
unzip |
TRUE (default) or FALSE, when TRUE the downloaded archive will be extracted and removed |
... |
additional argument for |
a selected data type in SHP format
## Not run: borders_download("administrative units") # 366 MB ## End(Not run)
## Not run: borders_download("administrative units") # 366 MB ## End(Not run)
Get the boundaries of administrative units
borders_get(voivodeship = NULL, county = NULL, commune = NULL, TERYT = NULL)
borders_get(voivodeship = NULL, county = NULL, commune = NULL, TERYT = NULL)
voivodeship |
selected voivodeships in Polish.
Check |
county |
county names in Polish.
Check |
commune |
commune names in Polish.
Check |
TERYT |
voivodeships, counties or communes (2, 4 or 7 characters) |
If all arguments are NULL (default), the boundary of Poland will be returned.
a sf data.frame (EPSG: 2180)
## Not run: voivodeship_geom = borders_get(voivodeship = "lubuskie") # 494 KB county_geom = borders_get(county = "Sopot") # 18 KB commune_geom = borders_get(commune = c("Hel", "Krynica Morska")) # 11 KB poland_geom = borders_get() # 1124.3 KB ## End(Not run)
## Not run: voivodeship_geom = borders_get(voivodeship = "lubuskie") # 494 KB county_geom = borders_get(county = "Sopot") # 18 KB commune_geom = borders_get(commune = c("Hel", "Krynica Morska")) # 11 KB poland_geom = borders_get() # 1124.3 KB ## End(Not run)
The data frame contains names of communes, and their identifiers (TERC, 7 characters).
commune_names
commune_names
An object of class data.frame
with 2477 rows and 2 columns.
Last update: 2 January 2024
commune_names
commune_names
The data frame contains the names of counties, their identifiers (TERYT, 4 characters) and the availability of building models in the LOD2 standard (logical value).
county_names
county_names
An object of class data.frame
with 380 rows and 3 columns.
county_names
county_names
Get metadata and links to available digital elevation models
DEM_request(x)
DEM_request(x)
x |
an |
The server can return a maximum of 2000 records in a single query.
If your area of interest exceeds this limit, you can generate a grid of
smaller polygons (sf::st_make_grid()
) or a regular grid of points
(sf::st_sample()
).
a data frame with metadata and links to the digital elevation models (different formats of digital terrain model, digital surface model and point clouds)
## Not run: library(sf) polygon_path = system.file("datasets/search_area.gpkg", package = "rgugik") polygon = read_sf(polygon_path) req_df = DEM_request(polygon) # simple filtering by attributes req_df = req_df[req_df$year > 2018, ] req_df = req_df[req_df$product == "PointCloud" & req_df$format == "LAS", ] ## End(Not run)
## Not run: library(sf) polygon_path = system.file("datasets/search_area.gpkg", package = "rgugik") polygon = read_sf(polygon_path) req_df = DEM_request(polygon) # simple filtering by attributes req_df = req_df[req_df$year > 2018, ] req_df = req_df[req_df$product == "PointCloud" & req_df$format == "LAS", ] ## End(Not run)
Download Register of Towns, Streets and Addresses for communes
emuia_download(commune = NULL, TERYT = NULL, outdir = ".", unzip = TRUE, ...)
emuia_download(commune = NULL, TERYT = NULL, outdir = ".", unzip = TRUE, ...)
commune |
commune name in Polish. Check |
TERYT |
county ID (7 characters) |
outdir |
(optional) name of the output directory; by default, files are saved in the working directory |
unzip |
TRUE (default) or FALSE, when TRUE the downloaded archive will be extracted and removed |
... |
additional argument for |
a register in SHP format
## Not run: emuia_download(commune = "Kotla") # 38 KB emuia_download(TERYT = c("0203042", "2412032")) # 75 KB ## End(Not run)
## Not run: emuia_download(commune = "Kotla") # 38 KB emuia_download(TERYT = c("0203042", "2412032")) # 75 KB ## End(Not run)
Convert addresses and objects to geographic coordinates
geocodePL_get( address = NULL, road = NULL, rail_crossing = NULL, geoname = NULL )
geocodePL_get( address = NULL, road = NULL, rail_crossing = NULL, geoname = NULL )
address |
place with or without street and house number |
road |
road number with or without mileage |
rail_crossing |
rail crossing identifier (11 characters including 2 spaces, format: "XXX XXX XXX") |
geoname |
name of the geographical object from State Register
of Geographical Names (function |
a sf data.frame (EPSG: 2180) with metadata
## Not run: geocodePL_get(address = "Marki") # place geocodePL_get(address = "Marki, Andersa") # place and street geocodePL_get(address = "Marki, Andersa 1") # place, street and house number geocodePL_get(address = "Królewskie Brzeziny 13") # place and house number geocodePL_get(road = "632") # road number geocodePL_get(road = "632 55") # road number and mileage geocodePL_get(rail_crossing = "001 018 478") geocodePL_get(geoname = "Las Mierzei") # physiographic object ## End(Not run)
## Not run: geocodePL_get(address = "Marki") # place geocodePL_get(address = "Marki, Andersa") # place and street geocodePL_get(address = "Marki, Andersa 1") # place, street and house number geocodePL_get(address = "Królewskie Brzeziny 13") # place and house number geocodePL_get(road = "632") # road number geocodePL_get(road = "632 55") # road number and mileage geocodePL_get(rail_crossing = "001 018 478") geocodePL_get(geoname = "Las Mierzei") # physiographic object ## End(Not run)
Download General Geographic Databases for entire voivodeships
geodb_download(voivodeships, outdir = ".", unzip = TRUE, ...)
geodb_download(voivodeships, outdir = ".", unzip = TRUE, ...)
voivodeships |
selected voivodeships in Polish or English, or TERC
(object |
outdir |
(optional) name of the output directory; by default, files are saved in the working directory |
unzip |
TRUE (default) or FALSE, when TRUE the downloaded archive will be extracted and removed |
... |
additional argument for |
a database in Geography Markup Language format (.GML), the content and detail level corresponds to the general geographic map in the scale of 1:250000
description of topographical and general geographical databases, and technical standards for making maps (in Polish): https://isap.sejm.gov.pl/isap.nsf/download.xsp/WDU20210001412/O/D20211412.pdf
brief description of categories and layer names (in English and Polish): https://kadyb.github.io/rgugik/articles/articles/spatialdb_description.html
## Not run: geodb_download(c("opolskie", "lubuskie")) # 12.7 MB geodb_download(c("Opole", "Lubusz")) # 12.7 MB geodb_download(c("16", "08")) # 12.7 MB ## End(Not run)
## Not run: geodb_download(c("opolskie", "lubuskie")) # 12.7 MB geodb_download(c("Opole", "Lubusz")) # 12.7 MB geodb_download(c("16", "08")) # 12.7 MB ## End(Not run)
Download State Register of Geographical Names
geonames_download(type, format = "SHP", outdir = ".", unzip = TRUE, ...)
geonames_download(type, format = "SHP", outdir = ".", unzip = TRUE, ...)
type |
names of places ("place") and/or physiographic objects ("object") |
format |
data format ("GML", "SHP" (default) and/or "XLSX") |
outdir |
(optional) name of the output directory; by default, files are saved in the working directory |
unzip |
TRUE (default) or FALSE, when TRUE the downloaded archive will be extracted and removed |
... |
additional argument for |
a selected data type in the specified format
http://isap.sejm.gov.pl/isap.nsf/download.xsp/WDU20150000219/O/D20150219.pdf
## Not run: geonames_download(type = "place", format = "SHP") # 18.2 MB ## End(Not run)
## Not run: geonames_download(type = "place", format = "SHP") # 18.2 MB ## End(Not run)
Get minimum and maximum elevation for a given polygon
minmaxDTM_get(polygon)
minmaxDTM_get(polygon)
polygon |
the polygon layer with only one object (area less than 10 ha), the larger the polygon area, the lower DTM resolution, the input coordinate system must be EPSG:2180 |
a data frame with vector points and min/max terrain elevation (EPSG:2180)
## Not run: library(sf) polygon_path = system.file("datasets/search_area.gpkg", package = "rgugik") polygon = read_sf(polygon_path) minmax = minmaxDTM_get(polygon) ## End(Not run)
## Not run: library(sf) polygon_path = system.file("datasets/search_area.gpkg", package = "rgugik") polygon = read_sf(polygon_path) minmax = minmaxDTM_get(polygon) ## End(Not run)
Download 3D models of buildings for counties
models3D_download( county = NULL, TERYT = NULL, LOD = "LOD1", outdir = ".", unzip = TRUE, ... )
models3D_download( county = NULL, TERYT = NULL, LOD = "LOD1", outdir = ".", unzip = TRUE, ... )
county |
county name in Polish. Check |
TERYT |
county ID (4 characters) |
LOD |
level of detail for building models ("LOD1" or "LOD2").
"LOD1" is default. "LOD2" is only available for ten voivodeships
(TERC: "04", "06", "12", "14", "16", "18", "20", "24", "26", "28").
Check |
outdir |
(optional) name of the output directory; by default, files are saved in the working directory |
unzip |
TRUE (default) or FALSE, when TRUE the downloaded archive will be extracted and removed |
... |
additional argument for |
models of buildings in Geography Markup Language format (.GML)
## Not run: models3D_download(TERYT = c("2476", "2264")) # 3.6 MB models3D_download(county = "sejneński", LOD = "LOD2") # 7.0 MB ## End(Not run)
## Not run: models3D_download(TERYT = c("2476", "2264")) # 3.6 MB models3D_download(county = "sejneński", LOD = "LOD2") # 7.0 MB ## End(Not run)
Get metadata and links to available orthoimages
ortho_request(x) orto_request(x)
ortho_request(x) orto_request(x)
x |
an |
The server can return a maximum of 2000 records in a single query.
If your area of interest exceeds this limit, you can generate a grid of
smaller polygons (sf::st_make_grid()
) or a regular grid of points
(sf::st_sample()
).
a data frame with metadata and links to the orthoimages
## Not run: library(sf) polygon_path = system.file("datasets/search_area.gpkg", package = "rgugik") polygon = read_sf(polygon_path) req_df = ortho_request(polygon) # simple filtering by attributes req_df = req_df[req_df$composition == "CIR", ] req_df = req_df[req_df$resolution <= 0.25 & req_df$year >= 2016, ] ## End(Not run)
## Not run: library(sf) polygon_path = system.file("datasets/search_area.gpkg", package = "rgugik") polygon = read_sf(polygon_path) req_df = ortho_request(polygon) # simple filtering by attributes req_df = req_df[req_df$composition == "CIR", ] req_df = req_df[req_df$resolution <= 0.25 & req_df$year >= 2016, ] ## End(Not run)
Get the geometry of cadastral parcels
parcel_get(TERYT = NULL, X = NULL, Y = NULL)
parcel_get(TERYT = NULL, X = NULL, Y = NULL)
TERYT |
parcel ID (18 characters, e.g. "141201_1.0001.6509") |
X |
longitude (EPSG: 2180) |
Y |
latitude (EPSG: 2180) |
a simple feature geometry (in case of TERYT) or data frame with simple feature geometry and TERYT (in case of coordinates)
## Not run: parcel = parcel_get(TERYT = "141201_1.0001.6509") parcel = parcel_get(X = 313380.5, Y = 460166.4) ## End(Not run)
## Not run: parcel = parcel_get(TERYT = "141201_1.0001.6509") parcel = parcel_get(X = 313380.5, Y = 460166.4) ## End(Not run)
Get terrain elevation for a given polygon
pointDTM_get(polygon, distance = 1, print_iter = TRUE)
pointDTM_get(polygon, distance = 1, print_iter = TRUE)
polygon |
the polygon layer with only one object (its area is limited to the 20 ha * distance parameter), the input coordinate system must be EPSG:2180 |
distance |
distance between points in meters (must be integer and greater than 1) |
print_iter |
print the current iteration of all (logical, TRUE default) |
a data frame with vector points and terrain elevation (EPSG:2180, Vertical Reference System:PL-KRON86-NH)
## Not run: library(sf) polygon_path = system.file("datasets/search_area.gpkg", package = "rgugik") polygon = read_sf(polygon_path) DTM = pointDTM_get(polygon, distance = 2) ## End(Not run)
## Not run: library(sf) polygon_path = system.file("datasets/search_area.gpkg", package = "rgugik") polygon = read_sf(polygon_path) DTM = pointDTM_get(polygon, distance = 2) ## End(Not run)
Download digital terrain models for voivodeships (100 m resolution)
pointDTM100_download(voivodeships, outdir = ".", unzip = TRUE, ...)
pointDTM100_download(voivodeships, outdir = ".", unzip = TRUE, ...)
voivodeships |
selected voivodeships in Polish or English, or TERC
(function |
outdir |
(optional) name of the output directory; by default, files are saved in the working directory |
unzip |
TRUE (default) or FALSE, when TRUE the downloaded archive will be extracted and removed |
... |
additional argument for |
text files with X, Y, Z columns (EPSG:2180)
## Not run: pointDTM100_download(c("opolskie", "świętokrzyskie")) # 8.5 MB pointDTM100_download(c("Opole", "Swietokrzyskie")) # 8.5 MB pointDTM100_download(c("16", "26")) # 8.5 MB ## End(Not run)
## Not run: pointDTM100_download(c("opolskie", "świętokrzyskie")) # 8.5 MB pointDTM100_download(c("Opole", "Swietokrzyskie")) # 8.5 MB pointDTM100_download(c("16", "26")) # 8.5 MB ## End(Not run)
Download requested tiles
tile_download(df_req, outdir = ".", unzip = TRUE, print_iter = TRUE, ...)
tile_download(df_req, outdir = ".", unzip = TRUE, print_iter = TRUE, ...)
df_req |
a data frame obtained using the |
outdir |
(optional) name of the output directory; by default, files are saved in the working directory |
unzip |
TRUE (default) or FALSE, when TRUE the downloaded archive will be extracted and removed; only suitable for certain elevation data |
print_iter |
print the current iteration of all (logical, TRUE default) |
... |
additional argument for |
georeferenced tiles with properties (resolution, year, etc.) as specified in the input data frame
## Not run: library(sf) options(timeout = 600) polygon_path = system.file("datasets/search_area.gpkg", package = "rgugik") polygon = read_sf(polygon_path) req_df = ortho_request(polygon) tile_download(req_df[1, ]) # download the first image only req_df = DEM_request(polygon) tile_download(req_df[1, ]) # download the first DEM only ## End(Not run)
## Not run: library(sf) options(timeout = 600) polygon_path = system.file("datasets/search_area.gpkg", package = "rgugik") polygon = read_sf(polygon_path) req_df = ortho_request(polygon) tile_download(req_df[1, ]) # download the first image only req_df = DEM_request(polygon) tile_download(req_df[1, ]) # download the first DEM only ## End(Not run)
Download Topographic Databases for counties
topodb_download(county = NULL, TERYT = NULL, outdir = ".", unzip = TRUE, ...)
topodb_download(county = NULL, TERYT = NULL, outdir = ".", unzip = TRUE, ...)
county |
county name in Polish. Check |
TERYT |
county ID (4 characters) |
outdir |
(optional) name of the output directory; by default, files are saved in the working directory |
unzip |
TRUE (default) or FALSE, when TRUE the downloaded archive will be extracted and removed |
... |
additional argument for |
a database in Geography Markup Language format (.GML), the content and detail level corresponds to the topographic map in the scale of 1:10000
description of topographical and general geographical databases, and technical standards for making maps (in Polish): https://isap.sejm.gov.pl/isap.nsf/download.xsp/WDU20210001412/O/D20211412.pdf
brief description of categories and layer names (in English and Polish): https://kadyb.github.io/rgugik/articles/articles/spatialdb_description.html
## Not run: topodb_download(county = "Świętochłowice") # 2.4 MB topodb_download(TERYT = c("2476", "2264")) # 4.8 MB ## End(Not run)
## Not run: topodb_download(county = "Świętochłowice") # 2.4 MB topodb_download(TERYT = c("2476", "2264")) # 4.8 MB ## End(Not run)
The data frame contains Polish and English names of voivodeships, and their identifiers (TERC, 2 characters).
voivodeship_names
voivodeship_names
An object of class data.frame
with 16 rows and 3 columns.
voivodeship_names
voivodeship_names