kendrick-oppong/geoskills/computational-geometry-operations

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 implementing or debugging core geometry algorithms directly — line simplification (Douglas-Peucker/Visvalingam-Whyatt), polygon boolean operations (union/intersection/difference), buffering, convex/concave hulls, and geometry clipping. Covers the algorithmic layer underneath GIS libraries.

Install

npx vskill@latest install kendrick-oppong/geoskills/computational-geometry-operations

SKILL.md

The same SKILL.md was published earlier as kendrick-oppong/geoskills/computational-geometry-operations.

Computational Geometry Operations

When to use this skill

  • Implementing or tuning simplification for display-at-zoom-level use cases
  • Boolean operations (union, intersection, difference) producing unexpected results
  • Buffer operations creating self-intersecting or malformed output
  • "Why did clipping this polygon to a bbox produce a broken shape"

Core algorithms and when to use which

Line/polygon simplification:

AlgorithmBehaviorUse when
Douglas-Peucker (RDP)Removes points based on perpendicular distance from a chord; fast, widely implemented (ST_Simplify, Shapely .simplify(), mapshaper)General-purpose simplification for display at a given zoom/tolerance
Visvalingam-WhyattRemoves points based on the triangular area they contribute; generally produces visually smoother results than RDP at aggressive simplification levelsWhen RDP output looks "spiky" or loses characteristic shape at high simplification ratios
Topology-preserving simplification (ST_SimplifyPreserveTopology, mapshaper -simplify)Avoids creating self-intersections or breaking shared-boundary topology between adjacent polygonsSimplifying adjacent/shared-boundary features (administrative boundaries, parcels) where naive per-feature simplification would create gaps/overlaps between neighbors

Boolean operations (union/intersection/difference): implemented via the OGC Simple Features model (JTS/GEOS under the hood — the engine behind Shapely, PostGIS, and most JS geometry libraries via WASM ports). Correctness depends heavily on valid input geometry (see geodata-qaqc) — boolean ops on invalid geometry are a leading cause of GEOS/JTS "TopologyException" errors.

Buffering: expands/contracts a geometry by a distance. Must be done in a metric CRS (never degrees — see crs-and-reprojection). Buffering concave polygons or lines with sharp angles can produce self-intersecting output at certain join/cap style settings; adjust join style (round/mitre/bevel) and mitre limit rather than accepting malformed output.

Convex vs concave (alpha shape) hulls: convex hull is fast and always valid but overestimates area for non-convex point clusters; concave/alpha-shape hulls better represent the actual point distribution's shape but require tuning an alpha parameter and are more expensive to compute.

Checklist

  • [ ] Is input geometry validated (ST_IsValid/.is_valid) before running boolean operations — invalid input is the most common cause of GEOS "TopologyException"/similar errors
  • [ ] Are buffer/simplification/area operations performed in a metric (projected) CRS, not raw degrees?
  • [ ] Is topology-preserving simplification used (not naive per-feature simplification) when simplifying a set of features that share boundaries?
  • [ ] Is the simplification tolerance tied to the actual display zoom level / pixel size, rather than a single global tolerance applied at all zooms?
  • [ ] For buffering, is join/cap/mitre style considered when the output looks malformed at sharp angles, rather than just increasing segment count blindly?
  • [ ] Is a convex hull being used where a concave/alpha-shape hull would better represent a genuinely non-convex point distribution (and vice versa — don't over-engineer with alpha shapes when a convex hull is sufficient)?
  • [ ] Are results spot-checked for degenerate output (zero-area polygons, collapsed lines) after simplification/buffering at aggressive tolerances?

Common pitfalls

  • Boolean operations on invalid input geometry: produces GEOS/JTS exceptions or silently wrong results — always validate/repair first (geodata-qaqc).
  • Simplifying adjacent polygons independently: creates gaps or slivers between features that used to share an exact boundary — use topology-preserving simplification for anything with shared edges.
  • A single global simplification tolerance for all zoom levels: either over-simplifies at high zoom (visible faceting) or under-simplifies at low zoom (performance cost, visual clutter) — tie tolerance to zoom/pixel size.
  • Buffering in degrees: produces wildly inconsistent real-world buffer distances depending on latitude — always reproject to a metric CRS first.
  • Ignoring buffer join style on sharp concave angles: default round joins can produce unexpectedly bulging or self-intersecting output on complex line geometry — mitre/bevel styles with an appropriate limit often behave better.

Reference snippets

sql
-- Topology-preserving simplification for shared-boundary features
SELECT ST_SimplifyPreserveTopology(geom, 10) FROM parcels; -- tolerance in geom's CRS units
-- Buffer with explicit join style
SELECT ST_Buffer(geom, 50, 'join=mitre mitre_limit=2.0') FROM roads;
python
from shapely.validation import make_valid
geom = make_valid(possibly_invalid_geom) # repair before boolean ops
result = geom_a.intersection(geom_b)

Related skills

  • geodata-qaqc — validating geometry before running these operations
  • crs-and-reprojection — the metric-CRS requirement for buffering/area math
  • vector-tile-pipeline — where zoom-dependent simplification is applied at scale

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/computational-geometry-operations/badge)](https://verified-skill.com/skills/kendrick-oppong/geoskills/computational-geometry-operations)

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