
Shapely Compute
Perform computational geometry operations with Shapely
What You Can Do
You can construct geometric objects (points, lines, polygons, multigeometries), execute boolean operations (intersection, union, difference), apply spatial predicates (contains, intersects, within), calculate measurements (area, length, distance, centroid), and transform geometries through translation, rotation, and scaling. This skill handles geometry validation, invalid geometry repair, and complex spatial analysis tasks.
Features
construct points, lines, polygons, multipoints, and multilinestrings with custom coordinates
compute intersection, union, difference, and symmetric difference between geometries
evaluate contains, intersects, within, touches, crosses, and overlaps relationships
calculate area, length, distance between geometries, and centroid positions
translate, rotate, scale, and buffer geometries with specified parameters
identify and fix invalid geometries, handle self-intersecting polygons
work with Well-Known Text format for geometry representation and interchange
compute minimal convex polygon enclosing a geometry
Example Output
Create a polygon and measure its area:
Input: create polygon --coords "0,0 1,0 1,1 0,1"
Output: Polygon created with 4 vertices
Area: 1.0 square units
Centroid: (0.5, 0.5)
Check spatial relationship:
Input: pred contains --g1 "POLYGON((0,0 10,0 10,10 0,10))" --g2 "POINT(5 5)"
Output: True — the point (5, 5) is contained within the polygon
Calculate distance between geometries:
Input: distance --g1 "POINT(0 0)" --g2 "POINT(3 4)"
Output: Distance: 5.0 units (Euclidean distance)
What's Included
- SKILL.md: Complete reference guide with command syntax and quick reference table
- Shapely command library: Structured commands for geometry creation, operations, predicates, and measurements
- WKT format templates: Standard Well-Known Text examples for all geometry types
- Transformation workflows: Step-by-step geometry manipulation patterns (translate, rotate, scale, buffer)
- Validation checklist: Geometry validation procedures and common geometry issues with fixes
Who It's For
- GIS analysts and geospatial engineers working with vector geometry data
- Civil and environmental engineers designing and analyzing spatial layouts
- Data scientists building location-based analytics and spatial models
- Urban planners evaluating site boundaries, overlays, and spatial relationships
- Software engineers implementing geometric algorithms and spatial indexing
Best For
- Calculating polygon areas, perimeters, and centroids for spatial analysis
- Finding intersections and overlaps between geographic regions or geometric shapes
- Validating complex geometry datasets before processing or visualization
- Performing distance calculations and spatial relationship queries
- Transforming and manipulating geometric coordinates for coordinate system conversions







