/geospatial-software:gis-indexing-databases-tiling-and-renderingfrom geospatial-software
Covers spatial indexing (R-trees, quadtrees, geohashes), spatial databases (PostGIS), tiling schemes (vector vs raster tiles), and rendering (styling, generalization, label placement). Use when storing, querying, or drawing spatial data at scale.
Ships in geospatial-software. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Part 2 of 5 of the Geospatial Software reference (plugin
geospatial-software), covering §4–§7. Sibling skills:gis-coordinate-systems-data-models-and-formats(§0–§3),gis-routing-geocoding-and-positioning(§8–§10),gis-spatial-analysis-remote-sensing-and-privacy(§11–§14),gis-reference(§15–§20). Section numbers are shared across the set; a reference written as §N →skillpoints into that sibling skill.Currency: Geodesy and projection mathematics are settled. Two areas moved. See §16 →
gis-referencefor the open basemap landscape and the cloud-native format stack.
Scope. ⚠️ §1 →
gis-coordinate-systems-data-models-and-formatsis the most important section and the one most often skipped. Almost every serious geospatial bug is a coordinate reference system problem wearing a different hat.⚠️ GOTCHA boxes mark the errors that silently produce wrong answers — and this domain specializes in bugs that look plausible.
The three ideas that prevent most disasters:
- ⚠️ A coordinate is meaningless without its CRS. "40.7128, −74.0060" is not a location until you say which datum and which axis order. Data with an unknown CRS is not data (§1 →
gis-coordinate-systems-data-models-and-formats).- ⚠️ Every flat map lies. Projection to a plane necessarily distorts area, angle, distance, or shape — you choose which. Web Mercator, the default of the entire web, is unsuitable for area calculation and most analysis (§1.3 →
gis-coordinate-systems-data-models-and-formats).- ⚠️ The Earth is not a sphere, and for many purposes not even an ellipsoid. Haversine on a sphere is off by up to ~0.5%; the geoid differs from the ellipsoid by ±100 m vertically. Whether that matters is a requirements question you must actually ask (§1.1 →
gis-coordinate-systems-data-models-and-formats, §10.3 →gis-routing-geocoding-and-positioning).
⚠️ Spatial queries without an index are table scans, and the whole field exists to avoid that.
R-tree ⚠️ hierarchical bounding boxes; THE standard for vector data
(PostGIS GiST, SQLite, GeoPackage)
Quadtree recursive quadrant subdivision; rasters, tiles
k-d tree point data, nearest-neighbour
Grid / geohash ⚠️ base32 string; PREFIX = containment, which makes it work in
any plain key-value store
S2 (Google) ⚠️ sphere → cube → Hilbert curve. No projection distortion; excellent
for global spherical work
H3 (Uber) ⚠️ HEXAGONAL global grid. Uniform neighbour distance — better for
flow, aggregation and movement analysis
⚠️ GOTCHA — geohash has an edge problem people trip over. ⚠️ Two points a metre apart can have completely different prefixes if they straddle a cell boundary. Proximity search must check neighbouring cells, not just the shared prefix. S2 and H3 handle adjacency explicitly and are better for anything doing neighbourhood queries.
⚠️ And hexagons aren't a gimmick: a hexagon's six neighbours are all equidistant from its centre; a square's eight are not. That matters for anything modelling spread, flow or movement. The trade is that hexagons don't subdivide perfectly, so H3's hierarchy is approximate.
⚠️ The two-phase query pattern underlies essentially all spatial querying: filter by bounding box using the index (cheap), then refine with exact geometry (expensive). Getting this wrong — doing exact tests first — is a common performance bug.
PostGIS is the reference implementation and the default choice.
-- ⚠️ Always index, always use && or ST_DWithin to hit it
CREATE INDEX idx ON t USING GIST (geom);
ST_Intersects, ST_Contains, ST_Within, ST_DWithin -- ⚠️ these use the index
ST_Distance, ST_Area, ST_Length, ST_Buffer
ST_Transform(geom, 3857) -- ⚠️ reproject
ST_MakeValid(geom) -- §2
⚠️ GOTCHA —
geometryvsgeographyis the type decision that matters. ⚠️geometryis planar and fast; distances and areas are in the CRS's units, so using it with EPSG:4326 gives you answers in DEGREES, which are meaningless as distance.geographycomputes on the spheroid and returns metres, correctly, and is slower with fewer functions. ⚠️ The pragmatic pattern: storegeometryin a suitable projected CRS, or usegeographyfor global data where correctness beats speed, and cast where needed.ST_Distanceon 4326 geometry returning "0.0043" is the classic symptom.
⚠️ ST_DWithin beats ST_Distance(...) < x — the former uses the index, the latter
computes distance for every row first.
Others: SpatiaLite, DuckDB spatial (⚠️ increasingly the analytics choice, and
it reads GeoParquet directly), BigQuery GIS, Snowflake, Elasticsearch geo,
MongoDB 2dsphere, Apache Sedona for distributed work.
⚠️ Serve maps as small pre-cut squares, not one giant image.
Slippy map scheme: z/x/y, ⚠️ doubling resolution per zoom level, in Web Mercator
(§1.3 → gis-coordinate-systems-data-models-and-formats). Zoom 0 is one 256×256 tile of the world; zoom z has 4^z tiles.
⚠️ TMS flips the Y axis relative to XYZ/Google convention — a small, recurring source of
upside-down maps.
Raster vs vector tiles:
⚠️ Generation: tippecanoe (⚠️ the standard tool; it adaptively simplifies and drops features per zoom to keep tiles small — that behaviour is a feature and it will surprise you if you don't expect dropped features at low zoom), planetiler for planet-scale, Martin and tegola for dynamic serving from PostGIS. ⚠️ Overzooming lets you serve zoom 14 tiles up to zoom 20 by scaling client-side — which is why most vector basemaps stop generating at 14.
| Library | ⚠️ Character |
|---|---|
| MapLibre GL JS | ⚠️ The open fork of Mapbox GL JS. WebGL vector rendering; the default for new open work |
| Leaflet | ⚠️ Simple, tiny, huge plugin ecosystem. Raster-first |
| OpenLayers | ⚠️ Most feature-complete; handles projections properly — the pick when CRS matters |
| deck.gl | ⚠️ Large-scale data visualization; GPU layers |
| Cesium | 3D globe, terrain, time |
| Mapbox GL JS | Proprietary since v2 |
| QGIS | ⚠️ Desktop GIS; free, excellent, and the tool for actually looking at your data |
⚠️ Style specification (MapLibre/Mapbox style JSON) — declarative layers, sources, paint and layout properties, data-driven styling and expressions. ⚠️ This is the piece that makes vector tiles worth it: the same tiles support unlimited cartography.
⚠️ Performance: simplify by zoom, cluster points, use the GPU rather than DOM, avoid re-creating sources, and watch that "just add a GeoJSON layer" with 100k features will destroy your frame rate. Put it in a tile pipeline instead.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
spatial-indexing, postgis, geohash, vector-tiles, raster-tiles, map-rendering
npx claudepluginhub the-vibey-project/vibey --plugin geospatial-software5 skills in this plugin
/gis-coordinate-systems-data-models-and-formatsUse before writing any code that touches coordinates: the layered model of datums, ellipsoids and coordinate reference systems, the axis-order problem that silently swaps latitude and longitude, projections and what each one distorts, the vector and raster data models, and the file formats and their trade-offs. Includes the router for the whole geospatial-software reference./gis-referenceUse when correcting a geospatial misconception, checking what moved in the open basemap landscape and the cloud-native format stack (verified August 2026), looking up a precision, scale or accuracy figure, finding the books and tools, or needing a picker and a debugging checklist for coordinates that land in the wrong place. Companion to the other geospatial-software skills./gis-routing-geocoding-and-positioningUse when computing paths or resolving positions: routing over road networks including graph construction, cost models, turn restrictions and contraction hierarchies; geocoding and reverse geocoding with their accuracy and ambiguity problems; and GNSS and positioning covering how it works, the real accuracy you get rather than the advertised figure, why altitude is a trap, and the other positioning methods.Other plugins' skills for the same job