PyGEOS

0.14 · deprecated · verified Fri Apr 17

PyGEOS provides GEOS (Geometry Engine - Open Source) operations wrapped in NumPy ufuncs for vectorized geospatial operations. Its development has ceased, and its core functionality has been merged into Shapely starting with version 2.0. The last release is 0.14, and no further major releases are expected as users are encouraged to migrate to Shapely 2.x.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates creating basic geometry objects (points, polygon) and performing a vectorized spatial operation (intersects).

import pygeos

# Create a single point
point_a = pygeos.points(0, 0)

# Create an array of points
points_array = pygeos.points([
    [1, 1],
    [2, 2],
    [3, 3]
])

# Create a polygon
polygon = pygeos.polygons([(0, 0), (0, 4), (4, 4), (4, 0), (0, 0)])

# Perform a spatial operation: check intersection
intersects = pygeos.intersects(polygon, points_array)

print(f"Point A: {point_a}")
print(f"Points array: {points_array}")
print(f"Polygon: {polygon}")
print(f"Intersects with polygon: {intersects}") # Expected: [True, True, True]

view raw JSON →