Install
openclaw skills install @ruiduobao/geoskill-spatial-index-builder构建 R-tree / Quadtree / GeoHash 空间索引并统计查询性能,结果与暴力搜索对齐。Build R-tree / Quadtree / GeoHash spatial indexes, benchmark query performance and align results with brute-force search.
openclaw skills install @ruiduobao/geoskill-spatial-index-builderBuilds three kinds of spatial indexes and benchmarks their query performance against a batch of query windows; results from every index are strictly validated against brute-force scanning:
STRtree, performs exact intersection queries with predicate="intersects"; the most widely used spatial index in production environments.The benchmark times each index and compares result consistency against brute-force scanning, reporting average latency, hit counts and speed-up ratio. --synthetic mode generates 300 random points.
pip install numpy rasterio geopandas shapely fiona pyproj
python geoskill-spatial-index-builder.py --bbox 116.0 39.0 117.0 40.0 --synthetic --output-dir ./out
python geoskill-spatial-index-builder.py --bbox 116.0 39.0 117.0 40.0 --synthetic --features 300 --queries 15 --output-dir ./bench
python geoskill-spatial-index-builder.py --input pois.shp --queries 30 --output-dir ./poi_bench
python geoskill-spatial-index-builder.py --bbox 121.0 31.0 122.0 32.0 --synthetic --precision 7 --output-dir ./gh7 --quiet
python geoskill-spatial-index-builder.py --bbox 116.0 39.0 117.0 40.0 --synthetic --features 2000 --queries 50 --output-dir ./stress
python geoskill-spatial-index-builder.py --bbox 116.0 39.0 117.0 40.0 --synthetic --precision 4 --features 500 --output-dir ./gh4
| File | Format | Description |
|---|---|---|
spatial_index_report.json | JSON | Per-index performance, hit counts, consistency |
output-manifest.json | JSON | Run manifest |
--input: local vector file--synthetic: locally generated random point set--synthetic mode requires no network at all.MIT
构建三种空间索引并对一批查询窗口做性能基准测试,所有索引结果与暴力 扫描严格对齐:
STRtree,用 predicate="intersects" 做精确
相交查询,是生产环境最常用的空间索引。基准测试对每个索引计时并与暴力扫描比对结果一致性,输出平均耗时、命中
数与加速比。--synthetic 模式生成 300 个随机点。
pip install numpy rasterio geopandas shapely fiona pyproj
python geoskill-spatial-index-builder.py --bbox 116.0 39.0 117.0 40.0 --synthetic --output-dir ./out
python geoskill-spatial-index-builder.py --bbox 116.0 39.0 117.0 40.0 --synthetic --features 300 --queries 15 --output-dir ./bench
python geoskill-spatial-index-builder.py --input pois.shp --queries 30 --output-dir ./poi_bench
python geoskill-spatial-index-builder.py --bbox 121.0 31.0 122.0 32.0 --synthetic --precision 7 --output-dir ./gh7 --quiet
python geoskill-spatial-index-builder.py --bbox 116.0 39.0 117.0 40.0 --synthetic --features 2000 --queries 50 --output-dir ./stress
python geoskill-spatial-index-builder.py --bbox 116.0 39.0 117.0 40.0 --synthetic --precision 4 --features 500 --output-dir ./gh4
| 文件 | 格式 | 说明 |
|---|---|---|
spatial_index_report.json | JSON | 各索引性能、命中数、一致性 |
output-manifest.json | JSON | 运行清单 |
--input:本地矢量文件--synthetic:本地生成随机点集--synthetic 模式完全无网络。MIT