zh-CN Provincial Map

Import easyclimate-map for loading China provincial boundary data, matplotlib.pyplot for plotting, and cartopy.crs for map projections. These libraries together support the retrieval and visualization of geographic data.

import easyclimate_map as eclmap
import matplotlib.pyplot as plt
import cartopy.crs as ccrs

Line

Use easyclimate_map.get_zh_CN_provinces(type="line") to retrieve the line-type GeoDataFrame of China’s provincial boundaries. This data includes boundary line segments and can be used to draw outlines.

zh_provinces_line = eclmap.get_zh_CN_provinces(type = "line")
zh_provinces_line
FNODE_ TNODE_ LPOLY_ RPOLY_ LENGTH BOU2_4M_ BOU2_4M_ID GBCODE geometry
0 2 7 2 3 7.743 1 23 61030 LINESTRING (121.48844 53.33265, 121.49738 53.3...
1 7 12 2 3 6.426 2 15 61031 LINESTRING (125.35986 51.6098, 125.37328 51.58...
2 12 16 2 3 2.006 3 80 61031 LINESTRING (124.74187 48.92069, 124.73269 48.9...
3 16 21 2 3 2.281 4 99 61030 LINESTRING (124.26729 48.52986, 124.0718 48.42...
4 21 23 2 3 0.587 5 75 61031 LINESTRING (122.38892 47.34401, 122.44706 47.3...
... ... ... ... ... ... ... ... ... ...
1780 2097 2098 1 1 0.045 1781 1 26100 LINESTRING (112.6427 5.38615, 112.64041 5.3858...
1781 2099 2100 1 1 0.071 1782 2 26100 LINESTRING (112.28411 3.97788, 112.28306 3.979...
1782 2101 2102 1 1 0.055 1783 3 26100 LINESTRING (112.29087 3.88075, 112.29078 3.882...
1783 2103 2104 1 1 0.052 1784 1 26100 LINESTRING (112.06014 3.86478, 112.05986 3.866...
1784 2105 2106 1 1 1.112 1785 1001 61010 LINESTRING (111.79456 3.40848, 111.85775 3.422...

1785 rows × 9 columns



Use GeoPandas’ plot() method for quick visualization of the boundary line. This step is for initial data inspection without custom projections.

zh_provinces_line.plot()
plot zh CN provinces
<Axes: >

Create a subplot with PlateCarree projection (central longitude 180°), set geographic extent [70-140°E, 0-50°N]. Add gridlines, coastlines, and China’s provincial boundary line geometries (red lines, no fill). This step demonstrates advanced map projections and geometry overlays. Parameter Details:

  • set_extent: Defines the map display range.

  • gridlines: Adds latitude/longitude grid with labels.

  • coastlines: Draws global coastlines (50m resolution).

  • add_geometries: Overlays boundary geometries with red edges, line width 0.3.

fig, ax = plt.subplots(subplot_kw={"projection": ccrs.PlateCarree(central_longitude=180)})

ax.set_extent([70, 140, 0, 50])
ax.gridlines(
    draw_labels=["left", "bottom"],
    color="grey",
    alpha=0.5, linestyle="--"
)
ax.coastlines(color="k", lw = 0.5, resolution = "50m")
ax.add_geometries(
    zh_provinces_line.geometry,
    crs = ccrs.PlateCarree(),
    facecolor = "none",
    edgecolor = "r",
    lw = 0.3
)
plot zh CN provinces
<cartopy.mpl.feature_artist.FeatureArtist object at 0x7f92f4819070>

Polygon

Use easyclimate_map.get_zh_CN_provinces(type="polygon") to retrieve the polygon-type GeoDataFrame of China’s provincial boundaries. This data includes closed polygon areas for boundaries and can be used for area filling.

zh_provinces_polygon = eclmap.get_zh_CN_provinces(type = "polygon")
zh_provinces_polygon
AREA PERIMETER BOU2_4M_ BOU2_4M_ID ADCODE93 ADCODE99 NAME geometry
0 54.447 68.489 2 23 230000 230000 黑龙江省 POLYGON ((121.48844 53.33265, 121.49954 53.336...
1 129.113 129.933 3 15 150000 150000 内蒙古自治区 POLYGON ((121.48844 53.33265, 121.49738 53.321...
2 175.591 84.905 4 65 650000 650000 新疆维吾尔自治区 POLYGON ((96.38329 42.72696, 96.35991 42.70969...
3 21.315 41.186 5 22 220000 220000 吉林省 POLYGON ((123.17104 46.24668, 123.21857 46.269...
4 15.603 38.379 6 21 210000 210000 辽宁省 POLYGON ((123.69019 43.37677, 123.70496 43.381...
... ... ... ... ... ... ... ... ...
920 0.000 0.037 922 3110 810000 810000 香港特别行政区 POLYGON ((114.24527 22.18337, 114.24348 22.184...
921 0.000 0.018 923 3109 810000 810000 香港特别行政区 POLYGON ((114.2862 22.18478, 114.28435 22.1850...
922 0.000 0.014 924 3112 810000 810000 香港特别行政区 POLYGON ((114.3035 22.18492, 114.30413 22.1863...
923 0.000 0.079 925 3114 810000 810000 香港特别行政区 POLYGON ((114.25628 22.16027, 114.25436 22.163...
924 0.000 0.011 926 3115 810000 810000 香港特别行政区 POLYGON ((114.29893 22.17812, 114.30064 22.178...

925 rows × 8 columns



Use GeoPandas’ plot() method for quick visualization of the boundary polygon. This step is for initial data inspection without custom projections.

zh_provinces_polygon.plot()
plot zh CN provinces
<Axes: >

Create a subplot with PlateCarree projection (central longitude 180°), set geographic extent [70-140°E, 0-50°N]. Add gridlines, coastlines, and China’s provincial boundary polygon geometries (light blue fill, no edges). This step demonstrates area fill effects, suitable for region highlighting or climate zoning maps. Parameter Details:

  • Similar to above step, but with facecolor=”lightblue” for area fill and edgecolor=”none” for no borders.

  • Applicable for overlaying other data layers, such as temperature fields or precipitation distributions.

fig, ax = plt.subplots(subplot_kw={"projection": ccrs.PlateCarree(central_longitude=180)})

ax.set_extent([70, 140, 0, 50])
ax.gridlines(
    draw_labels=["left", "bottom"],
    color="grey",
    alpha=0.5, linestyle="--"
)
ax.coastlines(color="k", lw = 0.5, resolution = "50m")
ax.add_geometries(
    zh_provinces_polygon.geometry,
    crs = ccrs.PlateCarree(),
    facecolor = "lightblue",
    edgecolor = "none",
    lw = 0.3
)
plot zh CN provinces
<cartopy.mpl.feature_artist.FeatureArtist object at 0x7f92f49a0b00>

Total running time of the script: (0 minutes 8.451 seconds)