By tomizono
The PM 2.5 checker written by R has been working nicely for me. I put a shortcut icon of this small script on my desktop PC, to check the air pollution when I run. The Ibaraki Prefecture Agency has been increasing watching points for PM 2.5 concentration from China. A problem is that I cannot picture to myself all the observation locations exactly.
Fig. 1a. March 2013
Clik here to view.

Fig. 1b. January 2016
Now, time to use the power of GIS.
1. Shape file
City boundary data is published by Japanese government agency at http://www.gsi.go.jp/kankyochiri/gm_jpn.html and http://www.gsi.go.jp/kankyochiri/gm_japan_e.html (English).
- Download g
m-jpn-all_u_2_1.zip
(8MB) , which is the current (2015, v.2.1) file with all layers. - Unzip to
~/var/gis/gm-jpn-all_u_2_1
, or somewhere you like. - The city boundary shape file is
polbnda_jpn.shp
.
Let’s see if this map data works or not.
Here I use CRAN package maptools
.
library(maptools) cities.japanA map of Japan is drawn. It's working.
Image may be NSFW.
Clik here to view.Fig. 2. City boundaries in Japan
I don't need the entire Japan but
Ibaraki Ken
local area only.cities.ibarakiIt's perfect! The specification of data can be found at http://www.iscgm.org/gm/spec.html.
Image may be NSFW.
Clik here to view.Fig. 2. City boundaries in Ibaraki
This map is plotted with Longitude on X-axis and with Latitude on Y-axis. The range can be shown by
@bbox
.> cities.ibaraki@bbox min max x 139.6879 140.85190 y 35.7396 36.94547These values are useful to overwrite multiple layers on the same plot. Let's see the following plot fits exactly on the previous one.
plot(cities.ibaraki, add=T, xlim=cities.ibaraki@bbox['x',], ylim=cities.ibaraki@bbox['y',], border=rgb(1,0,0,0.2), lwd=8)
Plot
method is expanded for the classSpatialPolygons
, and specific parameters can be found at the help page ofSpatialPolygons-class
.Finally, I'm ready to ...read more
Source:: r-bloggers.com