# geochatt
Utility Functions for Working with Open GeoSpatial Data about Chattanooga
## features
- very fast: uses [STRTree](https://shapely.readthedocs.io/en/2.0.4/strtree.html) for super fast reverse geocoding
- get address from point
- get city council district from point
- get municipality from point
- get zip code from point
## install
```sh
pip install geochatt
```
## usage
```py
import geochatt
geochatt.get_address(longitude=-85.3076591, latitude=35.0432979)
"101 E 11TH ST"
geochatt.get_city_council_district(longitude=-85.3076591, latitude=35.0432979)
8
geochatt.get_municipality(longitude=-85.3076591, latitude=35.0432979)
"Chattanooga"
geochatt.get_zipcode(longitude=-85.3076591, latitude=35.0432979)
37402
# get_parcel returns a string representing a Well-known text-format polygon
geochatt.get_parcel(address="101 E 11TH ST")
'POLYGON ((-85.3069572 35.043897, -85.3074818 35.0440926, -85.3075952 35.0438743, -85.3078311 35.0434433, -85.3073192 35.0432494, -85.3069718 35.0438707, -85.3069572 35.043897))'
# get_parcel_centroid returns a Shapely Point object
geochatt.get_parcel_centroid(address="101 E 11TH ST")
<POINT (-85.307 35.044)>
```
## cli usage
```sh
$ pip install geochatt
$ geochatt get-address --latitude="35.0432979" --longitude="-85.3076591"
101 E 11TH ST
$ geochatt get-city-council-district --latitude="35.0432979" --longitude="-85.3076591"
8
$ geochatt get-municipality --latitude="35.0432979" --longitude="-85.3076591"
Chattanooga
$ geochatt get-parcel --address="101 east 11th street"
POLYGON ((-85.3069572 35.043897, -85.3074818 35.0440926, -85.3075952 35.0438743, -85.3078311 35.0434433, -85.3073192 35.0432494, -85.3069718 35.0438707, -85.3069572 35.043897))
$ geochatt get-parcel-centroid --address="101 east 11th street"
POINT (-85.30739570641228 35.0436712625469)
$ geochatt get-zipcode --latitude="35.0432979" --longitude="-85.3076591"
37402
```
## performance
Reverse geocoding is super fast thanks to [STRTree](https://shapely.readthedocs.io/en/2.0.4/strtree.html).
The performance test of geocoding 1 million random points takes 122.900 seconds, which is 0.000122 seconds per point.
Raw data
{
"_id": null,
"home_page": "https://github.com/officeofperformancemanagement/geochatt",
"name": "geochatt",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "data, python",
"author": "Daniel J. Dufour",
"author_email": "daniel.j.dufour@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/97/43/b67b9d85cc02f8f669f81ea373b681d996651fee6efc3ff0affc8180ceb2/geochatt-0.2.0.tar.gz",
"platform": null,
"description": "# geochatt\nUtility Functions for Working with Open GeoSpatial Data about Chattanooga\n\n## features\n- very fast: uses [STRTree](https://shapely.readthedocs.io/en/2.0.4/strtree.html) for super fast reverse geocoding\n- get address from point\n- get city council district from point\n- get municipality from point\n- get zip code from point\n\n## install\n```sh\npip install geochatt\n```\n\n## usage\n```py\nimport geochatt\n\ngeochatt.get_address(longitude=-85.3076591, latitude=35.0432979)\n\"101 E 11TH ST\"\n\ngeochatt.get_city_council_district(longitude=-85.3076591, latitude=35.0432979)\n8\n\ngeochatt.get_municipality(longitude=-85.3076591, latitude=35.0432979)\n\"Chattanooga\"\n\ngeochatt.get_zipcode(longitude=-85.3076591, latitude=35.0432979)\n37402\n\n# get_parcel returns a string representing a Well-known text-format polygon\ngeochatt.get_parcel(address=\"101 E 11TH ST\")\n'POLYGON ((-85.3069572 35.043897, -85.3074818 35.0440926, -85.3075952 35.0438743, -85.3078311 35.0434433, -85.3073192 35.0432494, -85.3069718 35.0438707, -85.3069572 35.043897))'\n\n# get_parcel_centroid returns a Shapely Point object\ngeochatt.get_parcel_centroid(address=\"101 E 11TH ST\")\n<POINT (-85.307 35.044)>\n```\n\n## cli usage\n```sh\n$ pip install geochatt\n\n$ geochatt get-address --latitude=\"35.0432979\" --longitude=\"-85.3076591\"\n101 E 11TH ST\n\n$ geochatt get-city-council-district --latitude=\"35.0432979\" --longitude=\"-85.3076591\"\n8\n\n$ geochatt get-municipality --latitude=\"35.0432979\" --longitude=\"-85.3076591\"\nChattanooga\n\n$ geochatt get-parcel --address=\"101 east 11th street\"\nPOLYGON ((-85.3069572 35.043897, -85.3074818 35.0440926, -85.3075952 35.0438743, -85.3078311 35.0434433, -85.3073192 35.0432494, -85.3069718 35.0438707, -85.3069572 35.043897))\n\n$ geochatt get-parcel-centroid --address=\"101 east 11th street\"\nPOINT (-85.30739570641228 35.0436712625469)\n\n$ geochatt get-zipcode --latitude=\"35.0432979\" --longitude=\"-85.3076591\"\n37402\n```\n\n## performance\nReverse geocoding is super fast thanks to [STRTree](https://shapely.readthedocs.io/en/2.0.4/strtree.html).\nThe performance test of geocoding 1 million random points takes 122.900 seconds, which is 0.000122 seconds per point.\n",
"bugtrack_url": null,
"license": null,
"summary": "Utility Functions for Working with Open GeoSpatial Data about Chattanooga",
"version": "0.2.0",
"project_urls": {
"Download": "https://github.com/officeofperformancemanagement/geochatt/tarball/download",
"Homepage": "https://github.com/officeofperformancemanagement/geochatt"
},
"split_keywords": [
"data",
" python"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "9743b67b9d85cc02f8f669f81ea373b681d996651fee6efc3ff0affc8180ceb2",
"md5": "8ffd5280c442d7aa650baa9177e1d39a",
"sha256": "ee893cb4e4e161dd12805b391cb3c15c2ee9e4c4449d25fa4dc45315c0568198"
},
"downloads": -1,
"filename": "geochatt-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "8ffd5280c442d7aa650baa9177e1d39a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 23154207,
"upload_time": "2025-02-26T02:32:08",
"upload_time_iso_8601": "2025-02-26T02:32:08.220791Z",
"url": "https://files.pythonhosted.org/packages/97/43/b67b9d85cc02f8f669f81ea373b681d996651fee6efc3ff0affc8180ceb2/geochatt-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-26 02:32:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "officeofperformancemanagement",
"github_project": "geochatt",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "geochatt"
}