bd-offline-geocoder
Offline Bangladesh reverse geocoder for Python.
GPS → Bangladesh address parts: house, road, area/village, union/ward, thana/upazila, district, division, postal code, city.
No API key. No network. Same data as npm and Flutter.
Keywords: Bangladesh reverse geocoder, offline geocoding, upazila, thana, ward, Dhaka street, GIS Python.
from bd_offline_geocoder import BdOfflineGeocoder
geocoder = BdOfflineGeocoder.from_included_data()
result = geocoder.reverse(latitude=23.74015, longitude=90.38286)
print(result.formatted)
# House 3, Road 3, Dhanmondi, Ward No-49, Dhanmondi Thana, Dhaka 1209, Bangladesh
print(result.to_dict())
# {
# "house_number": "3",
# "road_number": "3",
# "road_name": "",
# "area_village": "Dhanmondi",
# "union_ward": "Ward No-49",
# "thana_upazila": "Dhanmondi Thana",
# "district": "Dhaka",
# "division": "Dhaka",
# "postal_code": "1209",
# "city": "Dhaka"
# }
Install
pip install bd-offline-geocoder
Python 3.9+. Zero runtime dependencies.
from_included_data() parses bundled GeoJSON once and caches the instance. Reuse it in Celery workers, FastAPI lifespan, or Gunicorn preload.
Published wheel is large (~admin polygons + Dhaka streets) because the feature is offline.
Usage
result = geocoder.reverse(latitude=23.74015, longitude=90.38286)
result.house_number # 3
result.road_number # 3
result.road_name # None unless OSM has a named street
result.area_village # Dhanmondi
result.union_ward # Ward No-49
result.thana_upazila # Dhanmondi Thana
result.district # Dhaka
result.division # Dhaka
result.postal_code # 1209
result.city # Dhaka
result.formatted
result.to_dict()
Outside Bangladesh: found is False and formatted is
This geocoder only supports locations inside Bangladesh.
Invalid / NaN coordinates raise ValueError.
Custom layers
from bd_offline_geocoder import BdOfflineGeocoder, BoundaryLayer, LayerType
layer = BoundaryLayer.from_file(
"my_localities.geojson",
id="localities",
type=LayerType.LOCALITY,
name_property_candidates=("name", "NAME"),
)
geocoder = BdOfflineGeocoder([layer])
Limits
- Nationwide: administrative polygons only (ADM4 is simplified).
- Roads / house numbers: central Dhaka OSM only; house numbers are sparse.
- Not a Google Maps replacement for every rooftop.
Links
Author: Tasfiqul Ghani. MIT code; see notices for HDX / OSM.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bd_offline_geocoder-0.1.1.tar.gz.
File metadata
- Download URL: bd_offline_geocoder-0.1.1.tar.gz
- Upload date:
- Size: 29.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06ed6ee94f751d3e79fd4ea25ac54f496087ac2c1f5f2240e66ae7f490edd597
|
|
| MD5 |
bfc7816c10d57c700b01d837cb318fae
|
|
| BLAKE2b-256 |
ac63dda0f800959c4d6c7e0dd4eee3cd828da98190289f12ce48cb02cb9c146a
|
Provenance
The following attestation bundles were made for bd_offline_geocoder-0.1.1.tar.gz:
Publisher:
publish-pypi.yml on TasfiqulGhani/bd-offline-geocoder
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bd_offline_geocoder-0.1.1.tar.gz -
Subject digest:
06ed6ee94f751d3e79fd4ea25ac54f496087ac2c1f5f2240e66ae7f490edd597 - Sigstore transparency entry: 2568074342
- Sigstore integration time:
-
Permalink:
TasfiqulGhani/bd-offline-geocoder@bd4fded481d997d82895af8621c95fd7486dabc0 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/TasfiqulGhani
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@bd4fded481d997d82895af8621c95fd7486dabc0 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file bd_offline_geocoder-0.1.1-py3-none-any.whl.
File metadata
- Download URL: bd_offline_geocoder-0.1.1-py3-none-any.whl
- Upload date:
- Size: 29.9 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ae73ec5b13725f6239e7eddc47d8e8edb3eabee3c43e0d551030826706f3baa
|
|
| MD5 |
8989a3969adf00f64f2ad5c24145533b
|
|
| BLAKE2b-256 |
9cb1d6a5c520594f8f35e00a4cfaac16798f6ce888fb958a8200c2a93b4c86db
|
Provenance
The following attestation bundles were made for bd_offline_geocoder-0.1.1-py3-none-any.whl:
Publisher:
publish-pypi.yml on TasfiqulGhani/bd-offline-geocoder
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bd_offline_geocoder-0.1.1-py3-none-any.whl -
Subject digest:
1ae73ec5b13725f6239e7eddc47d8e8edb3eabee3c43e0d551030826706f3baa - Sigstore transparency entry: 2568074361
- Sigstore integration time:
-
Permalink:
TasfiqulGhani/bd-offline-geocoder@bd4fded481d997d82895af8621c95fd7486dabc0 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/TasfiqulGhani
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@bd4fded481d997d82895af8621c95fd7486dabc0 -
Trigger Event:
workflow_dispatch
-
Statement type: