🔍 关键词 / Keywords: 宗地图转矢量 · 地籍图矢量化 · 宗地图转GDB · 宗地图转Shapefile · 界址点坐标表转面要素 · CGCS2000 带号判定 · 高斯投影带号识别 · 国家2000坐标系 · FileGDB · Shapefile · arcpy · GDAL/osgeo · OCR · PaddleOCR · Tesseract · 权属登记 · 不动产登记 · 界址点 · cadastral to vector · parcel to gdb · cgcs2000 zone detection · gauss-kruger projection
把宗地图(栅格 PNG)转成矢量面要素类(FileGDB / Shapefile),面向权属登记级精度。
宗地图 PNG
│ ① OCR 提取界址点坐标表 + 属性
▼
坐标表 (点号, 列A, 列B)
│ ② 自动判定 CGCS2000 3 度带带号 + 坐标轴 → ③ 用户确认
▼
闭合多边形 (Polygon)
│ ④ arcpy 优先 / GDAL 回退,写 FileGDB 或 Shapefile
▼
.gdb / .shp (含 source_file 字段,可追溯源图)
│ ⑤ 用图上标注面积闭环自检
▼
交付
- CGCS2000 3 度带带号自动判定:从坐标的带号前缀(8 位数,前 2 位 = 带号)识别带号 N,映射
EPSG = 4488 + N(zone 25→4513 … zone 39→4527 … zone 45→4533)。 - 坐标轴自动判定:带号前缀的列 = 东坐标,另一列 = 北;两列都无前缀时引导用户指定。
- 判定结果必须用户确认:权属级不盲信自动判定。
- 双后端:arcpy(ArcGIS Pro)优先,无 arcpy 回退 GDAL/osgeo(OpenFileGDB 驱动,GDAL ≥ 3.6);GDB 写不了回退 Shapefile。
- OCR 多库备选:analyze_image MCP(多模态,最准)→ paddleocr → tesseract(chi_sim) → 手动转录。
- source_file 字段:自动记录源文件路径,每条记录可追溯来自哪张图。
- 面积闭环自检:计算面积 vs 图上标注面积,误差 > 0.5% 告警。
作为 Claude Code skill:
npx skills add <owner>/cadastral-to-vector -g -y或克隆后把目录加入 skills 路径。
python scripts/ocr_coords.py --img 宗地图.png --out-coords pts.txt --out-attrs attrs.json推荐:用
analyze_imageMCP 提取(多模态,最准),结果列给用户核对后存为pts.txt。
python scripts/coords_to_feature.py --coords pts.txt --source 宗地图.png --detect-onlypython scripts/coords_to_feature.py \
--coords pts.txt \
--source 宗地图.png \
--out 宗地.gdb \
--fig-area 54444.0 \
--attrs-json '{"权利人":"张三","面积":54444.0}'python scripts/coords_to_feature.py --coords pts.txt --source 宗地图.png --out 宗地.gdb --zone 39 --axis BA每行 点号,列A,列B,按界址线连接顺序(末尾自动闭合回第一个点):
J1,2596671.992,39458578.467
J2,2596693.097,39458557.676
...
- Python 3
- 写 GDB:arcpy(ArcGIS Pro
arcgispro-py3)或 GDAL/osgeo ≥ 3.6 - OCR(任选):analyze_image MCP / paddleocr / tesseract
- 当前支持单宗地(一图一面);多宗地未来扩展。
- shapefile 字段名限 10 字节,中文业务字段名会被截断,建议用 GDB。
- OCR 结果务必人工核对,权属登记级不盲信。
MIT