审图号 GS(2019)1719 号地图的底图数据(省级行政区划和国界线(含九段线))

数据资料仅作为会员赠品,请勿单独购买。

今天给大家分享一份省级行政区划的地理数据:审图号 GS(2019)1719 号地图的底图数据,该数据来源于:https://www.tianditu.gov.cn/coronavirusmap/ 。不过需要注意的是即使你使用的是标准地图作为底图,修改后,必须送审获取新的审图号(审图号是图的号不是数据的号);不过有的期刊允许你在绘图时注解说明自己使用的底图审图号。因此请谨慎在期刊论文中使用由该数据绘制的地图。

为了方便大家的使用我提供三种格式的数据:

  1. GEOJSON 格式的数据;
  2. SHP 格式的数据;
  3. 用于 Stata 绘制地图的 dta 格式的数据。

为了方便大家使用这份数据,我写了一些示例代码:

R 语言

使用 R 语言绘制填充地图:

library(sf)
library(tidyverse)

# 读取地图数据
read_sf('中国省级地图GS(2019)1719号.geojson') -> cn
read_sf('九段线GS(2019)1719号.geojson') -> jdx

# 示例数据
read_csv('data.csv') -> data

# 把示例数据和地图数据合并

cn %>%
left_join(data, by = c("CNAME" = "prov")) -> df

# 绘制填充地图
df %>%
ggplot() +
geom_sf(aes(fill = pop)) +
geom_sf(data = jdx) +
coord_sf(crs = "+proj=laea +lat_0=40 +lon_0=104")

使用 R 语言绘制描点地图:

# 在地图上描点
# 生成一个示例数据:
st_bbox(cn) -> bbox
tibble(lon = runif(100, bbox['xmin'], bbox['xmax']),
lat = runif(100, bbox['ymin'], bbox['ymax']),
pop = runif(100, 1, 7)) -> df2

df2

# 为了将这些坐标点描绘在地图上,我们可以先把 df2 转换成 sf 对象
df2 %>%
st_as_sf(coords = c("lon", "lat"), crs = 4326) -> df2_sf

# 提取中国境内的点

df2_sf %>%
st_intersection(cn) -> df2_sf

df2_sf

# 在地图上描点
df %>%
ggplot() +
geom_sf(aes(fill = pop)) +
geom_sf(data = jdx) +
geom_sf(data = df2_sf, aes(size = pop), shape = 1) +
coord_sf(crs = "+proj=laea +lat_0=40 +lon_0=104") +
labs(fill = "随机数据1", size = "随机数据2")

Stata

使用 Stata 绘制填充地图:

clear all

* shp 文件转 dta 文件
shp2dta using 中国省级地图GS(2019)1719号/中国省级地图GS(2019)1719号.shp, database(中国省级地图GS(2019)1719号_db) coordinates(中国省级地图GS(2019)1719号_coord) gencentroids(centroid) genid(ID) replace

shp2dta using 中国省级地图GS(2019)1719号/九段线GS(2019)1719号.shp, database(九段线GS(2019)1719号_db) coordinates(九段线GS(2019)1719号_coord) gencentroids(centroid) genid(ID) replace

* 绘制填充地图
use 中国省级地图GS(2019)1719号_db.dta, clear
gen pop = runiform() * 100
* 修改省份标签
replace CNAME = substr(CNAME, 1, 6)
replace CNAME = "黑龙江" if CNAME == "黑龙"
replace CNAME = "内蒙古" if CNAME == "内蒙"
* grmap 默认显示标签的长度不能长于 12(四个汉字),可以运行 adoedit g_spmap_label 打开 g_spmap_label.ado,然后把第 266 行改成 “local length_d "40"”
grmap pop using 中国省级地图GS(2019)1719号_coord, id(ID) ///
fcolor("237 248 251" "178 226 226" "102 194 164" "44 162 95" "0 109 44") ///
ocolor("black" ...) ///
clmethod(custom) clbreaks(0 20 40 60 80 100) ///
graphr(margin(medium)) ///
ti("使用 Stata 绘制填充地图", color(black)) ///
legend(size(*1.5) pos(7) ///
order(2 "0~20" 3 "20~40" 4 "40~60" 5 "60~80" 6 "> 80") ///
ti(示例数据, size(*0.8) pos(11) color(black)) color(black)) ///
line(data(九段线GS(2019)1719号_coord.dta) size(*0.5 ...) color(black)) ///
label(x(lng) y(lat) l(CNAME) color(black) size(*0.7)) ///
caption("绘制:微信公众号 RStata", size(*0.8)) ///
osize(*0.01 ...) xsize(10) ysize(9) ///
aspectratio(0.9) freestyle ///
ysc(off) xsc(off) scheme(qlean)

gr_edit .style.editstyle declared_ysize(20) editcopy
gr_edit .style.editstyle declared_xsize(20) editcopy

gr export Stata绘制填充地图.png, replace width(1600)

使用 Stata 绘制描点地图:

* 绘制描点地图
* 例如把 lng lat 填充上去,pop 作为散点大小
grmap pop using 中国省级地图GS(2019)1719号_coord, id(ID) ///
fcolor("237 248 251" "178 226 226" "102 194 164" "44 162 95" "0 109 44") ///
ocolor("black" ...) ///
clmethod(custom) clbreaks(0 20 40 60 80 100) ///
graphr(margin(medium)) ///
ti("使用 Stata 绘制描点地图", color(black)) ///
legend(size(*1.5) pos(7) ///
order(2 "0~20" 3 "20~40" 4 "40~60" 5 "60~80" 6 "> 80") ///
ti(示例数据, size(*0.8) pos(11) color(black)) color(black)) ///
line(data(九段线GS(2019)1719号_coord.dta) size(*0.5 ...) color(black)) ///
point(x(lng) y(lat) prop(pop) size(*0.3)) ///
caption("绘制:微信公众号 RStata", size(*0.8)) ///
osize(*0.01 ...) xsize(10) ysize(9) ///
aspectratio(0.9) freestyle ///
ysc(off) xsc(off) scheme(qlean)
gr_edit .style.editstyle declared_ysize(20) editcopy
gr_edit .style.editstyle declared_xsize(20) editcopy

gr export Stata绘制描点地图.png, replace width(1600)

QGIS /ArcGIS

最后如果你是 GIS 工具的高手,你也可以使用 GIS 软件操作这个数据:

不论是 shp 格式的数据还是 geojson 格式的数据,GIS 软件都可以使用。

点击这里跳转到 RStata 短书平台获取附件:审图号 GS(2019)1719 号地图的底图数据(省级行政区划和国界线(含九段线))

评论