{"id":51065295,"url":"https://github.com/urbanmorph/geodata","last_synced_at":"2026-06-23T06:01:20.735Z","repository":{"id":359009429,"uuid":"1243343514","full_name":"urbanmorph/geodata","owner":"urbanmorph","description":"Lightweight open-source visualiser for India admin boundaries — pick a layer, view, download parquet","archived":false,"fork":false,"pushed_at":"2026-06-18T17:30:03.000Z","size":3338,"stargazers_count":36,"open_issues_count":0,"forks_count":3,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-18T19:21:56.877Z","etag":null,"topics":["geospatial","gis","india","llm","maps","mcp","model-context-protocol","open-data","parquet","pmtiles"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/urbanmorph.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-19T08:56:33.000Z","updated_at":"2026-06-18T17:30:06.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/urbanmorph/geodata","commit_stats":null,"previous_names":["urbanmorph/geodata"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/urbanmorph/geodata","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urbanmorph%2Fgeodata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urbanmorph%2Fgeodata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urbanmorph%2Fgeodata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urbanmorph%2Fgeodata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/urbanmorph","download_url":"https://codeload.github.com/urbanmorph/geodata/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urbanmorph%2Fgeodata/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34677401,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["geospatial","gis","india","llm","maps","mcp","model-context-protocol","open-data","parquet","pmtiles"],"created_at":"2026-06-23T06:01:16.118Z","updated_at":"2026-06-23T06:01:20.722Z","avatar_url":"https://github.com/urbanmorph.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bharatlas\n\n[![ci](https://github.com/urbanmorph/geodata/actions/workflows/ci.yml/badge.svg)](https://github.com/urbanmorph/geodata/actions/workflows/ci.yml)\n[![license: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)\n[![v1.0](https://img.shields.io/badge/release-v1.0-brightgreen.svg)](https://github.com/urbanmorph/geodata/releases)\n[![uptime](https://img.shields.io/website?url=https%3A%2F%2Fbharatlas.com\u0026label=bharatlas.com)](https://bharatlas.com)\n[![Lighthouse: 98+](https://img.shields.io/badge/Lighthouse-98%2B-brightgreen?logo=lighthouse)](https://pagespeed.web.dev/analysis?url=https%3A%2F%2Fbharatlas.com)\n[![npm](https://img.shields.io/npm/v/bharatlas-mcp?label=MCP\u0026color=indigo)](https://npmjs.com/package/bharatlas-mcp)\n\nA visual catalog, REST API, MCP server, drag-drop verifier, and anonymous contribution flow for India's geo data. Admin boundaries from state to village, plus community-submitted layers under open licences.\n\n**Live**: https://bharatlas.com\n\n[![bharatlas — India's open atlas](https://bharatlas.com/og-default.png)](https://bharatlas.com)\n\n- **Catalog**: India national boundary (LGD-dissolved), plus state · district · subdistrict · block · village (LGD), cross-source alternates (SOI · Bhuvan · geoBoundaries · PMGSY per level, click \"also: ...\" on any card), city wards across Indian cities, electoral constituencies, wildlife, eco-zones, and 63k pincode polygons (bharatviz).\n- **Download**: whole layer as Parquet · PMTiles · GeoJSON · KML · Shapefile, direct from the card.\n- **Filter \u0026 slice**: dynamic facets / range / typeahead search per layer schema; export the slice in any format above.\n- **Preview**: drop GeoJSON · KML · KMZ · GPX · TCX · Parquet, render + validate, optional Publish.\n- **View** (`/view/\u003cid\u003e`): curated layer with per-layer OG card.\n- **Community view** (`/c/\u003cid\u003e`): community submission, edge-rendered HTML, 👍 useful vote, per-submission OG card.\n- **Embed** (`/embed/\u003cid\u003e`): iframe + PNG export from any map.\n- **API** (`/api/v1`): REST list, query, filter, group_by any layer; locate (point-in-polygon across all layers); nearby (tile-based spatial proximity).\n- **MCP** (`npx bharatlas-mcp`): 8 tools for LLMs: list, schema, query, locate, nearby, categories, submissions, downloads.\n\n## What's in this repo\n\n- **`web/`**: Vanilla TypeScript + Vite viewer + Cloudflare Pages Functions (`web/functions/`).\n- **`web/migrations/`**: D1 SQL migrations: submissions, tokens, ratings, votes, originals.\n- **`web/tests/`**: vitest unit tests for pure functions (validators, tokens, view rendering, votes).\n- **`scripts/fetch.sh`**: Pulls parquets + PMTiles from [yashveeeeeeer/india-geodata](https://github.com/yashveeeeeeer/india-geodata) releases.\n- **`scripts/extract_per_state.py`**: Slices pan-India parquets into per-state GeoJSON via DuckDB-spatial.\n- **`scripts/bake_whole_layer.py`**: Bakes whole-layer GeoJSON / KML / Shapefile per curated layer (parquet ≤ 100 MB).\n- **`scripts/upload_r2.sh`**: Mirrors `sources/` + `data/` to Cloudflare R2 via wrangler.\n- **`scripts/upload_baked.py`**: Pushes `data/baked/*` to R2 via boto3 (S3-compat fallback when wrangler is unavailable).\n- **`scripts/admin/cleanup_submission.sh`**: Delete community submissions by name pattern (R2 + D1).\n- **`mcp/`**: MCP server for LLMs ([npm](https://www.npmjs.com/package/bharatlas-mcp)). 8 tools: list, schema, query, locate, nearby, categories, submissions, downloads.\n- **`catalog.json`**: Curated-layer index used by the viewer. Single source of truth.\n- **[/about#caveats](https://bharatlas.com/about#caveats)**: Data caveats (cross-source drift, coverage gaps, precision).\n\nLarge data files (`sources/`, `data/`) are not in git — they live in R2. See `scripts/fetch.sh` to rebuild locally.\n\n## Stack\n\n- **Frontend**: Vanilla TypeScript, Vite, MapLibre GL JS, PMTiles, DuckDB-WASM (lazy)\n- **Static hosting**: Cloudflare Pages\n- **Edge functions**: Cloudflare Pages Functions (`web/functions/`), running REST API v1, submit, vote, sitemap, edge-rendered `/c/\u003cid\u003e`\n- **Parquet query**: [hyparquet](https://github.com/hyparam/hyparquet) (pure JS, runtime reads from R2)\n- **Spatial query**: PMTiles tile reads + MVT decode + ray-casting PIP / Haversine proximity\n- **MCP server**: [`bharatlas-mcp`](https://www.npmjs.com/package/bharatlas-mcp), 8 tools for Claude, GPT, Gemini, Cursor, etc.\n- **Storage**: Cloudflare R2 (open data, no egress)\n- **Submissions DB**: Cloudflare D1 (SQLite at the edge)\n- **Anti-abuse**: Cloudflare Turnstile + per-IP rate limits\n- **CI/CD**: GitHub Actions, running tests + build + auto-deploy on push to `main`\n\n## Develop\n\n```bash\n# clone + viewer-only dev (no submissions, no D1)\ngit clone git@github.com:urbanmorph/geodata.git\ncd geodata/web\nnpm install\nnpm run dev    # http://localhost:5173\nnpm test\n```\n\nFor the full submission flow (D1 + R2 + Turnstile + Pages Functions), read `wrangler.toml` + `.dev.vars.example`.\n\n## API in 30 seconds\n\nREST: `https://bharatlas.com/api/v1` — no API key, rate-limited per IP. Full docs at [bharatlas.com/docs](https://bharatlas.com/docs).\n\n```bash\n# list every catalog layer (curated + accepted community)\ncurl 'https://bharatlas.com/api/v1/layers'\n\n# inspect a layer's schema before querying\ncurl 'https://bharatlas.com/api/v1/layers/lgd_districts/schema'\n\n# filter + group: how many districts per state?\ncurl 'https://bharatlas.com/api/v1/layers/lgd_districts/query?group_by=stname'\n\n# point-in-polygon: every admin boundary at (lat, lng)\ncurl 'https://bharatlas.com/api/v1/locate?lat=12.9716\u0026lng=77.5946'\n\n# nearest features within a radius\ncurl 'https://bharatlas.com/api/v1/nearby?lat=12.9716\u0026lng=77.5946\u0026layer=nic_health\u0026radius_km=10'\n```\n\nMCP for LLMs (Claude, GPT, Gemini, Cursor): one-line install, 8 tools. Setup at [bharatlas.com/mcp](https://bharatlas.com/mcp).\n\n```bash\n# Claude Code\nclaude mcp add bharatlas npx bharatlas-mcp\n\n# Claude Desktop / other clients (claude_desktop_config.json)\n{ \"mcpServers\": { \"bharatlas\": { \"command\": \"npx\", \"args\": [\"bharatlas-mcp\"] } } }\n```\n\n## Contributing\n\n1. Branch off `main`: `git checkout -b feat/short-name`\n2. Write a test first if you're adding logic to `web/functions/lib/*`. Pure functions are tested via vitest in `web/tests/`.\n3. Make sure `npm test` and `npm run build` both pass.\n4. Open a PR against `main`. CI runs tests + build automatically.\n5. The maintainer reviews and merges. Merge to main = auto-deploy.\n\nCommit messages: short subject, body explains *why* not *what*. Examples in `git log`.\n\n## Security\n\nReport vulnerabilities to **sathya@urbanmorph.com** instead of opening a public issue. Acknowledgement within 72 hours.\n\n## Licence\n\nCode: [MIT](./LICENSE). Data: each layer carries its own open licence — see the per-card line on the [catalog](https://bharatlas.com/). Curated data is sourced under CC0-1.0 / CC-BY-4.0 / GODL-India depending on provider.\n\n## Use of data\n\nProvided as-is, no warranty. For legal/administrative use, go to the upstream source. Full disclaimers: [/about → Use of data](https://bharatlas.com/about#use-of-data).\n\n## Principles\n\nbharatlas is built on [People's Digital Goods and Infrastructure (PDGI)](https://pdgi.org/) principles. [PDGI.md](./PDGI.md) is a public, honest scorecard of how each one is implemented, and where we still fall short.\n\n## Credits\n\nData sources, in approximate order of catalog footprint:\n\n- [LGD](https://lgdirectory.gov.in/) — Local Government Directory; the authoritative admin code chain (state → village).\n- [SOI](https://surveyofindia.gov.in/) — Survey of India; admin alternatives.\n- [Bhuvan](https://bhuvan.nrsc.gov.in/) — NRSC/ISRO Bhuvan; admin alternatives, eco-sensitive zones.\n- [OpenCity](https://data.opencity.in/) / [Oorvani Foundation](https://oorvanifoundation.org/) — city-scale layers (ward / corporation / jurisdiction polygons for 20+ cities).\n- [DataMeet](https://github.com/datameet/Municipal_Spatial_Data) — community-curated municipal spatial data (ward boundaries for multiple cities).\n- [datta07/INDIAN-SHAPEFILES](https://github.com/datta07/INDIAN-SHAPEFILES) — metropolitan city ward shapefiles.\n- [ramSeraph/indianopenmaps](https://github.com/ramSeraph/indianopenmaps) — selectively republished layers (WRIS waterbodies, SLUSI watersheds + soil, VEDAS power infrastructure, PMGSY roads + habitations).\n- [CoRE Stack](https://core-stack.org/): republished water and agriculture layers, namely CGWB aquifers and groundwater extraction, WRIS canals, ICAR-NBSS agro-ecological zones, Planning Commission agro-climatic zones, and Wildlife Institute of India biogeographic zones.\n- [PMGSY](https://omms.nic.in/) — Pradhan Mantri Gram Sadak Yojana; rural blocks + roads.\n- [PM GatiShakti](https://gis.pmgatishakti.gov.in/) — wildlife sanctuaries + national parks.\n- [Bharatmaps](https://bharatmaps.gov.in/) (NIC) — eco-sensitive zones.\n- [bharatviz](https://bharatviz.org/) (Saket Choudhary, MIT) — India Post pincode boundary polygons (simplified).\n- [geoBoundaries](https://www.geoboundaries.org/) — independent cross-check.\n- [data.gov.in](https://data.gov.in/) — additional government open data.\n\nPipelines + patterns:\n\n- [yashveeeeeeer/india-geodata](https://github.com/yashveeeeeeer/india-geodata) — upstream Parquet + PMTiles re-publisher for LGD, SOI, Bhuvan, PMGSY, GatiShakti, Bharatmaps, CWC, NIC-Health and the India Flood Inventory.\n- [ramSeraph](https://github.com/ramSeraph) — architectural guidance on geoparquet for spatial queries ([issue #100](https://github.com/urbanmorph/geodata/issues/100)). Hilbert sort + flat bbox cols + density-aware row groups in our /api/v1/nearby came directly from this review.\n- [mdshare](https://mdshare.dev/) — the anonymous-token contribution pattern lineage.\n\nBuilt by [Urban Morph](https://urbanmorph.com) · [Sathya Sankaran](https://www.sathyasankaran.com). Drop a ⭐ if you find it useful.\n\n**Status:** v1.0. Curated layers, community submissions, REST API, MCP server ( [npm](https://www.npmjs.com/package/bharatlas-mcp)), dynamic filters with typeahead, whole-layer downloads in 5 formats. API docs at [/docs](https://bharatlas.com/docs), MCP setup at [/mcp](https://bharatlas.com/mcp). Community submissions are permanent under the open licence the contributor selected.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furbanmorph%2Fgeodata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Furbanmorph%2Fgeodata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furbanmorph%2Fgeodata/lists"}