Skip to content

Add Snowflake vector-tile demo (tileserver) as installable skill#282

Merged
sfc-gh-ridasafdar merged 4 commits into
mainfrom
geospatial-tileserver
Jul 14, 2026
Merged

Add Snowflake vector-tile demo (tileserver) as installable skill#282
sfc-gh-ridasafdar merged 4 commits into
mainfrom
geospatial-tileserver

Conversation

@sfc-gh-obielov

Copy link
Copy Markdown
Collaborator

Summary

Adds a self-contained Snowflake vector-tile demo under samples/geospatial/tileserver/, packaged as a one-command, idempotent Cortex Code skill (.cortex/skills/deploy-tileserver).

The sample demonstrates three ways to serve the same dataset as vector tiles on Snowflake, so users can compare the tradeoffs:

Arm What it shows How it is served
1 - Dynamic MVT Live ST_AsMVT per tile from Snowflake Postgres + PostGIS; reflects edits immediately features_mvt(z,x,y) function source auto-published by Martin (SPCS)
2 - PMTiles Precomputed tile pyramid baked from the same data (freshness tradeoff) .pmtiles archive (tippecanoe) mounted into the same Martin service
3 - H3 (tile-free) Native core-Snowflake H3 aggregation rendered client-side export_h3.py -> deck.gl H3HexagonLayer, no tiles/server

The viewer is Martin's built-in Web UI on the public SPCS ingress.

Install

bash .cortex/skills/deploy-tileserver/scripts/install_tileserver.sh --connection <connection>

Idempotent, detect-reuse-else-create: provisions the Snowflake Postgres + PostGIS instance, SPCS infra (image repo, compute pool, stages, secret, EAIs), bakes PMTiles, and deploys the Martin service. --no-pmtiles skips the heavy bake.

Notes

  • No account-specific identifiers; connection, source table, and PG host are all parameterized.
  • Large bake artifacts (.pmtiles, .geojsonl, .mbtiles) are gitignored and not committed.
  • Scripts statically verified (Python compiles, bash -n clean); the installer has not yet been run end-to-end against a fresh account.

sfc-gh-obielov and others added 3 commits July 13, 2026 10:54
Three-arm vector-tile sample under samples/geospatial/tileserver:
- dynamic ST_AsMVT via Martin on SPCS
- precomputed PMTiles baked from the same data
- native H3 aggregation for client-side deck.gl

Packaged as a one-command, idempotent Cortex Code skill
(.cortex/skills/deploy-tileserver) that detect-reuse-else-creates the
Snowflake Postgres + PostGIS instance, SPCS infra, and the Martin service.
Syncs the latest deploy-tileserver skill into samples/geospatial/tileserver:
- add build_source_snapshot.py (owned SOURCE_FEATURES snapshot, immune to a
  mid-run Marketplace share lapse) and teardown_tileserver.sh (dependency-ordered
  cleanup, optional Postgres drop)
- preflight auto-installs Python deps and verifies the container daemon is live
  before any billable infra
- rewritten README and a note that tippecanoe's progress meter is non-linear
  (plateaus at z11 then races through z12; not a hang)

.... Generated with [Cortex Code](https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code)

Co-Authored-By: Cortex Code <noreply@snowflake.com>
- describe what the Martin tile server does (function sources for arm 1, mounted
  PMTiles for arm 2, catalog/TileJSON/Web UI)
- add an open-source components table (Martin, PostGIS, tippecanoe, PMTiles,
  MapLibre GL, deck.gl) with roles and licenses
- explain how the deploy-tileserver Cortex Code skill installs the stack, from
  Cortex Code or directly from a shell, and the layer order

.... Generated with [Cortex Code](https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code)

Co-Authored-By: Cortex Code <noreply@snowflake.com>
- install_tileserver.sh now ends with a clear readiness banner: the public app
  URL, numbered next steps (sign-in, Web UI Inspect Tile Source for arms 1/2, raw
  tile endpoints, arm-3 H3 export + viewer), and a teardown/billing reminder.
  Handles the endpoint-not-yet-resolved case with the SHOW ENDPOINTS command.
- SKILL.md: add an "After a successful install" section so the skill runner relays
  the same URL and steps to the user.

.... Generated with [Cortex Code](https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code)

Co-Authored-By: Cortex Code <noreply@snowflake.com>
@sfc-gh-ridasafdar sfc-gh-ridasafdar merged commit f2a0085 into main Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants