kendrick-oppong/geoskills/crs-and-reprojection

Claude Code and agent skill by kendrick-oppong/geoskills

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when a task involves coordinate reference systems, EPSG codes, datum mismatches, unit confusion (degrees vs meters), "why are my points offset", axis-order bugs, or deciding whether/how to reproject vector or raster data.

Install

npx vskill@latest install kendrick-oppong/geoskills/crs-and-reprojection

SKILL.md

The same SKILL.md was published earlier as kendrick-oppong/geoskills/crs-and-reprojection.

CRS & Reprojection

When to use this skill

  • "My points are in the ocean / offset by a few hundred meters"
  • "What EPSG code should I use for X"
  • Any mention of proj4, pyproj, ST_Transform, .prj, WKT2, datum, or "axis order"
  • Merging two datasets that were "definitely in the same place" but don't align

Core concepts

CRS has three independent axes of confusion — check all three before touching code:

  1. Datum (WGS84 vs NAD83 vs ETRS89 v's local datum) — a few meters to tens of meters of drift if mismatched.
  2. Projection (geographic lat/lon vs projected meters) — mixing degrees and meters silently produces "wrong by 100x" bugs.
  3. Axis order — EPSG:4326 is officially (lat, lon), but GeoJSON, most web tooling, and PostGIS geometry input use (lon, lat). This is the single most common source of "flipped" data.

Default recommendations (principal-level defaults, not dogma):

Use caseCRSWhy
Storage / interchange (GeoJSON, APIs)EPSG:4326 (WGS84)Universal interop; required by GeoJSON spec
Web map tiles / displayEPSG:3857 (Web Mercator)What every web map engine renders in
Distance/area math, buffering, routingA local projected CRS (UTM zone, or a national grid)4326 degrees are not equal-distance; 3857 distorts area badly at high latitude
Global equal-area analysisEPSG:6933 or Equal EarthAvoids Mercator's polar area inflation
High-precision surveying/cadastralNational datum (e.g. EPSG:2193 NZTM, EPSG:27700 OSGB)Sub-meter accuracy requirements

Rule of thumb: never do distance, area, or buffer math directly on EPSG:4326 coordinates. Reproject to a metric CRS first, compute, then reproject back if needed for storage.

Checklist

  • [ ] Identify the CRS of every input independently — never assume; check .prj, WKT, or metadata
  • [ ] Confirm axis order matches what the library expects (GeoJSON = lon,lat; many GIS tools display lat,lon)
  • [ ] If datum differs (not just projection), use a full datum transform (pyproj.Transformer, PostGIS ST_Transform with correct SRID, not a naive re-tag)
  • [ ] Never just "relabel" an SRID on unprojected data — that moves the data without transforming it
  • [ ] For area/distance/buffer operations, reproject to an appropriate equal-area or equidistant projected CRS first
  • [ ] For a country/region-scale app, pick and hardcode one UTM zone or national grid rather than reprojecting per-request
  • [ ] Round-trip test: reproject A→B→A and confirm sub-millimeter drift only

Common pitfalls

  • Flipped coordinates: passing (lat, lon) where (lon, lat) is expected (or vice versa) — symptom is points in the wrong hemisphere or ocean. Fix: explicitly assert axis order at every system boundary (API in/out, DB read/write, frontend map init).
  • "It's close enough" datum skipping: NAD27→NAD83 or local datum→WGS84 differences look small on a low zoom map but break precision work (parcels, construction, autonomous navigation).
  • Buffering in degrees: ST_Buffer(geom, 0.01) on EPSG:4326 gives wildly different real-world distances near the poles vs the equator.
  • Web Mercator area math: computing "area" in EPSG:3857 units — Mercator area distortion grows without bound toward the poles.
  • Silent SRID = 0 / missing SRID: geometries inserted without an SRID behave inconsistently across PostGIS versions/functions.

Reference snippets

python
from pyproj import Transformer
transformer = Transformer.from_crs("EPSG:4326", "EPSG:32633", always_xy=True) # WGS84 -> UTM 33N
x, y = transformer.transform(lon, lat) # always_xy=True enforces (lon, lat) order
sql
-- PostGIS: reproject before area calc
SELECT ST_Area(ST_Transform(geom, 32633)) AS area_m2 FROM parcels;
javascript
// proj4js in a browser/Node context (e.g. Angular/Next.js frontend needing a non-Mercator CRS)
import proj4 from 'proj4';
proj4.defs('EPSG:32633', '+proj=utm +zone=33 +datum=WGS84 +units=m +no_defs');
const [x, y] = proj4('EPSG:4326', 'EPSG:32633', [lon, lat]);

Related skills

  • global-crs-selection — choosing a projection for world/continental-scale display
  • postgis-geospatial — SRID handling inside a database
  • geodata-qaqc — detecting CRS mismatches as part of intake validation

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/kendrick-oppong/geoskills/crs-and-reprojection/badge)](https://verified-skill.com/skills/kendrick-oppong/geoskills/crs-and-reprojection)

Something wrong with this skill or its page? Tell us.