Shapely
v2.1 — 2026 Edition. Manipulation and analysis of geometric objects in the Cartesian plane. Learn about the spatial data model, constructive operations, predicates, set operations, and spatial indexing with Shapely 2.1 (2026).
Episodes
The Spatial Data Model
3m 37sDive into the fundamental concepts of Shapely and how it models the world. You will learn the difference between points, curves, and surfaces, and how point-set theory underpins planar geometry.
Geometry Creation and Serialization
3m 51sDiscover how to efficiently build and transport geometries in Shapely. You will learn the difference between singular object creation and high-performance vectorized ufuncs, as well as WKT and GeoJSON serialization.
Measurement and Properties
3m 30sLearn how to extract critical measurements from your geometries. You will understand how to calculate area, length, and advanced distance metrics like the Hausdorff distance.
Spatial Predicates and the DE-9IM
3m 30sMaster the art of checking spatial relationships. You will learn how to use boolean predicates to determine exactly how two shapes interact, powered by the DE-9IM matrix.
Set-Theoretic Operations
3m 22sDiscover how to merge, cut, and slice geometries. You will learn how to use mathematical set operations like intersection, difference, and union to craft entirely new shapes.
Constructive Operations: Buffers and Hulls
3m 52sLearn how to synthetically generate new boundary shapes. You will explore buffering, creating safety zones, and wrapping scattered points using convex and concave hulls.
Advanced Constructive Operations
3m 42sTake your shape manipulation to the next level. You will learn how to clean up massive polygons using simplification, snap features together, and generate Voronoi diagrams.
High-Performance Spatial Indexing with STRtree
4m 00sUnlock lightning-fast spatial queries. You will learn how to use the Sort-Tile-Recursive (STR) tree to instantly filter massive spatial datasets and perform near-instant nearest neighbor searches.