A spatiotemporal index over geospatial files. Ask “what overlaps this AOI between these dates?” and get an answer in milliseconds, without opening a single file.
Where it comes from¶
You have thousands of GeoTIFFs, NetCDFs, Zarrs or shapefiles on local disk, in a bucket or behind a STAC API. You want the few that touch one area in one season, and opening every file to find out takes hours.
geocatalog indexes each file once: its footprint, time interval, CRS and
path. Queries then touch only that index, and a loader opens only the
files that overlap. The import name is geocatalog; how it fits with the
other packages is on How the packages interlock.

Install¶
pip install geotoolz-catalog
pip install 'geotoolz-catalog[duckdb,stac]' # add extras as needed| Extra | Pulls in | Needed for |
|---|---|---|
| (base) | InMemory backend, raster + vector builders and loaders, GeoParquet round-trip | Local files, under 10⁵ rows |
[duckdb] | DuckDBGeoCatalog, streaming builds (engine="duckdb") | 10⁶+ rows, remote artifacts |
[streaming] | Same as [duckdb] (the streaming writer itself is pyarrow) | Streaming builds |
[xarray-raster] | build_xarray_catalog, load_xarray | NetCDF / Zarr |
[stac] | STACSource, from_stac_search, from_stac_items, to_stac_collection | STAC API ingestion |
[earthaccess] / [gee] | EarthAccessSource / GEESource | NASA Earthdata / Earth Engine discovery |
[sources-all] | [earthaccess] + [stac] + [gee] | Every source adapter |
[cloud] | geotoolz-cloud with its [fsspec] extra | s3:// gs:// az:// https:// hf:// reads in builders and loaders (geocloud.fs) and stage() of remote URIs (geocloud.files), on one client pool and credential registry |
[patch] | geotoolz-patcher, and georeader for the lazy readers | geocatalog.patch.field_for |
[full] | All of the above | One-shot install |
Quickstart¶
Index three scenes, ask which ones touch a 5 km box in June, and load only those onto the box’s grid:
import tempfile
from pathlib import Path
import numpy as np
import pandas as pd
import rasterio
from geoarray import GeoArray
from rasterio.transform import from_origin
import geocatalog as gc
from geocatalog.backends import InMemoryGeoCatalog
# Three 4-band scenes, 6 km × 6 km at 10 m in UTM 11N, dated by file name.
root: Path = Path(tempfile.mkdtemp())
for date in ("20240605", "20240612", "20240801"):
with rasterio.open(
root / f"s2_{date}.tif", "w", driver="GTiff", width=600, height=600, count=4,
dtype="uint16", crs="EPSG:32611", transform=from_origin(501_000, 4_308_000, 10, 10),
) as dst:
dst.write(np.full((4, 600, 600), 1_000, dtype=np.uint16)) # (4, 600, 600) uint16
catalog: InMemoryGeoCatalog = gc.build.build_raster_catalog(
sorted(root.glob("*.tif")),
filename_regex=r"s2_(?P<date>\d{8})\.tif", # time from the file name
crs="EPSG:32611",
) # 3 rows · footprints, times, paths
aoi: gc.GeoSlice = gc.GeoSlice(
bounds=(502_000, 4_302_000, 507_000, 4_307_000), # 5 km × 5 km, UTM 11N metres
interval=pd.Interval(pd.Timestamp("2024-06-01"), pd.Timestamp("2024-06-30"), closed="both"),
resolution=(10.0, 10.0), # → grid (H, W) = (500, 500)
crs="EPSG:32611",
)
hits: InMemoryGeoCatalog = catalog.query(aoi) # 2 rows — no file opened
scene: GeoArray = gc.load.load_raster(hits, aoi, band_indexes=[1, 2, 3]) # (3, 500, 500) uint16 on aoi.gridhits is itself a catalog, so queries chain and set-combine. Only the
loader opens files, and only the ones that overlap; it returns a
geoarray.GeoArray on the slice grid (scene.grid == aoi.grid) with its
nodata in fill_value. The
Quickstart adds STAC discovery and saving the catalog.
What’s inside¶
The root holds GeoCatalog, GeoSlice, open_catalog and
query / intersect / union. Every other name has one home, named for
the step it serves:
| Step | Namespace | Main names | Guide |
|---|---|---|---|
| discover | geocatalog.sources | STACSource, CMRSource, EarthAccessSource, GEESource, from_stac_search | STAC ingestion |
| index | geocatalog.build | build_raster_catalog, build_xarray_catalog, build_vector_catalog, build_state_catalog, append_files | Large archives |
| hold | geocatalog.backends | InMemoryGeoCatalog, DuckDBGeoCatalog, CatalogRow, the errors | Backends |
| join | geocatalog.matchup | matchup, MatchupRow, the spatial and temporal strategies | Match sources |
| read | geocatalog.load | load_raster, aload_raster, load_raster_timeseries, load_xarray, load_vector | Load API |
| model states | geocatalog.states | load_states, forecasts, ensemble_at, forecast_chain, lead_window, at_time, latest_analysis, CF_NAMES | Model states |
| save / share | geocatalog.storage | to_geoparquet, from_geoparquet, StreamingParquetWriter, to_stac_collection, CatalogBundle | Provenance bundles |
| stage | geocatalog.staging | stage (into a geocloud.cache.LocalCache) | Staging |
| patch | geocatalog.patch | field_for, CatalogDomain | Catalog → patcher |
| grids | geocatalog.grid | slice_to_window, is_grid_aligned, count_steps | Grid alignment |
| helpers | geocatalog.utils | parse_uri, retry_transient_io, UTC time helpers | Utils API |
Next steps¶
Concepts:
GeoSlice, the row schema, the two backends, set algebra and provenance.Quickstart: local files, then Sentinel-2 from STAC.
How-tos: STAC ingestion, staging, large archives, matching sources, catalog → patcher, grid alignment.
Lake Tahoe tutorial: discover Sentinel-2 on Planetary Computer, filter, load, then an NDVI pipeline with geotoolz.
API reference, CLI and the parameter vocabulary.