GigaSpatial acquires published geospatial datasets into a data store you control, loads them for a source, and processes them. A generator maps a dataset onto points of interest or zones, and the result is a view: those places with attributes from the datasets attached. It started in UNICEF's Giga initiative.
Use it for humanitarian, development, connectivity, and climate analysis: map population, building footprints, wealth, and flood hazard onto grids (H3 hexagons, S2 cells, Mercator tiles), administrative boundaries, or custom geometries; estimate population and nearest buildings around points of interest (such as schools, clinics, or cell sites); combine WorldPop, building footprints, and OpenStreetMap into one country dataset in a few lines of Python; and route or connect places along OpenStreetMap road networks.
What it covers
- Handlers acquire datasets published as files, keep them in your data store, and load them for a country or geometry:
- Population and settlement: WorldPop (
WPPopulationHandler) and GHSL (GHSLDataHandlerforGHS_POP,GHS_BUILT_S,GHS_SMOD, building height, and volume) - Building footprints: Google-Microsoft combined buildings (
GoogleMSBuildingsHandler), Google Open Buildings (GoogleOpenBuildingsHandler), and Microsoft Global Buildings (MSBuildingsHandler) - OpenStreetMap road networks: country-scale road networks from Geofabrik extracts (
OSMRoadsHandler) - Socioeconomic and humanitarian: Meta Relative Wealth Index (
RWIHandler) and Humanitarian Data Exchange (HDXHandler) - Connectivity and infrastructure: Ookla Speedtest tiles (
OoklaSpeedtestHandler) and OpenCellID cell towers (OpenCellIDHandler) - Terrain and flood hazard: NASA SRTM elevation (
NasaSRTMHandler), Copernicus GloFAS river flood hazard (GlofasHandler), and WRI Aqueduct flood hazard (AqueductFloodHandler) - Administrative boundaries:
AdminBoundaries
- Population and settlement: WorldPop (
- Fetchers query datasets served by an API or database: OpenStreetMap places (
OSMLocationFetcher) and road networks (OSMRoadsFetcher), Giga schools (GigaSchoolLocationFetcher,GigaSchoolProfileFetcher,GigaSchoolMeasurementsFetcher,GigaCountriesFetcher), Healthsites.io (HealthSitesFetcher), Overture Maps amenities (OvertureAmenityFetcher), UNICEF SDG indicators (UnicefDataFetcher), M-Lab speed tests in BigQuery (MLabFetcher), and Google Earth Engine (GEEProfiler). - Generators map datasets onto points of interest (
PoiViewGenerator) or zones (H3ViewGenerator,S2ViewGenerator,MercatorViewGenerator,AdminBoundariesViewGenerator,GeometryBasedZonalViewGenerator) and return a view. - Processing provides raster (
TifProcessor) and vector tools for the stored files. - Road networks:
OSMRoadsFetcherfetches OpenStreetMap roads for a source,OSMRoadsHandlerbuilds them for whole countries from Geofabrik's extracts, andSpatialNetworkandConnectionPlannerjoin schools or other points to them, find shortest paths, and plan the roads that connect a set of points.
Files live in a data store: local disk (LocalDataStore), Azure Data Lake Storage (ADLSDataStore), Snowflake (SnowflakeDataStore), or Delta Sharing (DeltaSharingDataStore). Handlers only depend on the abstract DataStore, so other stores can be added by implementing it.
The full list of datasets is on the Datasets page.
Installation
GigaSpatial requires Python 3.10 or above.
pip install giga-spatial
To install every optional integration (Earth Engine, BigQuery, Azure, Snowflake, and others):
pip install "giga-spatial[all]"
The individual extras, such as roads for OpenStreetMap road networks, are listed on the Installation page.
Example
Map population and building footprints onto H3 hexagons
Map WorldPop population and Google-Microsoft building footprints onto H3 cells for Rwanda. The first run downloads the files into the data store, and later runs read the stored files.
from gigaspatial import H3ViewGenerator
zones = H3ViewGenerator(source="RWA", resolution=6)
zones.map_wp_pop(country="RWA")
view = zones.map_buildings(country="RWA")
print(view.head())
view is the H3 cells with population and building_count attached. The same pattern works with S2ViewGenerator, MercatorViewGenerator, and AdminBoundariesViewGenerator.
Estimate population around schools or points of interest
Sum WorldPop population within a 1 km radius around schools or clinics fetched from OpenStreetMap:
from gigaspatial import OSMLocationFetcher, PoiViewGenerator
schools = OSMLocationFetcher(country="RWA", location_types=["school"]).fetch_locations()
view = PoiViewGenerator(schools).map_wp_pop(country="RWA", map_radius_meters=1000)
print(view[["population"]].head())
See Combining datasets for a country and Population around points for more workflows.
How GigaSpatial compares to other tools
- Hand-built
geopandas,rasterio,rasterstats,pyrosm, andosmnxpipelines: GigaSpatial usesgeopandas,rasterio, andh3under the hood, and replaces custom per-dataset download scripts, tile stitching, CRS projection, and buffer or zonal loops with handlers, fetchers, and generators that run in a few lines of Python. - Grid libraries (
h3-py,h3ronpy,h3-toolkit):h3-pyindexes coordinates and geometries into H3 cell IDs.H3ViewGenerator,S2ViewGenerator,MercatorViewGenerator,AdminBoundariesViewGenerator, andGeometryBasedZonalViewGeneratorin GigaSpatial acquire published country datasets (WorldPop, GHSL, Google and Microsoft buildings, Relative Wealth Index) into your data store and map them directly onto H3 hexagons, S2 cells, Mercator tiles, administrative boundaries, or custom polygons. - Cloud catalogs and spatial engines (Google Earth Engine, Microsoft Planetary Computer, PostGIS, DuckDB, Apache Sedona): Cloud platforms and spatial databases run queries inside their own infrastructure. GigaSpatial downloads and caches published datasets into a data store you control (local disk, Azure Data Lake Storage, or Snowflake) and also provides optional
GEEProfiler(giga-spatial[gee]),BigQueryClient(giga-spatial[bq]), and DuckDB or Trino integrations when you want them.
Documentation
Why open source?
At Giga, we believe in the power of open-source technologies to accelerate progress and innovation. By keeping our tools and systems open, we:
- Encourage collaboration and contributions from a global community.
- Ensure transparency and trust in our methodologies.
- Empower others to adopt, adapt, and extend our tools to meet their needs.
Contributing
Contributions are welcome, from bug reports to new datasets. See the contribution guidelines to get started.
Everyone taking part is expected to follow the Code of Conduct.
Get in touch
- Report bugs and ask questions in GitHub Issues.
- Follow Giga on X and LinkedIn.
- Learn more about Giga at giga.global.
About Giga
Giga is a UNICEF-ITU initiative to connect every school to the Internet and every young person to information, opportunity and choice. Giga maps schools' Internet access in real time, creates models for innovative financing, and supports governments contracting for connectivity.
GigaSpatial is developed by Giga's applied science team at UNICEF.
Licensed under AGPL-3.0-or-later.
Metadata
Release files for giga-spatial 0.11.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| giga_spatial-0.11.0.tar.gz | 3.6 MB | Without provenance | Details for giga_spatial-0.11.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| giga_spatial-0.11.0-py3-none-any.whl | Python 3 | none | any | Details for giga_spatial-0.11.0-py3-none-any.whl |
Total release size: 4.1 MB
Release files / giga_spatial-0.11.0.tar.gz
| Download URL | giga_spatial-0.11.0.tar.gz |
|---|---|
| Size | 3.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cc15dc976eb04897bb46225c8b39ccc64a7276effe521427cd23b6409538c56f
|
|
BLAKE2b-256 checksum How to use checksums |
09d73d799ceec8d1e9b93e681cb993cc3e67be52af69f76d831d41588c113fb7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.11
|
Release files / giga_spatial-0.11.0-py3-none-any.whl
| Download URL | giga_spatial-0.11.0-py3-none-any.whl |
|---|---|
| Size | 467.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e35b13acd42bfb882be229ef28b13551686715142684ae7259ef48b216e7c754
|
|
BLAKE2b-256 checksum How to use checksums |
a1374e1f05c98a9382ee6dfd160b265070d0e929096576ab0ec0d4e4eb24be02
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.11
|
Security for giga-spatial 0.11.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.