Skip to content

About

专为中国 GIS 应用场景构建的开源地理数据集,包含正确的国界线、九段线和完整的行政区划数据。

Topics

Resources

Stars

25 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

China-GeoData 🇨🇳

专为中国 GIS 应用场景构建的开源地理数据集,包含正确的国界线、九段线和完整的行政区划数据。

为什么做这个项目?

在使用开源 GIS 数据时,经常会遇到以下问题:

  • 国界线错误:许多国际数据集(如 Natural Earth)中的中国国界线不符合中国官方标准,缺少藏南、阿克赛钦等区域
  • 缺少九段线:绝大多数国际数据集不包含南海九段线(现称"十段线")
  • 缺少台湾省:部分数据集将台湾单独列出,而非作为中国的一个省
  • 行政区划数据不完整:难以找到同时包含省、市、区县三级行政区划且带有精确边界的开源数据

本项目旨在提供一套开箱即用、符合中国标准的 GIS 数据,供国内开发者在 Web 地图、数据可视化、地理分析等场景中直接使用,无需再为边界问题而烦恼。

数据概览

📁 目录结构

China-GeoData/
├── csv/                          # CSV 格式数据
│   └── china_cities.csv          # 中国主要城市经纬度(35 个城市)
├── geojson/                          # GeoJSON 格式数据
│   ├── china_province.geojson        # 中国全国轮廓(含行政区划元数据)
│   ├── china_province_full.geojson   # 省级边界(35 个省级行政区)
│   ├── china_province_city_full.geojson  # 区县级边界(477 个区县)
│   ├── ne_50m_coastline.geojson      # 1:50m 全球海岸线数据
│   └── ne_50m_coastline_without_china.geojson  # 移除中国海岸线的全球海岸线
├── shp/                          # Shapefile 格式数据
│   ├── china_country.*           # 中国完整国界(含岛屿)
│   ├── china.*                   # 中国行政区划(省级)
│   ├── china_without_islands.*   # 中国大陆轮廓(不含岛屿)
│   ├── china_nine_dotted_line.*  # 南海九段线
│   └── simplied_china_country.*  # 简化版国界(适合小比例尺展示)
└── pyproject.toml                # Python 项目配置

📊 数据详情

GeoJSON 数据

文件 说明 要素数量 属性字段
china_province.geojson 全国轮廓 1 adcode, name, center, centroid, childrenNum, level, parent
china_province_full.geojson 省级行政区划 35 adcode, name, center, centroid, childrenNum, level, parent, subFeatureIndex, acroutes
china_province_city_full.geojson 区县级行政区划 477 adcode, name, center, centroid, childrenNum, level, parent, subFeatureIndex, acroutes
ne_50m_coastline.geojson 1:50m 全球海岸线 1,428 scalerank, featurecla, min_zoom
ne_50m_coastline_without_china.geojson 移除中国海岸线的全球海岸线 1,412 scalerank, featurecla, min_zoom

Shapefile 数据

文件 说明
china_country 中国完整国界线(含台湾、海南等岛屿)
china 省级行政区划边界
china_without_islands 中国大陆轮廓(不含岛屿)
china_nine_dotted_line 南海九段线
simplied_china_country 简化版国界(文件更小,适合 Web 展示)

CSV 数据

china_cities.csv 包含 35 个中国主要城市的经纬度信息:

字段 说明
name 城市中文名
name_en 城市英文名
lat 纬度
lon 经度

涵盖所有省会城市及直辖市,另含大连、青岛、厦门、深圳等主要城市。

快速开始

环境要求

  • Python >= 3.12
  • 包管理器:uv(推荐)或 pip

安装依赖

# 使用 uv(推荐)
uv sync

# 或使用 pip
pip install geopandas requests

使用示例

加载 GeoJSON 数据

import geopandas as gpd

# 加载省级行政区划
gdf = gpd.read_file('geojson/china_province_full.geojson')
print(gdf[['name', 'adcode', 'level']].head())

加载 Shapefile 数据

import geopandas as gpd

# 加载中国国界
china = gpd.read_file('shp/china_country.shp')

# 加载九段线
nine_line = gpd.read_file('shp/china_nine_dotted_line.shp')

# 加载省级区划
provinces = gpd.read_file('shp/china.shp')

读取城市坐标

import pandas as pd

cities = pd.read_csv('csv/china_cities.csv')
print(cities.head())

在前端地图中使用

// 使用 fetch 加载 GeoJSON 并渲染到 Mapbox GL / MapLibre / Leaflet
const response = await fetch('geojson/china_province_full.geojson')
const data = await response.json()

// MapLibre GL JS
map.addSource('provinces', { type: 'geojson', data })
map.addLayer({
  id: 'provinces-fill',
  type: 'fill',
  source: 'provinces',
  paint: { 'fill-color': '#4285f4', 'fill-opacity': 0.3 },
})

数据属性说明

行政区划 GeoJSON

字段 类型 说明
adcode number 行政区划代码(如 110000 = 北京市)
name string 行政区划名称
center [lon, lat] 中心点坐标
centroid [lon, lat] 质心坐标
childrenNum number 子级行政区数量
level string 行政级别:country / province / district
parent object 上级行政区信息(含 adcode)
subFeatureIndex number 在同级要素中的索引
acroutes number[] 行政层级路径(如 [100000, 110000] = 中国 → 北京)

海岸线 GeoJSON

字段 类型 说明
scalerank number 比例尺等级
featurecla string 要素类型(均为 Coastline)
min_zoom number 最小缩放级别

数据来源

  • 行政区划数据来源于国内权威地理信息平台,确保边界符合中国官方标准
  • 海岸线数据来自 Natural Earth(1:50m 比例尺)
  • 所有数据均经过校验,包含完整的省级行政区(含台湾省)及南海九段线

国内加速下载

由于 GitHub 在国内访问不稳定,以下提供加速下载地址(基于 ghfast):

将下方链接中的 Supeset/China-GeoData 替换为实际的 GitHub 仓库路径即可使用。

https://ghfast.top/https://raw.githubusercontent.com/Supeset/China-GeoData/main/geojson/china_province.geojson
https://ghfast.top/https://raw.githubusercontent.com/Supeset/China-GeoData/main/geojson/china_province_full.geojson
https://ghfast.top/https://raw.githubusercontent.com/Supeset/China-GeoData/main/geojson/china_province_city_full.geojson
https://ghfast.top/https://raw.githubusercontent.com/Supeset/China-GeoData/main/geojson/ne_50m_coastline.geojson
https://ghfast.top/https://raw.githubusercontent.com/Supeset/China-GeoData/main/geojson/ne_50m_coastline_without_china.geojson

在前端项目中直接使用:

const GITHUB_REPO = 'Supeset/China-GeoData'
const GHFAST = `https://ghfast.top/https://raw.githubusercontent.com/${GITHUB_REPO}/main`

// 加载省级边界
const res = await fetch(`${GHFAST}/geojson/china_province_full.geojson`)
const data = await res.json()

技术栈

  • 数据处理:GeoPandas - Python 空间数据分析库
  • 数据格式:GeoJSON / Shapefile / CSV
  • 包管理:uv - 极速 Python 包管理器

许可证

MIT License © 2025 圈集

About

专为中国 GIS 应用场景构建的开源地理数据集,包含正确的国界线、九段线和完整的行政区划数据。

Topics

Resources

Stars

25 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors