zh-CN Level 3 Rivers Map

Import easyclimate-map for loading China level 3 river 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_river3(type="line") to retrieve the line-type GeoDataFrame of China’s level 3 rivers. This data includes river line segments and can be used to draw river courses.

zh_border_line = eclmap.get_zh_CN_nation(type = "line")
zh_river1_line = eclmap.get_zh_CN_river3(type = "line")
zh_river1_line
FNODE_ TNODE_ LPOLY_ RPOLY_ LENGTH HYD2_4M_ HYD2_4M_ID GBCODE NAME LEVEL_RIVE LEVEL_LAKE geometry
0 1 1 6 4 0.075 1 1359 23010 克鲁伦河 3 1 LINESTRING (117.75391 49.16444, 117.75777 49.1...
1 2 2 5 4 0.111 2 1359 23010 克鲁伦河 3 1 LINESTRING (117.71732 49.18985, 117.72263 49.1...
2 3 3 7 4 0.104 3 1359 23010 克鲁伦河 3 1 LINESTRING (117.00603 48.79309, 117.00961 48.7...
3 103 103 113 111 0.025 4 60 23010 第二松花江 2 3 LINESTRING (126.77966 43.64935, 126.78164 43.6...
4 104 104 111 114 0.025 5 60 23010 第二松花江 2 3 LINESTRING (126.77989 43.64034, 126.77573 43.6...
... ... ... ... ... ... ... ... ... ... ... ... ...
2138 1990 1989 764 1 0.020 2139 9999 99300 NaN 0 0 LINESTRING (113.38125 22.22302, 113.40099 22.2...
2139 1987 1990 764 1 0.223 2140 4001 21011 西江干流水道(西海水道、磨刀门水道) 1 0 LINESTRING (113.25552 22.38934, 113.25866 22.3...
2140 1988 1991 1 1 0.973 2141 1220 21011 澜沧江 1 0 LINESTRING (100.60846 22.28732, 100.60873 22.2...
2141 1991 1992 1 1 0.103 2142 1220 21011 澜沧江 1 0 LINESTRING (101.16122 21.82066, 101.16929 21.8...
2142 1992 1993 1 1 0.252 2143 1220 21011 澜沧江 1 0 LINESTRING (101.11514 21.77719, 101.11269 21.7...

2143 rows × 12 columns



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

zh_river1_line.plot()
plot zh CN river3
<Axes: >

Create a subplot with PlateCarree projection (central longitude 180°), set geographic extent [70-140°E, 0-50°N]. Add gridlines, coastlines, China’s national boundary line geometries (red lines, no fill), and level 3 river line geometries (blue lines, no fill). This step demonstrates advanced map projections and geometry overlays for rivers. 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 national boundaries with red edges, line width 0.3; overlays river geometries with blue 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_border_line.geometry,
    crs = ccrs.PlateCarree(),
    facecolor = "none",
    edgecolor = "r",
    lw = 0.3
)
ax.add_geometries(
    zh_river1_line.geometry,
    crs = ccrs.PlateCarree(),
    facecolor = "none",
    edgecolor = "b",
    lw = 0.3
)
plot zh CN river3
<cartopy.mpl.feature_artist.FeatureArtist object at 0x7fb49d92fbc0>

Polygon

Use easyclimate_map.get_zh_CN_river3(type="polygon") to retrieve the polygon-type GeoDataFrame of China’s level 3 rivers. This data includes closed polygon areas for river representations and can be used for area filling (e.g., wide river sections).

zh_river1_polygon = eclmap.get_zh_CN_river3(type = "polygon")
zh_river1_polygon
AREA PERIMETER HYD2_4M_ HYD2_4M_ID GBCODE NAME LEVEL_LAKE CODE_LAKE geometry
0 0.012 0.892 2 3 79200 NaN 0 NaN POLYGON ((117.79163 49.50795, 117.78755 49.511...
1 0.000 0.099 3 4 23010 NaN 4 NaN POLYGON ((117.78146 49.50698, 117.78153 49.498...
2 0.266 4.434 4 1 23010 呼伦湖 1 L230 POLYGON ((117.68192 48.97824, 117.68137 48.977...
3 0.000 0.111 5 9 79200 NaN 0 NaN POLYGON ((117.71732 49.18985, 117.72082 49.189...
4 0.000 0.075 6 9 79200 NaN 0 NaN POLYGON ((117.75391 49.16444, 117.75384 49.171...
... ... ... ... ... ... ... ... ... ...
821 0.000 0.012 823 9 79200 NaN 0 NaN POLYGON ((103.64239 29.51201, 103.6407 29.5097...
822 0.000 0.013 824 9 79200 NaN 0 NaN POLYGON ((103.78115 29.49488, 103.77854 29.496...
823 0.000 0.022 825 9 79200 NaN 0 NaN POLYGON ((103.62196 29.49894, 103.62032 29.493...
824 0.000 0.015 826 9 79200 NaN 0 NaN POLYGON ((103.60494 29.48742, 103.60236 29.488...
825 0.000 0.038 827 9 79200 NaN 0 NaN POLYGON ((103.78929 29.46786, 103.7885 29.4633...

826 rows × 9 columns



Use GeoPandas’ plot() method for quick visualization of the river polygon. This step is for initial data inspection without custom projections. Output: Display the default Matplotlib plot of the filled river boundary.

zh_river1_polygon.plot()
plot zh CN river3
<Axes: >

Create a subplot with PlateCarree projection (central longitude 180°), set geographic extent [70-140°E, 0-50°N]. Add gridlines, coastlines, China’s national boundary line geometries (red lines, no fill), and level 3 river polygon geometries (blue fill, no edges). This step demonstrates area fill effects for rivers, suitable for highlighting water bodies or hydrological maps. Parameter Details:

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

  • Applicable for overlaying other data layers, such as flow directions 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_border_line.geometry,
    crs = ccrs.PlateCarree(),
    facecolor = "none",
    edgecolor = "r",
    lw = 0.3
)
ax.add_geometries(
    zh_river1_polygon.geometry,
    crs = ccrs.PlateCarree(),
    facecolor = "b",
    edgecolor = "none",
    lw = 0.3
)
plot zh CN river3
<cartopy.mpl.feature_artist.FeatureArtist object at 0x7fb49d5fbc80>

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