overturemaps is also a Python library. Import directly from overturemaps to query Overture data without using the CLI.
record_batch_reader returns a pyarrow.RecordBatchReader. This is the lowest-level entry point and works with Arrow-compatible tooling.
from overturemaps import record_batch_reader
bbox = (-71.068, 42.353, -71.058, 42.363)
reader = record_batch_reader("building", bbox=bbox)
if reader is not None:
table = reader.read_all()
print(table.schema)geodataframe loads data into a geopandas.GeoDataFrame.
Install optional dependencies with either pip install overturemaps[geopandas] or pip install geopandas.
from overturemaps import geodataframe
bbox = (-71.068, 42.353, -71.058, 42.363)
gdf = geodataframe("building", bbox=bbox)
print(gdf.head())When you pass a bbox, record_batch_reader, geodataframe and overturemaps.core.count_rows use the release's STAC index to read only the files that intersect it. The index is downloaded once per release and reused by later queries in the same process. If its download is rate limited (HTTP 429) or hits a server error (5xx), it's retried with backoff.
If the index still can't be read, or lists no files for the type, the query issues a StacIndexWarning and falls back to scanning every file of the type. Results are the same, but the scan can take several minutes. To fail instead:
import warnings
from overturemaps.core import StacIndexWarning
warnings.simplefilter("error", StacIndexWarning)Pass stac=False to skip the index and scan every file.
Use get_writer and copy from overturemaps.writers to write data to GeoJSON, GeoJSONSeq, or GeoParquet without using the CLI.
from overturemaps import record_batch_reader
from overturemaps.writers import copy, get_writer
bbox = (-71.068, 42.353, -71.058, 42.363)
reader = record_batch_reader("building", bbox=bbox)
with get_writer("geojson", "boston.geojson", schema=reader.schema) as writer:
copy(reader, writer)Supported format strings: geojson, geojsonseq, geoparquet.