地理数据自动导入工具
安装方式
先用 Prompt 核对来源,也可切换到安装命令或下载可用的安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "portaljs-add-geo":https://skillpi.com/zh/skills/deepskill-6d86be93cd3748bff398d9a0bcd670eb7b772f13895352d28bc2db75d6640ca7。安装前核对上游来源和版本:https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/6ea46b08dce892944db7c16f28d0b5308d402402/plugins/community/portaljs/skills/portaljs-add-geo/SKILL.md。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
此命令从 GitHub 来源仓库获取指定技能。运行前请先查看源文件。
npx skills add https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/6ea46b08dce892944db7c16f28d0b5308d402402/plugins/community/portaljs/skills/portaljs-add-geo --skill portaljs-add-geo来源与配置
查看 GitHub 源码jeremylongshore/tons-of-skills-marketplace固定提交 6ea46b08dce892944db7c16f28d0b5308d402402
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
本条目介绍 地理数据自动导入工具 的公开用途。DeepSkill 当前公开目录说明:“自动将地理空间文件(GeoJSON、Shapefile、GeoPackage、KML/KMZ、FlatGeobuf、带几何字段的CSV)摄取到用户本地机器上的 PortalJS 门户中,无需服务器。将坐标系标准化为 EPSG:4326,生成 PMTiles 渲染层和 GeoParquet 查询层,并通过 Git LFS 将所有三个产物上传至 Cloudflare R2,同时在 showcase 自动渲染的 datasets.json 中添加一个双 tier 数据集条目。适用于源数据为需要地图或空间查询视图的矢量地理格式时使用。” 适用场景包括部署发布与上云、写 SQL 取数。本页根据公开目录资料和固定版本的上游仓库整理,建议使用前核对该版本的环境、工具、权限及数据处理要求。Skillπ 提供站方用途介绍与原站链接;原始 SKILL.md 和附件仅在对应许可允许时开放。
文件浏览
--- name: portaljs-add-geo description: Auto-ingest a geospatial file (GeoJSON, Shapefile, GeoPackage, KML/KMZ, FlatGeobuf, CSV-with-geometry) into a PortalJS portal on the user's own machine, with no server. Normalizes CRS to EPSG:4326, derives a PMTiles render tier and a GeoParquet query tier, pushes all three artifacts to Cloudflare R2 via Git LFS, and appends one dual-tier datasets.json entry the showcase auto-renders. Use when the source is a vector geo format that needs a map or spatial-query view. allowed-tools: Read, Write, Edit, Bash(ogr2ogr:*), Bash(ogrinfo:*), Bash(tippecanoe:*), Bash(duckdb:*), Bash(git:*), Bash(curl:*), Bash(npx:*), Bash(node:*), Bash(mkdir:*), Bash(cp:*), Bash(wc:*), Bash(command:*), WebFetch version: 1.0.0 author: Datopian <hello@datopian.com> license: MIT compatibility: Claude Code with PortalJS portals (Next.js 14, React 18/19, Node 18+). Requires native GDAL, tippecanoe, and duckdb on the user's machine (macOS or Linux/WSL). Runs from any project via the plugin, a personal ~/.claude/commands install, or a portaljs clone. tags: - portaljs - data-portal - geospatial - pmtiles - geoparquet - duckdb --- # PortalJS — Add Geo ## Overview Turn one geospatial upload into a **dual-tier** PortalJS dataset entirely on the user's machine — **no server-side container compute**, keeping the zero-backend bet end-to-end. From a single source the skill derives two serverless tiers plus the preserved original: - **PMTiles** (render tier) — a vector-tile archive `<MapPreview>` renders with MapLibre GL over HTTP range requests; any dataset size pans and zooms with no tile server. - **GeoParquet** (query tier) — a GeoParquet 1.1 file (covering `bbox` column, Hilbert-sorted) `<GeoQuery>` runs spatial SQL over in place via DuckDB-Wasm. - **Original** — the untouched upload in its native CRS, kept downloadable. All three land on Cloudflare R2 (Git LFS → Giftless), and the skill appends **one** `datasets.json` entry whose `resources[]` match the shape the showcase auto-renders (the `@reference/world-boundaries` demo, PR #1647): `pmtiles` → `<MapPreview>`, `geoparquet` → `<GeoQuery>`, original → download. No page edits are needed. It automates the manual `tippecanoe`/`duckdb` recipes in the template README. ## Prerequisites - A scaffolded `portaljs-catalog` portal whose template ships `components/MapPreview.tsx` and `components/GeoQuery.tsx` (PR #1647 or later). - Native CLIs on the user's machine: **GDAL** (`ogr2ogr`, `ogrinfo`), **tippecanoe**, and **duckdb** (with the `spatial` extension). macOS: `brew install gdal tippecanoe duckdb`; Debian/Ubuntu: `apt-get install gdal-bin duckdb` + tippecanoe (apt or build from source); Windows: use WSL. The skill hard-stops with the install hint if any is missing. - Arc credentials for the Git-LFS → R2 push (the same token `portaljs-deploy` resolves), or an OSS self-hosted Giftless. ## Instructions The canonical, full step-by-step workflow is [`.claude/commands/portaljs-add-geo.md`](https://github.com/datopian/portaljs/blob/main/.claude/commands/portaljs-add-geo.md) — the single source of truth. Read and follow it when executing. Summary: 1. Gather input — source (geo file path or URL), portal directory, namespace. Interview if missing; never dead-end. 2. Detect the native tools (`ogr2ogr`, `tippecanoe`, `duckdb` + `spatial`). Any missing → print the per-OS install and stop. 3. Validate the portal directory and confirm the geo showcase components exist. 4. Fetch (if URL) and detect the input format; reject raster and bare `.shp`. 5. Preserve the original, then normalize to EPSG:4326 GeoJSON with `ogr2ogr -t_srs EPSG:4326`. 6. Apply the size escape hatch (measure normalized-GeoJSON bytes): warn ≥ 500 MB; skip PMTiles and emit GeoParquet-only > 2 GB (documented, never silent). 7. Derive PMTiles with `tippecanoe -zg --drop-densest-as-needed`. 8. Derive GeoParquet with `duckdb` — covering `bbox` STRUCT + `ST_Hilbert` order; verify a range read. 9. Track all three files with Git LFS, mint an Arc JWT, push to R2, prune, and build the absolute `data.portaljs.com` URLs. 10. Append one dual-tier `datasets.json` entry (`pmtiles` + `geoparquet` + original resources). 11. Verify: `npx tsc --noEmit` and a `Range:` 206 check on the R2 URL. 12. Report the tiers, manifest entry, and showcase route. ## Output - **Created:** `data/<slug>.pmtiles`, `data/<slug>.parquet`, `data/<slug>.<origext>` (all LFS-tracked → R2); `data/<slug>.4326.geojson` (intermediate; can be pruned). - **Modified:** `datasets.json` (one dual-tier entry appended); `.gitattributes` (LFS tracking). - **Verified:** `npx tsc --noEmit` passes; the R2 URLs answer HTTP 206 range reads. - **Result:** `/@<namespace>/<slug>` renders the PMTiles map and the GeoParquet spatial-query panel together, with no page edits. ## Error Handling | Symptom | Cause | Fix | | --- | --- | --- | | `MISSING_TOOLS` | `ogr2ogr`/`tippecanoe`/`duckdb` (or duckdb `spatial`) absent | Print the per-OS install line and stop; re-run after installing. | | `UNSUPPORTED_FORMAT` | Raster `.tif`/`.tiff` (COG tier, later phase) | Use `portaljs-add-dataset` for tabular; await the COG phase. | | `SHAPEFILE_NOT_ZIPPED` | Bare `.shp` with no siblings | Zip the whole `.shp/.dbf/.shx/.prj` set and pass the `.zip`. | | `MULTI_LAYER` | GPKG/KML with more than one layer | List layers and ask which to ingest; pass the layer name. | | `REPROJECTION_FAILED` | `ogr2ogr` error, often a missing `.prj` | Show stderr; re-run with `-s_srs EPSG:<code>`. | | `EMPTY_OUTPUT` | Normalized GeoJSON has 0 features | Check the geometry column / CRS of the source. | | `TILING_FAILED` / `GEOPARQUET_FAILED` | tippecanoe or duckdb non-zero | Show stderr; for very large inputs see the size escape hatch. | | `LFS_PUSH_FAILED` | Missing/expired Arc token or unset `lfs.url` | Re-mint the JWT (see `portaljs-deploy`); confirm `git config lfs.url`. | ## Examples ### Example 1 — Ingest a GeoJSON into both tiers ``` /portaljs-add-geo source=./data/rivers.geojson name="World Rivers" namespace=reference ``` ### Example 2 — Zipped Shapefile from a URL ``` /portaljs-add-geo source=https://example.com/admin-boundaries.zip slug=admin-boundaries ``` ### Example 3 — GeoPackage with an explicit layer and namespace ``` /portaljs-add-geo source=./data/census.gpkg slug=census-tracts namespace=statistics ``` ## Resources - Full workflow: [`.claude/commands/portaljs-add-geo.md`](https://github.com/datopian/portaljs/blob/main/.claude/commands/portaljs-add-geo.md) - Flags, thresholds, and the dual-tier manifest shape: [`references/reference.md`](references/reference.md) - Related skills: `portaljs-add-dataset`, `portaljs-add-map`, `portaljs-add-resource`, `portaljs-deploy` - tippecanoe: <https://github.com/felt/tippecanoe> · DuckDB spatial: <https://duckdb.org/docs/extensions/spatial>
当前收录版本
1.0.0
质量评测
满分 100。前四项来自 DeepSkill 收录的质量报告。
评分依据
解决 PortalJS 门户中地理空间数据的自动化摄取与双 tier 生成问题
评分依据
触发描述清晰,覆盖多种地理格式和变体
评分依据
结构完整,包含 prerequisites、instructions、error handling 等必要章节
评分依据
工具来源明确,参数使用合理
计算方式
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
-
安装或获取外部依赖
使用官方来源并锁定版本,在隔离环境检查安装脚本。当前文档检查不覆盖后续下载的代码。
主文档提及 · 第 4, 43, 44, 70, 78 行 -
账号、密钥或授权
使用专用、最小权限账号,不把密钥粘贴到公开内容或命令日志;核对接收数据的服务与租户。
主文档提及 · 第 46 行
文档引用的域名或地址
这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。
- duckdb.org
- example.com
- github.com
安全评级与访问范围
risk · 静态证据核验,不代表运行安全保证。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。