Shapely

Python library for creating, manipulating, and analyzing 2D geometric objects (Point, LineString, Polygon) using the GEOS C engine with vectorized NumPy operations in v2.0.

Evaluated Mar 06, 2026 (0d ago) v2.0.x
Homepage ↗ Repo ↗ Developer Tools python geospatial geometry geos spatial-operations polygon point linestring numpy vectorized
⚙ Agent Friendliness
68
/ 100
Can an agent use this?
🔒 Security
88
/ 100
Is it safe for agents?
⚡ Reliability
79
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
87
Error Messages
80
Auth Simplicity
100
Rate Limits
100

🔒 Security

TLS Enforcement
90
Auth Strength
90
Scope Granularity
85
Dep. Hygiene
84
Secret Handling
90

No network layer; GEOS C library is well-audited; malformed geometry inputs can cause GEOS crashes in rare cases — validate inputs from untrusted sources

⚡ Reliability

Uptime/SLA
80
Version Stability
82
Breaking Changes
75
Error Recovery
80
AF Security Reliability

Best When

You need fast, reliable 2D geometric operations in Python and are working with in-memory geometry objects rather than files.

Avoid When

You need to read/write spatial files, handle CRS projections, or perform 3D geometric analysis.

Use Cases

  • Computing intersections, unions, and differences between geographic polygons
  • Testing whether points fall within polygon boundaries for spatial containment queries
  • Buffering geometries to create distance-based zones around features
  • Simplifying complex polygon boundaries to reduce vertex count for performance
  • Vectorized batch operations on large arrays of geometries using NumPy integration (v2.0+)

Not For

  • Reading or writing geospatial file formats like GeoJSON, Shapefile, or GeoPackage (use Fiona or GeoPandas)
  • Coordinate reference system (CRS) transformations or projections (use pyproj or GeoPandas)
  • 3D geometry operations — Shapely is strictly 2D (Z coordinates are stored but ignored in calculations)

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

Local Python library — no authentication required

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

BSD 3-Clause license. Completely free for commercial and open-source use. GEOS underlying library is LGPL.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Not documented

Known Gotchas

  • Shapely 2.0 introduced breaking API changes from 1.x — geometry constructors and many functions moved; agents using legacy tutorials will encounter AttributeError
  • Coordinate order is (x, y) i.e., (longitude, latitude) — agents using (lat, lon) order will produce geometrically incorrect results silently
  • Invalid geometries (self-intersecting polygons) cause operations to return empty or None results without always raising an exception — always validate with is_valid
  • Z coordinates are accepted but ignored in all 2D calculations — agents assuming 3D distance calculations will get wrong answers
  • The shapely.ops module was restructured in 2.0; imports like from shapely.ops import unary_union still work but shapely.unary_union is now preferred

Alternatives

Full Evaluation Report

Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for Shapely.

$99

Scores are editorial opinions as of 2026-03-06.

5208
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered