Package 'mojxmlr'

Title: Download and Read MOJ XML
Description: You can download MOJ XML via 'kuwanauchi' and read them as a 'sf' object.
Authors: Mizuki Uchida [aut, cre]
Maintainer: Mizuki Uchida <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2026-07-14 04:41:54 UTC
Source: https://github.com/UchidaMizuki/mojxmlr

Help Index


Download MOJ XML

Description

Download MOJ XML

Usage

mojxml_download(x, exdir, progress = TRUE, ...)

Arguments

x

File names of MOJ XML or a data frame created with mojxml_find().

exdir

A directory name to download data. If it does not exist, it will be created.

progress

Whether to show a progress bar. Passed to purrr::walk().

...

Unused, for extensibility.

Value

The names of downloaded files invisibly.


Find MOJ XML via 'kuwanauchi'

Description

Find MOJ XML via 'kuwanauchi'

Usage

mojxml_find(city_code, lang_col_names = c("en", "ja"))

Arguments

city_code

A city code in Japan.

lang_col_names

Language of column names, English ("en"; default) or Japanese ("ja").

Value

A mojxml_find object, which is a data frame.


Read MOJ XML

Description

Read MOJ XML

Usage

read_mojxml(
  file,
  type = c("fude_polygon", "fude_point", "fude_line", "admin_line", "map_info"),
  lang_col_names = c("en", "ja"),
  add_columns = TRUE
)

Arguments

file

A file name of MOJ XML.

type

The data type to be read, "fude_polygon" (default), "fude_polygon", "fude_line", "admin_line", or "map_info".

lang_col_names

Language of column names, English ("en"; default) or Japanese ("ja").

add_columns

Whether to add MOJ XML attributes to columns? By default, TRUE. If FALSE, they are added to attributes.

Value

A sf object, except when type == "map_info". If type == "map_info", a tibble object.