Repository navigation
v0.12.0 puts the POI and zonal view generators behind one interface, reworks how TifProcessor handles files and reprojection, and adds five new data sources, with Python 3.11 now the minimum.
Upgrade notes / breaking changes
-
Python 3.11 or newer is required (#69). Python 3.10 reached end of life on 2026-10-01. pip keeps 3.10 users on v0.11.x; to be explicit, pin
giga-spatial<0.12. -
giga-spatial[roads]now needsosmnx>=2.0.6(#69).OSMRoadsHandlernow excludesrest_areaandservicesways, matchingOSMRoadsFetcherand osmnx 2.0.6, so road networks stored by older builds are rebuilt once on their next load. -
build_distance_graphis removed (deprecated in v0.11.1) (#70). UseSpatialNetwork.from_pointsorSpatialNetwork.from_point_setsinstead. The remaining deprecation warnings now name v0.13 for removal. -
MercatorTilesreads 2-tuples as(lon, lat).get_quadkeys_from_points,from_pointsandfrom_spatialpreviously swapped tuple coordinates. If you passed(lat, lon)tuples to work around it, switch to(lon, lat), the same order as ShapelyPoints,H3HexagonsandS2Cells. -
S2Cells.to_geodataframeskipped cells. Cells that fail conversion are now dropped from every column together (this used to raise a length-mismatchValueError), and a warning logs how many were skipped. -
One return contract for
map_*methods (#55). Everymap_*method onPoiViewGeneratorandZonalViewGeneratornow updates and returnsself.view(apd.DataFrame). Empty data fills the target columns with0,FalseorNaNinstead of returningNone, adictor aGeoDataFrame. Reusing an existing output column raisesValueErrorunless you passoverwrite=True.# Before counts = zones.map_points(schools) # returned dict zones.add_variable_to_view(counts, "schools") bldg_gdf = zones.map_ms_buildings() # returned GeoDataFrame # After view = zones.map_points(schools, output_column="schools") # updates & returns zones.view view = zones.map_ms_buildings() # updates & returns zones.view (0/NaN if empty) bldg_gdf = zones.to_geodataframe() # attach geometries when needed
map_rwinow uses an explicitoutput_columnas given (the default isrwi_{aggregation}), and it raisesValueErrorwhen a country has no RWI data. -
TifProcessor.reproject_tois removed (#62). Useto_crs(...).save_to_file(path), or keep the processor thatto_crs(...)returns. -
Merging rasters in different CRSs now raises
ValueErrorwhen notarget_crsis given. It used to only log a warning and produce a wrong mosaic. Passtarget_crsto migrate. Mean merges of integer rasters now return a float dtype (#59). -
Deprecated:
PoiViewGeneratorConfigandZonalViewGeneratorConfig(passensure_available=to the constructor instead),dataset_yearanddataset_resolutiononmap_built_sandmap_smod(useyearandresolution), the bare-name andoutput_format=forms ofsave_view(pass a file path with an extension), andGeometryBasedZonalViewGenerator(useZonalViewGenerator).
View generators: one interface
- The new internal
BaseViewGeneratornow underlies bothPoiViewGeneratorandZonalViewGenerator, somap_points,map_polygons,map_rasters, the datasetmap_*methods,add_variable_to_view,chain_operationsandvalidate_data_coveragework the same way on both (#55). - The zonal hierarchy collapses into one concrete
ZonalViewGenerator, andGeometryBasedZonalViewGeneratoris now a deprecated thin subclass (#54). - Dataset
map_*methods andfind_nearest_buildingsaccept an optionalhandler=, so you can pass a pre-built handler (#53). ensure_availableis now a constructor argument on every generator and can be overridden per call.overwrite=is available on allmap_*methods.save_view(path)takes a file path, delegates the format towrite_dataset, and attaches geometries for.geojson,.gpkgand.shp.aggregate_polygons_to_zonescan count polygons natively (value_columns=Nonewithaggregation="count") with theintersects,withinandfractionalpredicates.
TifProcessor architecture
- New
TifProcessor.to_crs(target_crs, resampling_method=None, resolution=None)returns a new, independent processor in the target CRS, the same wayclip_to_geometryreturns a clipped one (#62). - A processor over a file in a non-local data store such as ADLS downloads it once into a local working copy. It no longer reads the whole file into memory on every open, including in each batched-sampling worker.
- Temporary files have a single owner. Copies and pickled worker copies no longer delete the original's working files, and
cleanup()can be called safely more than once. Using a merged, reprojected or clipped processor aftercleanup()raises a clearFileNotFoundError. - Clips and
to_crsresults keep their parent's lineage (dataset_paths,is_merged,source_count) and settings.map_rastersmerges of a processor list inherit the first processor's settings. - CRSs are compared semantically, so an EPSG code and the equivalent WKT count as the same CRS.
New data sources
- STORM tropical cyclone wind speeds:
STORMWindSpeedFetcherreturns a global fixed-return-period wind-speed map (10 km, m/s) as aTifProcessor, for the present-day baseline or a 2050 RCP8.5 model. CC0 (#64). - GEM Global Seismic Hazard Map:
GSHMHandlerdownloads the GEM GSHM v2026.1 peak ground acceleration points (10% exceedance in 50 years) and loads them for a geometry. CC BY-NC-SA 4.0 (#63). - MERIT Hydro:
merit_hydrois now in the Earth Engine registry, with 3 arc-second global hydrography (elevation, flow direction, river width, upstream area, HAND and more) (#48). - Global Power Plant Database:
GlobalPowerPlantHandlerloads a WRI release (1.3.0 by default, with 1.1.0 and 1.2.0 also accepted) for a source (#60). - PeeringDB facilities:
PeeringDBFetcher.fetch_facilitiesreturns facilities as a GeoDataFrame in EPSG:4326, filtered bycountryorextent(#61).
Fixes
- Security: API tokens are now redacted from URLs, logs, exceptions and reprs in the Mapbox, Maxar, GeoRepo, REST client, HealthSites, PeeringDB, Giga API and OpenCellID code, through the new shared
redact_urlandsanitize_exceptionhelpers. Requests still send the real credentials (#66). - Grids: country H3, S2 and Mercator grids now cover every part of a multi-part country, including islands.
H3Hexagons.from_geometryandS2Cells.from_geometryhandle a singlePoint, andMercatorTiles.from_spatialdispatches points correctly and raises a clearTypeErrorfor unsupported input. - Geo processing:
annotate_with_admin_regions,map_points_within_polygonsand polygon counting no longer modify the inputs you pass in. Admin ties on shared borders are now broken deterministically, and the UTM CRS fallback is consistent across helpers. - Generators: custom
poi_id_columnandzone_idcolumns are validated, coordinates are read from projected GeoDataFrames correctly,save_viewto GeoJSON and GeoPackage works,map_zonal_statsrenames the default column, grid generators accept a GeoDataFramesource, ahandlerpassed tomap_ms_buildingsis kept, and raster temp directories are cleaned up promptly. - Overture: the stale default release is gone. A failed "latest" lookup now raises an error asking for an explicit
release=, explicit releases are validated against the STAC catalog, andget_available_releases()is new (#52). - TifProcessor:
to_dataframe_chunkedworks on multi-band rasters, thesample_by_polygons_batchedmemory guard warns instead of crashing, sparseto_graphhandles rasters with no adjacent valid pixels,to_dataframeaccepts aband_nameslist in single mode, clips work onrgb,rgbaandmultiprocessors, and clipped processors over non-local data stores work inmap_rastersand batched sampling (#59, #62).
Docs
- The README and docs home have runnable quickstarts (building footprints for a country, and WorldPop aggregated to admin regions), and the list of covered sources now includes the new ones. Package metadata shares one description (#71).
- GEM seismic docs now use the Global Seismic Hazard Map name (#72).
pip install giga-spatial --upgradeDocs: https://unicef.github.io/giga-spatial/
Full changelog: https://github.com/unicef/giga-spatial/blob/main/CHANGELOG.md