jpmap uses GeoPackage files with two layers:
prefecturesmunicipalitiesReady-to-use boundary files can be supplied by the companion
jpmapdata package. You can also build your own GeoPackage
files from MLIT N03 administrative area data. The 2024 MLIT N03 files
describe administrative boundaries as of January 1, 2024.
By default, jpmap_build_data() saves converted
GeoPackage files in the package data directory returned by
jpmap_data_dir().
library(jpmap)
# Run this locally to see your user-specific data directory.
jpmap_data_dir(create = FALSE)The exact value is different on each computer, so the website does
not print a live path. You do not need to create this directory by hand.
jpmap_build_data() creates it when needed.
For most municipal examples, start with one prefecture. This
downloads a smaller official MLIT N03 archive, converts it to a
GeoPackage, and saves it in jpmap_data_dir().
The generated file is named with the prefecture code:
For Okinawa, the companion data package can provide the 2024 file:
Build nationwide municipal data only when you need all municipalities. The official 2024 national source archive is about 583 MB, and the converted GeoPackage is also large.
The generated national file is named:
The source is MLIT National Land Numerical Information N03 administrative area data:
The filename pattern is N03-YYYY0101_GML.zip for
national data and N03-YYYY0101_PP_GML.zip for
one-prefecture data, where PP is a two-digit prefecture
code.