read_fgd_dem: Read and Parse Fundamental Geospatial Data (FGD) dem file

View source: R/read_fdg_dem.R

read_fgd_demR Documentation

Read and Parse Fundamental Geospatial Data (FGD) dem file

Description

The JPGIS (GML) format file provided by FGD as input, the digital elevation models in the file are read as a data.frame or spatial object (raster, stars or terra). Supporting FGD Version 4.1 (2016/10/31)

Usage

read_fgd_dem(file, resolution = c(5, 10), return_class)

Arguments

file

Path to XML file

resolution

the number of dem mesh size resolution: 5m or 10m

return_class

one of return object class: 'data.table' for faster than data.frame, 'data.frame', 'raster', 'stars' or 'terra'

Value

A tibble (data.frame), raster, stars or terra

See Also

https://fgd.gsi.go.jp/download/ref_dem.html

Examples

fgd_5dem <- system.file("extdata/FG-GML-0000-00-00-DEM5A-dummy.xml", package = "fgdr")
read_fgd_dem(fgd_5dem,
             resolution = 5,
             return_class = "data.table")
read_fgd_dem(fgd_5dem,
             resolution = 5,
             return_class = "data.frame")
# return as raster
read_fgd_dem(fgd_5dem,
             resolution = 5,
             return_class = "raster")
# return as stars
fgd_10dem <- system.file("extdata/FG-GML-0000-10-dem10b-dummy.xml", package = "fgdr")
read_fgd_dem(fgd_10dem,
             resolution = 10,
             return_class = "stars")

fgdr documentation built on March 18, 2022, 6:46 p.m.