Objective: Using R, create maps for comparing census tracts to Tsukuba planning maps.
This technical note describes a procedure for visualizing and comparing census tracts and planning maps using shapefiles
downloaded from https://www.e-stat.go.jp/ (described in Original shape files, and a
planning
map from Tsukuba City, using a classification described by Kawanaka and Kaneko (2015).
1. Data and reference sources
1.1 Ibaraki Prefecture census tract shapefiles
Shapefile data for all prefectures of Japan and for each census can be downloaded from
e-Stat. Those for Ibaraki Prefecture
are included in the R package AlanInTsukuba/jpucd on Github.
library(remotes) # or library(devtools)
install_github("AlanInTsukuba/jpucd")
Shapefiles downloaded from e-Stat are in KMZ format and were converted to GeoJSON format using a utility written in C#.
This file can then be dragged and dropped onto the maps.gsi.go.jp base map.
1.2 Reference planning maps
Tsukuba City makes available its urban planning map at higher resolution than the census tract
shapefiles and can be used to visually compare tract shapefiles to urban plans. For the task at hand, comparing census tracts to
the grand plans, the map at left of Tsukuba's outlying towns provides comparable detail in a
more convenient format. Figure 3-4 in Kawanaka and Kaneko (2015) is essentially the same map
but is simplified by major plan and omits detail within the respective plans. The 5 major plans are the following:
Preexisting towns to be revitalized (PTR)
Tsukuba Science City (TSC)
New town developments (NTD)
Industrial parks (IND)
Tsukuba Express developments (TEXP)
The white areas are general nonurban areas (GNL) not included in any of the above plans.
1.3 Geospatial Information Authority of Japan (GSI) web map
The GSI web map is detailed at the structure level. The map at left was created by dragging the
file TsukubaMasterPlan-2015.geojson that was created with the R code at top onto the GSI web map.
The red lines outline the census tracts. Clicking on a tract brings up a properties panel that
lists the attributes of the data frame tsukubaMP2015. The GSI base map can be selected from a standard colors map, a grayed
structures map, a white map, and a satellite photo. Each of these can be modified with a grayscale, transparency level, or both.
2. Correspondence table for census tracts and plans
Tract-plan correspondence table (selected rows)
jpid
USE1Code
USE1Desc
USE2Code
USE2Desc
USE3Code
USE3Desc
10822000100001
PTR
Yatabe (R8)
GNL
Yatabe
<NA>
<NA>
10822000500002
IND
Katata
<NA>
<NA>
<NA>
<NA>
10822013900000
TEXP
[Nakane-Kontadai] Sakuranomori
PTR
Sakai
GNL
Nakane
10822014500000
TEXP
[Nakane-Kontadai] Sakuranomori/Ryuseidai
PTR
Sakai
GNL
Konda
10822002000000
TEXP
[Kamikawarazaki-Nakanishi]
GNL
Shimana
<NA>
<NA>
10822002310000
TEXP
[Kamikawarazaki-Nakanishi]
GNL
Kamikawarazaki
<NA>
<NA>
10822002320000
TEXP
[Kamikawarazaki-Nakanishi]
GNL
Kamikawarazaki
<NA>
<NA>
10822002700000
TEXP
[Kamikawarazaki-Nakanishi]
GNL
Shimokawarazaki
<NA>
<NA>
10822021500100
TEXP
[Katsuragi] Gakuen no Mori 1
<NA>
<NA>
<NA>
<NA>
The tract-plan correspondence table maps 338 shapefiles from the 2015 general census
to Tsukuba planning mapes. Some tracts overlapped as many as 2 plans as well as
general nonurban land. Place names in brackets are those listed in Inui (2017) for the Tsukuba Express
development plan. If Tsukuba City has designated newer place names, these are appended after the original plan name, e.g., [Katsuragi] Gakuen no Mori 1.
3. Additional features
The correspondence map in Section 4 is enhanced with accessory maps extracted from files downloaded from the
GIS Home Page of the Ministry of Land, Infrastructure,
and Tourism.
The R package jpucd contains copies of the geojson files produced in this section.
3.1 Municipal boundaries
Shapefiles for Japanese municipal boundaries are available by prefecture for 1920,
every five years between 1950 and 2005, and annually thereafter. This technical note shows the
shapefiles for Ibaraki municipalities
for 2015 (Heisei 27).
## background_maps is local subfolder
ibdsn2015 <- paste(getwd(),"background_maps","N03-20150101_08_GML",sep="/")
ib2015admin <- st_read(ibdsn2015)
head(ib2015admin)
plot(ib2015admin["N03_007"])
## just Tsukuba
tsukuba2015outline <- with(ib2015admin, ib2015admin[N03_007 == "08220",])
plot(tsukuba2015outline["N03_007"])
## can also do following
plot(ib2015admin[ib2015admin$N03_007 == "08220",]["N03_007"])
## export
writepath <- "IbarakiMunicipalBoundaries2015.geojson"
st_write(ib2015admin, writepath , delete_dsn=TRUE)
3.2 Railways
Maps of Japanese railways are available since 2005 and are updated annually. This
technical note uses file N02-18_GML.zip from 2018.
Maps of Japanese railways are available since 2011 and are updated annually. This
technical note uses file N06-15_GML.zip from 2015. Field N06_001 is the fiscal year in which the section was opened and
can be used to match stage of completion to census year.
This section shows the R code for combining the correspondence table from Section 2 with the shapefiles from Section 1.
The first task is to look for errors and omissions in the table. Comparing the correspondence table to data frame tsukubaMP2015
found that 6 tracts were missing. A left outer merge followed by selecting the subset without USE1Code entries produced
a subset that could be written as a geojson file and imported into the GSI web map.
# The tract-plan correspondence table is in a csv file
tract_plan2015 <- read.csv("TsukubaMasterPlan-Tract-Plan-2015.csv",
header = TRUE, sep = ",",strip.white = TRUE,na.strings = "NA",
colClasses = c("character","character","character","character","character","character","character"))
head(tract_plan2015)
summary(tract_plan2015)
summary(tsukubaMP2015)
## tract_plan2015 has 332 rows, tsukubaMP2015 has 338. 6 are missing from
## tract_plan2015
## do left outer merge
temp <- merge( x = tsukubaMP2015,y = tract_plan2015, by = "jpid", all.x=TRUE)
head(temp)
temp[1:338,c("USE1Code")]
plot(temp[is.na(temp$USE1Code),]["jpid"])
tempmissing <- temp[is.na(temp$USE1Code),]
dstemp <- "TsukubaMasterPlan-2015-missing.geojson"
st_write(tempmissing , dstemp , delete_dsn=TRUE,layer="CensusDistricts")
The correspondence table can then be merged with the master plan data frame. This is then plotted using a palette
that matches that of Figure 3-4 in Kawanaka and Kaneko (2015)
##############################################
## now with all tracts coded merge and plot
tract_plan2015 <- read.csv("TsukubaMasterPlan-Tract-Plan-2015.csv",
header = TRUE, sep = ",",strip.white = TRUE,na.strings = "NA",
colClasses = c("character","character","character","character","character","character","character"))
head(tract_plan2015)
## redo tsukubaMP2015
tsukubaMP2015 <- ib2015gjsn[which(ib2015gjsn$CITY == 220),c("jpid","CITY_NAME","CITY","MOJI" ,"S_AREA"
,"KIGO_E", "AREA" , "PERIMETER" ,"geometry")]
tsukubaMP2015 <- merge( x = tsukubaMP2015,y = tract_plan2015, by = "jpid", all.x=TRUE)
## make palette to match Kawanaka & Kaneko 2015
kawanakapalette <- c("#4798C7","#FFFFFF","#A73986","#F6D9E4","orange","#FFEF43","#AEB534")
plot(tsukubaMP2015["USE1Code"],main="Census tracts and Tsukuba urban plans 2015",
pal=kawanakapalette ,
key.pos=3,
lwd=1, reset=FALSE)
Several tracts overlap two or even three plan use classes. Those with second and third uses are marked
with a circle or triangle respectively.
Kawanaka, Takashi, Hiroshi Kaneko (2015) Tsukuba Science City's problems on formation process through a present state and subjects,
Technical Note of NILIM,
No. 815, January 2015, http://www.nilim.go.jp/lab/bcg/siryou/tnn/tnn0815.htm
Inui, Yasuyo (2017) The Details and Characteristics of Residential Development alongside Tsukuba Express Railway – Examination of 21 Century’s Suburban Development,
Bulletin of the Faculty of Education, Ibaraki University. Humanities and social sciences, Vol 66, pp 35-50, 30 Mar 2017,
http://hdl.handle.net/10109/13324
Pebesma, E., 2018. Simple Features for R: Standardized Support for Spatial Vector
Data. The R Journal 10 (1), 439-446, https://doi.org/10.32614/RJ-2018-009