kendrick-oppong/geoskills/computational-geometry-operations
Claude Code and agent skill by kendrick-oppong/geoskills
- community
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-operationsSKILL.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:
| Algorithm | Behavior | Use 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-Whyatt | Removes points based on the triangular area they contribute; generally produces visually smoother results than RDP at aggressive simplification levels | When 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 polygons | Simplifying 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
Related skills
geodata-qaqc— validating geometry before running these operationscrs-and-reprojection— the metric-CRS requirement for buffering/area mathvector-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
- SKILL.md in the repositoryCheckingskills/computational-geometry-operations/SKILL.md
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
[](https://verified-skill.com/skills/kendrick-oppong/geoskills/computational-geometry-operations)