Combine Fude Polygon data with agricultural community boundary data
Source:R/combine_fude.R
combine_fude.Rdcombine_fude() combines Fude Polygon data with agricultural community
boundary data and returns the polygons associated with the specified
municipality, former municipality, and/or agricultural community.
Arguments
- data
A Fude Polygon data object returned by
read_fude().- boundary
Agricultural community boundary data returned by
get_boundary(). Both datasets must use the same defined coordinate reference system.- city
A character vector of municipality names or local government codes used to identify target municipalities. If
NULL, all municipalities are kept.- kcity
A character vector of regular expression patterns used to match former municipality names in Japanese.
- rcom
A character vector of regular expression patterns used to match agricultural community names in Japanese.
- year
Numeric scalar or
NULL. If supplied, keep only polygons released in that year. For polygons without community keys, specify a year if multiple release years match the target municipality.
Value
A named list of sf::sf() objects.
Details
Polygons with agricultural community keys are matched to the selected
boundaries by key. If the matched polygons and boundaries have different
known reference years, the function warns and returns the matches. The same
key can refer to different communities across reference years.
An error is raised if the input has keyed polygons, but none of the polygons
match the selected boundaries.
Selected boundary parts with the same key are dissolved before matching.
Conflicting non-missing attributes for the same key cause an error.
For polygons without community keys, fude_split contains the intersections
with positive area. The area and a columns, when present, are recalculated
for these pieces. Each original parcel in fude is assigned to the selected
community with the largest overlap. Ties are broken by the smallest key.
The centroid geometry uses the same CRS as the parcel geometry. Existing
point_lng and point_lat values are interpreted as WGS 84 longitude and
latitude in degrees. For split parcels, the recalculated point_lng and
point_lat are also returned in degrees.
Examples
if (FALSE) { # interactive()
path <- system.file("extdata", "castle.zip", package = "fude")
d <- read_fude(path)
b <- get_boundary(d)
db <- combine_fude(d, b, "\u677e\u5c71\u5e02", "\u57ce\u6771", year = 2022)
}