GeoLattice
GeoLattice is a Python library for geospatial analysis that brings vector and raster processing, spatial analysis, spatial statistics, geostatistics, spatial causal inference, spatial databases, web and cloud GIS, and remote sensing together under one import, geolattice.
It is built on GDAL, NumPy, SciPy, pandas, GeoPandas, Shapely and xarray, so its functions read and return the objects these libraries already use: GeoDataFrames, xarray DataArrays and Datasets, NumPy arrays and GDAL-readable files. Compute-heavy parts of the library run on the CPU by default and on a GPU (CuPy, PyTorch or JAX) when one is available, and geolattice.distributed runs vector and raster work on all CPU cores, a Dask cluster or Spark. Installing GeoLattice installs all of its dependencies (listed in requirements.txt); only GPU, cluster and Spark extras are added by name.
GeoLattice comes with a set of tutorials: 372 Jupyter notebooks in nine chapters that explain each method, work through examples on real data and use the sample data in Data/.
GeoLattice was called PyGIS until version 0.3.49. See Moving from PyGIS if you have code or an environment that uses the old name.
What GeoLattice covers
| Area |
Import |
What it does |
| Coordinate reference systems |
geolattice.crs |
Search EPSG and ESRI codes, define custom projections, choose datum transformations |
| Vector data |
geolattice.vector |
Read and write desktop and cloud-native formats (GeoPackage, Shapefile, GeoParquet, FlatGeobuf), geoprocessing (clip, buffer, dissolve, overlay), geometry tools and attribute tables |
| Raster data |
geolattice.raster |
Read, write and reproject GDAL rasters, raster algebra, clip, mosaic, reclassify, zonal statistics, polygonize, proximity and contours |
| Spatial analysis |
geolattice.spatial_analysis |
Terrain analysis, surface hydrology, multi-criteria suitability (weighted and fuzzy overlay), multidimensional rasters (NetCDF, Zarr), network analysis, segregation analysis and vector analysis |
| Spatial causal inference |
geolattice.spatial_analysis.spatialcausal |
Interference and spillover effects, spatial confounding, spatial double machine learning, geographic regression discontinuity, spatial difference-in-differences, synthetic control and causal discovery |
| Spatial statistics |
geolattice.spatial_statistics |
Spatial weights, global and local autocorrelation (Moran, Geary, Getis-Ord), GWR and MGWR, point patterns, spatial regression, spatial sampling and Bayesian disease mapping |
| Geostatistics |
geolattice.geostatistics |
Variograms, the kriging family (simple, ordinary, universal, indicator, co-, Poisson, Bayesian, regression and space-time kriging), sequential and multiple-point simulation, with GPU and JAX backends |
| Spatial databases |
geolattice.geolatticedb |
One API for PostGIS, SpatiaLite, GeoPackage and DuckDB spatial: loading, spatial SQL, joins, nearest neighbours, PostGIS raster, pgRouting and vector tiles |
| Web and cloud GIS |
geolattice.web |
Cloud-Optimized GeoTIFF, GeoParquet, PMTiles, XYZ tiles and an OGC API Features server, with reading from S3, Google Cloud Storage, Azure and HTTP |
| Remote sensing |
geolattice.rsense |
Data access (STAC, Earth Engine, ASF, Copernicus), optical indices and composites, SAR, InSAR, NISAR, lidar, hyperspectral imaging, UAV, time series, fusion, texture, super-resolution, classification, deep learning, foundation models (Prithvi, Clay, DOFA, TerraMind, AlphaEarth and 40 others), surface energy balance evapotranspiration (SEBAL, METRIC, SSEBop, S-SEBI, PT-JPL, TSEB), soil moisture physics (pedotransfer functions, Dobson and Mironov dielectric models, the tau-omega model and its inversion) and explainable AI |
| Visualization |
geolattice.viz |
Static maps, choropleths, raster displays and interactive Folium maps |
| Distributed and GPU computing |
geolattice.distributed |
One API for chunked raster processing, partitioned vector joins, raster-vector operations, spatial statistics, clustering, networks, hydrology and machine learning on all CPU cores, a Dask cluster (local, multi-GPU, SLURM, PBS, Kubernetes), Spark with Apache Sedona, or CUDA GPUs |
Every subpackage is available after import geolattice (for example geolattice.raster.open_raster or geolattice.geostatistics.Variogram) and loads on first use, so import geolattice stays fast.
Installation
GeoLattice needs Python 3.10 or newer (tested on 3.11 and 3.14; its dependencies need 3.10, for example libpysal 4.10). GDAL and PROJ must be installed first, with Python GDAL bindings that match the GDAL library; install them with conda or your system package manager.
Installing GeoLattice installs every runtime dependency listed in requirements.txt, whether you install from PyPI, the wheel or the sdist (pip install dist/geolattice-0.3.49-cp314-cp314-linux_x86_64.whl or pip install dist/geolattice-0.3.49.tar.gz). That list is the conflict-free set that installation option 6 (geolattice[all]) resolves to: about 80 packages, including PyTorch. pip install -r requirements.txt installs the same set without GeoLattice itself.
Installation options
The option names below still work, and existing install commands keep working, but a plain install already includes all of them. Each option includes everything in the one above it.
| Option |
Install |
Adds |
| 1. Core |
geolattice[core] |
Vector and raster I/O including GeoParquet, CRS tools, maps and plots (rasterio, fiona, GeoPandas, pyarrow, matplotlib, folium, contextily, plotly) |
| 2. Spatial analysis |
geolattice[analysis] |
Terrain and hydrology, suitability, multidimensional rasters, network and segregation analysis (xarray, netCDF4, zarr, dask, networkx, OSMnx, libpysal, WhiteboxTools) |
| 3. Spatial statistics |
geolattice[statistics] |
ESDA, spatial weights, GWR, point patterns, spatial regression, and spatial causal inference (scikit-learn, joblib) |
| 4. Geostatistics |
geolattice[geostats] |
Variograms, kriging and simulation, with plotting helpers |
| 5. Remote sensing |
geolattice[remote-sensing] |
Optical, SAR, lidar, hyperspectral and UAV processing, STAC access, classification (rioxarray, scikit-image, pystac-client, laspy, h5py, OpenCV, xgboost, leafmap) |
| 6. All |
geolattice[all] |
Everything above plus web and cloud GIS, spatial databases, deep learning (PyTorch, torchgeo), Bayesian models (PyMC), boosting, JAX kriging, Earth Engine and distributed computing (Dask, dask-geopandas) |
python3 -m pip install "geolattice[core]" # 1. core, vector, raster, CRS, visualization
python3 -m pip install "geolattice[analysis]" # 2. core + spatial analysis
python3 -m pip install "geolattice[statistics]" # 3. core + spatial analysis + spatial statistics
python3 -m pip install "geolattice[geostats]" # 4. ... + geostatistics
python3 -m pip install "geolattice[remote-sensing]" # 5. ... + remote sensing
python3 -m pip install "geolattice[all]" # 6. all
A few groups need special hardware or conflict with other packages, so neither a plain install nor geolattice[all] includes them; add them by name when you need them: compute, geostatistics-gpu and rsense-gpu (CUDA GPUs), geostatistics-h2o and geostatistics-tensorflow, rsense-uav-dl, rsense-vision and rsense-foundation (large vision and foundation models), rsense-biopar (needs pandas below 3), distributed-gpu (CUDA GPUs), distributed-hpc (SLURM, PBS and Kubernetes clusters), distributed-spark (Apache Sedona, needs Java 17 or newer) and dev. When a function needs a library that is not installed, its error message names the extra and the installation option that contains it.
For a GPU, see GPU support below.
Install from source
GeoLattice includes a small C extension, so building it needs a C compiler and NumPy. From the repository root:
python3 -m pip install build
python3 -m build
python3 -m pip install dist/geolattice-0.3.49-cp314-cp314-linux_x86_64.whl # installs every dependency in requirements.txt
python3 -m build writes an sdist and a wheel for the Python that ran it (cp314 above). For another Python version, build a wheel from the sdist with that Python: python3 -m pip wheel --no-deps -w dist dist/geolattice-0.3.49.tar.gz. For development, install in editable mode with python3 -m pip install -e ".[dev]".
The user guide lists the 65 individual extras the installation options are built from and explains how to fix the common GDAL import errors (libgdal.so not found, No module named '_gdal').
Moving from PyGIS
The package was renamed from PyGIS to GeoLattice. Existing code keeps working for now, but should move to the new names: