bd-geojson
v1.0.5
Published
Open-source geographic data for Bangladesh — divisions, districts, upazilas, postcodes, and full boundary GeoJSON.
Maintainers
Readme
bd-geojson
Open-source geographic data for Bangladesh — divisions, districts, upazilas, postcodes, and full boundary GeoJSON. Free, accurate, and community-maintained.
Demo: https://y3454r.github.io/bd-geodata · GitHub: https://github.com/Y3454R/bd-geodata
Quick Start
npm install bd-geojsonimport bd from 'bd-geojson';
bd.getDivisions(); // 8 divisions
bd.getDistrictsByDivision('3'); // districts in Dhaka division
bd.getUpazilasByDistrict('1'); // upazilas in Dhaka district
bd.search('সিলেট'); // search EN + Bangla names
bd.getFullHierarchy(); // full division → district → upazila treeYou can also import the raw JSON files directly:
import divisions from 'bd-geojson/divisions';
import boundary from 'bd-geojson/boundary';What's Inside
| File | Records | Description |
|------|---------|-------------|
| bd-divisions.json | 8 | Divisions with EN/BN names + coordinates |
| bd-districts.json | 64 | Districts mapped to divisions |
| bd-upazilas.json | 494 | Upazilas mapped to districts |
| bd-postcodes.json | 1,349 | Post offices and post codes |
| bangladesh.geojson | — | Full boundary polygons (~7MB) |
| dhaka-city.json | — | Dhaka city / city corporation areas |
All names are bilingual (English + বাংলা).
Data Shape
interface Division { id; name; bn_name; lat; long }
interface District { id; division_id; name; bn_name; lat; long }
interface Upazila { id; district_id; name; bn_name }
interface Postcode { division_id; district_id; upazila; postOffice; postCode }See src/types.ts for the full TypeScript definitions.
API
| Function | Returns |
|----------|---------|
| getDivisions() | Division[] |
| getDivisionById(id) | Division \| undefined |
| getDistricts() | District[] |
| getDistrictById(id) | District \| undefined |
| getDistrictsByDivision(divisionId) | District[] |
| getUpazilas() | Upazila[] |
| getUpazilaById(id) | Upazila \| undefined |
| getUpazilasByDistrict(districtId) | Upazila[] |
| getPostcodes() | Postcode[] |
| getPostcodesByDistrict(districtId) | Postcode[] |
| search(query) | SearchResult[] (matches EN + Bangla) |
| getFullHierarchy() | nested tree |
More examples in docs/USAGE.md.
Use Cases
- E-commerce — shipping address dropdowns, delivery zones, postcode lookup
- Logistics — route planning across divisions and districts
- NGO / Government — beneficiary mapping, coverage reporting
- Fintech — KYC address validation
- Civic tech — election visualizations, public service maps
- Education — teaching geography, building Bangla-first apps
Demo Site
The demo at y3454r.github.io/bd-geodata lets you:
- Search any division, district, or upazila by EN or Bangla name
- Browse the full hierarchy with cascade dropdowns
- See the boundary on a MapLibre map (OpenFreeMap tiles)
- Copy any record as JSON in one click
Run it locally:
npm install
npm run demo:install
npm run demo:devContributing
Found wrong coordinates? A missing upazila? A typo in a Bangla name? PRs are very welcome.
See docs/CONTRIBUTING.md. Data validation runs automatically on every PR.
Validation
Before submitting a data PR, run:
node scripts/validate-data.jsThis checks structure, required fields, referential integrity, coordinate bounds, and duplicate IDs.
License
This project uses two licenses:
- Code (the npm package, demo site, scripts) — MIT. Free for any use, commercial or otherwise.
- Data files derived from OpenStreetMap — ODbL 1.0. Specifically
bd-bazars.geojsonandbd-major-routes.geojson. ODbL requires attribution and share-alike on derived databases. - Boundary data (
bangladesh.geojson) — CC BY 4.0, sourced from geoBoundaries (gbOpen, ADM3). Underlying authority: Bangladesh Bureau of Statistics (BBS) / OCHA ROAP. - Administrative reference data (
bd-divisions.json,bd-districts.json,bd-upazilas.json,bd-postcodes.json,dhaka-city.json) — community-contributed, MIT.
Attribution when using OSM-derived layers:
© OpenStreetMap contributors — odbl-1.0
See metadata.attribution inside each derived GeoJSON for the exact string.
Credits
Maintained by @Y3454R and contributors. Originally forked from bangladesh-geojson by @ifahimreza. Map tiles by OpenFreeMap.
