Skip to content

ramSeraph/indianopenmaps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

769 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A display server for the data hosted at the following repos:

Contains code for getting tiles from a big pmtiles file which has been split into multiple shards (to overcome hosting size limits).

Tools for splitting a big pmtiles into smaller ones is at pmtiles_mosaic.

See the list of data available at https://indianopenmaps.com/

A tool is available to filter the large .7z files in the repo based on another polygon shape or bounds and export them in other geospatial formats at iomaps

Architecture

The project has two main components: a Cloudflare Worker that serves tiles and web viewers, and a Python CLI tool (iomaps) for data extraction and filtering.

Worker (worker/)

A Hono-based Cloudflare Worker that serves vector and raster tiles from PMTiles archives and Cloud-Optimized GeoTIFFs (COGs), along with web-based map viewers.

Tile serving:

  • Serves vector tiles (protobuf) and raster tiles (webp/png) from PMTiles archives
  • Supports "mosaic" mode for large PMTiles files that have been split into multiple shards
  • Dynamically generates tiles from COGs with mask support, using @cf-wasm/photon for WebAssembly-based image processing
  • Provides TileJSON metadata endpoints for each source
  • Currently serves ~498 tile sources

STAC API:

  • Implements a STAC API for browsing COG collections (e.g. India Topographic Maps 50k)
  • Item indices are stored in geoparquet files and spatially indexed with flatbush

Web viewers (in worker/static/):

  • Vector tile viewer using MapLibre GL JS — layer selection, feature inspection, styling, 3D terrain, geocoding, download
  • Raster tile viewer for raster/COG data
  • STAC viewer using Leaflet for browsing STAC collections
  • COG viewer for on-demand COG visualization
  • No build step — browser-native ES modules with dependencies loaded from esm.sh

Other endpoints:

  • /api/routes — lists all available tile sources

Running locally:

cd worker
npm install
npm run dev  # http://localhost:8787

Python CLI — iomaps (python/)

A Python package (available on PyPI) providing CLI tools for working with the data.

Commands:

  • iomaps cli filter-7z — filter/clip GeoJSONL features from .7z archives by bounding box or polygon, and export to various formats (GeoJSON, Shapefile, FlatGeobuf, GeoPackage, Parquet, etc.)
  • iomaps cli extract — extract data from remote geoparquet sources with server-side bbox filtering (partition-aware for large datasets)
  • iomaps cli infer-schema — infer geometry types and property schemas from .7z archives
  • iomaps cli sources — list available remote data sources (with category filtering and fuzzy matching)
  • iomaps cli categories — list available data categories
  • iomaps ui — launch a PyQt5 GUI for data filtering

Example usage:

pip install iomaps
iomaps cli sources                    # list available sources
iomaps cli sources -c cadastral       # filter by category
iomaps cli extract -s buildings -o buildings.gpkg -b "77.5,12.9,77.7,13.1"
iomaps cli filter-7z -i data.7z -o output.geojsonl -b "min_lon,min_lat,max_lon,max_lat"

Utilities (utils/)

Helper scripts for release management and endpoint validation.

About

Indianopenmaps server

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors