read_fude()
reads Fude Polygon data as a list. The data can be downloaded
from the MAFF website as a ZIP file, which contains one or more spatial data
files, such as GeoJSON files (.json
or .geojson
) and FlatGeobuf
files (.fgb
). The function also works with ZIP files you created, as long
as you do not change the filenames of the original files.
Usage
read_fude(
path = NULL,
pref = NULL,
year = 2024,
census_year = 2020,
stringsAsFactors = TRUE,
to_wgs84 = TRUE,
quiet = FALSE,
supplementary = FALSE
)
Arguments
- path
Path to the ZIP file containing one or more supported spatial data files. Supported formats include
.geojson
,.json
, and.fgb
.- pref
The year when the Fude Polygon data was created.
- year
The year when the Fude Polygon data was created.
- census_year
The year of the Agricultural and Forestry Census.
- stringsAsFactors
logical. Should character vectors be converted to factors?
- to_wgs84
logical. Convert JGD2000 to WGS 84.
- quiet
logical. Suppress information about the data to be read.
- supplementary
logical. If TRUE, add supplementary information for each polygon.
Value
A list of sf::sf()
objects.
Examples
path <- system.file("extdata", "castle.zip", package = "fude")
d <- read_fude(path, stringsAsFactors = FALSE)
#> Reading layer `2021_382019' from data source
#> `/private/var/folders/33/1nmp7drn6c56394qxrzb2cth0000gn/T/RtmpH8URR5/filead7a72d35262/castle/2021_382019.json'
#> using driver `GeoJSON'
#> Simple feature collection with 1 feature and 6 fields
#> Geometry type: POLYGON
#> Dimension: XY
#> Bounding box: xmin: 132.7653 ymin: 33.84506 xmax: 132.7662 ymax: 33.84575
#> Geodetic CRS: WGS 84
#> Reading layer `2022_382019' from data source
#> `/private/var/folders/33/1nmp7drn6c56394qxrzb2cth0000gn/T/RtmpH8URR5/filead7a72d35262/castle/2022_382019.json'
#> using driver `GeoJSON'
#> Simple feature collection with 1 feature and 6 fields
#> Geometry type: POLYGON
#> Dimension: XY
#> Bounding box: xmin: 132.7653 ymin: 33.84506 xmax: 132.7662 ymax: 33.84575
#> Geodetic CRS: WGS 84
#> Reading layer `2022_382078' from data source
#> `/private/var/folders/33/1nmp7drn6c56394qxrzb2cth0000gn/T/RtmpH8URR5/filead7a72d35262/castle/2022_382078.json'
#> using driver `GeoJSON'
#> Simple feature collection with 1 feature and 6 fields
#> Geometry type: POLYGON
#> Dimension: XY
#> Bounding box: xmin: 132.541 ymin: 33.50931 xmax: 132.5415 ymax: 33.50966
#> Geodetic CRS: WGS 84