Files
geo_tools/tests/test.py
missum 2bcdcad797 refactor(io): 移除分块读取功能并简化矢量数据读取逻辑
移除 read_vector 函数中的 chunk_size 参数及相关分块读取逻辑,简化代码结构
保留 rows 参数用于数据预览功能,并更新相关文档说明
2026-04-21 20:50:50 +08:00

13 lines
466 B
Python

import sys
from pathlib import Path
# 将项目根目录添加到系统路径中,以便导入模块
sys.path.append(str(Path(__file__).parent.parent))
from app.io.readers import read_vector
# 读取 GeoJSON 文件
data_path = Path(r"D:\工作\三普成果编制\出图数据\永德\制表\制表数据.gdb\AK")
# 或者使用 rows 参数直接只读取前5行
print("\n使用 rows 参数预览:")
gdf_preview = read_vector(data_path, rows=5)
print(gdf_preview)