跳到正文
cccskills
免费在 GitHub 公开

arcgis-to-portaljs

Migrate an ArcGIS Hub open data site into a PortalJS catalog. The skill collects the inventory, exports and converts spatial and tabular data for publishing, uploads files to Cloudflare R2 through Git LFS, and produces a report comparing source and derived data.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

Migrate a whole ArcGIS Hub site into a PortalJS Arc portal end-to-end. Harvests the Hub /data.json (DCAT-US) inventory, exports every FeatureService layer through the ArcGIS REST query API with resultOffset paging, converts each to the serverless dual tier (PMTiles render + GeoParquet query) with tabular items to Parquet, pushes everything to Cloudflare R2 via Git LFS, appends dual-tier datasets.json entries, and writes a source-vs-derived parity report. Use to move a City or sector ArcGIS Hub open-data portal onto PortalJS with no server-side compute.

集成工具Cloudflare

实测评分 未实测

查看安装方法

适用场景

  • Moving a city ArcGIS Hub catalog to PortalJS
  • Migrating selected datasets from a Hub site
  • Comparing exported data with its ArcGIS source

包含的文件(3)

  • SKILL.md7.8 KB
  • references/reference.md5.4 KB
  • references/sync-and-cutover.md14.6 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

ArcGIS Hub → PortalJS

Overview

Migrate an entire ArcGIS Hub open-data site into a PortalJS Arc portal in one pass. Every Hub site is machine-readable — a DCAT-US catalog at /data.json, with every dataset backed by an ArcGIS REST FeatureService — so migration is a harvest → export → convert → publish → verify pipeline that runs almost fully automated on the operator's machine, no server-side compute. The tooling is the reusable arcgis-to-portaljs migrator: input is one Hub URL, output is a ready-to-deploy PortalJS catalog plus a parity report.

The skill is an orchestrator: it reuses the DCAT-US harvest from portaljs-migrate, the ogr2ogr/tippecanoe/duckdb dual-tier conversion from portaljs-add-geo, and the bulk Git-LFS → R2 push from portaljs-migrate. Its novel parts are the FeatureService REST export loop (paged features, not just a link) and the source-vs-derived parity report.

Prerequisites

  • A scaffolded PortalJS portal whose template ships components/MapPreview.tsx and components/GeoQuery.tsx (PR #1647 or later). Run portaljs-new-portal first if none.
  • Native CLIs: GDAL (ogr2ogr, ogrinfo), tippecanoe, duckdb (with spatial), and jq. macOS: brew install gdal tippecanoe duckdb jq; Debian/Ubuntu: apt-get install gdal-bin duckdb jq plus tippecanoe (apt or build from source); Windows via WSL. The skill hard-stops with the install hint if any is missing.
  • Arc credentials for the Git-LFS → R2 push (the token portaljs-deploy resolves), or an OSS self-hosted Giftless.

Instructions

The canonical, full step-by-step workflow is .claude/commands/arcgis-to-portaljs.md — the single source of truth. Read and follow it when executing. Summary:

  1. Gather input — Hub URL, portal directory, project slug, optional flags (--limit, --only, --dry-run, --namespace-mode). Interview if missing; never dead-end.
  2. Check native tools (ogr2ogr, tippecanoe, duckdb + spatial, jq). Any missing → print the per-OS install and stop.
  3. Validate the portal directory and confirm the geo showcase components exist.
  4. Harvest the Hub /data.json (reuse the portaljs-migrate DCAT-US map) and classify each item: vector (FeatureService), table, or non-data (web map / 3D / imagery → skipped). Under --namespace-mode owner, resolve namespaces through a publisher-normalization table with title-prefix fallback for broken {{source}} publishers (multi-publisher Hubs ship dirty publisher labels). Dedup near-duplicate hosted-view layers — but only after a mandatory live record-count check on BOTH twins: equal ⇒ dedup (keep the source layer, log the pair); different ⇒ keep both as distinct datasets. Consolidate per-year dataset series into one year-partitioned Parquet with legacy per-year view entries. Enrich from the AGOL item: sanitized metadata (license/description/dates), cleaned display title (cleanTitle — raw title still drives the slug), category (item categories → meaningful theme → keyword mapping), and a thumbnail snapshot into public/thumbnails/.
  5. Export each vector layer through the ArcGIS REST query API with resultOffset paging (f=geojson, outSR=4326); fall back to keyset paging on transfer limits; accept a customer File Geodatabase dump for very large layers.
  6. Convert each layer to the dual tier via the portaljs-add-geo recipe (PMTiles + GeoParquet); tabular items to Parquet. Preserve the native-CRS original.
  7. Publish — bulk Git-LFS track + one push to R2 through Giftless, then append dual-tier datasets.json entries (upsert on (namespace, slug)).
  8. Write arcgis-parity-report.md — record count, extent, attribute schema, and geometry validity, source vs derived, per dataset, plus the migrated/skipped/failed accounting.
  9. Report the inventory, migrated datasets, R2 push, and parity summary.

Output

  • Created: data/<namespace>/<slug>.pmtiles, .parquet, and the original per vector dataset (all LFS-tracked → R2); Parquet + original per table; arcgis-parity-report.md.
  • Modified: datasets.json (one dual-tier entry per vector dataset, one resource entry per table); .gitattributes (LFS tracking).
  • Verified: the parity report compares each derived artifact to the live FeatureService.
  • Result: /@<namespace>/<slug> renders <MapPreview> + <GeoQuery> for each vector dataset with no page edits; the catalog lists everything migrated.

Error Handling

SymptomCauseFix
MISSING_INPUTNo Hub URL providedPass the site root (e.g. https://hub-lewisville.opendata.arcgis.com) and retry.
MISSING_TOOLSogr2ogr/tippecanoe/duckdb/jq (or duckdb spatial) absentPrint the per-OS install line and stop; re-run after installing.
NOT_A_PORTALTarget dir has no datasets.json / geo componentsRun portaljs-new-portal first, then re-run.
HARVEST_FAILED/data.json unreachable or not DCAT-USConfirm the site is an ArcGIS Hub and the feed loads in a browser.
EXPORT_FAILEDOne FeatureService layer errored or hit a hard transfer capLogged and skipped; try keyset paging or a customer FGDB dump for that layer.
LFS_PUSH_FAILEDMissing/expired Arc token or unset lfs.urlRe-mint the JWT (see portaljs-deploy); confirm git config lfs.url.

Examples

Example 1 — Migrate a City Hub (Lewisville)

/arcgis-to-portaljs https://hub-lewisville.opendata.arcgis.com slug=lewisville

Example 2 — Dry-run inventory + plan only (no writes)

/arcgis-to-portaljs https://streamwaterdata.co.uk --dry-run

Example 3 — Migrate a subset, one namespace per publisher

/arcgis-to-portaljs https://streamwaterdata.co.uk --only sewer-catchments,water-boundaries --namespace-mode owner

Resources

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Add a line, bar, area, pie, or scatter chart to the showcase for a dataset already registered in PortalJS. The skill creates a reusable Chart component and displays it in the dataset’s Views section using the existing data source.

中文简介正在准备中。当前显示英语简介。

  • Show yearly emissions as a line chart
  • Compare imports and exports with grouped series
  • Display a categorical budget breakdown as a pie chart
datopian/portaljs23702026年10月24日 更新

Register a CSV, TSV, JSON, or GeoJSON source in an existing PortalJS portal. The skill adds it to the dataset catalog and routes local files or remote URLs so the catalog and showcase can display the data.

中文简介正在准备中。当前显示英语简介。

  • Register a local CSV in a PortalJS catalog
  • Add a public dataset URL without copying the file
  • Publish a GeoJSON dataset through the portal
datopian/portaljs23702026年10月24日 更新

Generate DCAT catalog feeds for a PortalJS site so open data catalogs can harvest its datasets. The skill supports JSON-LD, Turtle, and RDF/XML formats, adds feed discovery, and checks conformance to selected profiles.

中文简介正在准备中。当前显示英语简介。

  • Making a PortalJS catalog harvestable by an EU open data portal
  • Preparing feeds for a US or national open data catalog
  • Publishing catalog metadata in multiple RDF formats
datopian/portaljs23702026年10月24日 更新

Prepare a vector geospatial dataset for a PortalJS portal by converting its coordinate system, creating a map-ready PMTiles file and a queryable GeoParquet file, and registering both with the original data for an automatically rendered showcase.

中文简介正在准备中。当前显示英语简介。

  • Turn GeoJSON into a portal map and spatial query view
  • Ingest a zipped Shapefile from a URL
  • Publish a GeoPackage layer with its original file
datopian/portaljs23702026年10月24日 更新

Add an interactive Leaflet map to a selected GeoJSON dataset’s PortalJS showcase. The skill can register a local or remote GeoJSON source, install the map dependencies, and render the map in the page’s Views section.

中文简介正在准备中。当前显示英语简介。

  • Show a map alongside a registered GeoJSON dataset
  • Register a local GeoJSON file and display it on a map
  • Add a remote GeoJSON source to a PortalJS showcase
datopian/portaljs23702026年10月24日 更新

Add another file to an existing PortalJS dataset, such as a data dictionary, methodology document, or another period of data. The skill updates the dataset manifest and makes the showcase display a section for each resource.

中文简介正在准备中。当前显示英语简介。

  • Adding a data dictionary to an existing dataset
  • Attaching a methodology document to a dataset
  • Adding another period's data as a separate resource
datopian/portaljs23702026年10月24日 更新

查看 datopian 的全部技能

报告此技能的问题