https://github.com/avryhof/geo_ez
Tools for building geographically aware django apps, without needing to install a real GIS backend.
https://github.com/avryhof/geo_ez
Last synced: about 2 months ago
JSON representation
Tools for building geographically aware django apps, without needing to install a real GIS backend.
- Host: GitHub
- URL: https://github.com/avryhof/geo_ez
- Owner: avryhof
- License: mit
- Created: 2019-09-04T19:18:23.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-10T19:26:06.000Z (about 5 years ago)
- Last Synced: 2025-03-04T08:48:57.880Z (3 months ago)
- Language: Python
- Size: 46.9 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
This package is still in early pre-alpha stages. Meanwhile, feel free to use the models, and functionality, but you will probably need to coerce them into working how you want them to for some cases.
# Geo EZ
```bash
pip install geo_ez
```A reusable Django module for building Gographically aware applications without needing to install a real GIS backend.
## settings.py
```python
INSTALLED_APPS=[
"...",
"gis",
"..."
]
```## Management commands
This will create the database tables for the models, and import US Postal Codes from GeoNames.
```bash
manage.py migrate
manage.py import-postal-codes
```## Now you can
- Extend the GISPoint model to build your own objects with stored corrdinates.
- Extend the StreetAddress model to have coordinate-aware street addresses in your own models.Any model Extended from GISPoint (Which includes any model extended from StreetAddress) can now be interacted with like this.A
```python
class GeoCache(GISPoint):
gc_id = CharField(max_length=20)cache = GeoCache.objects.get(gc_id='GC12345')
cache.distance_from(-76.123456, 43.123456, 5) # latitude, longitude, radius_in_miles
# - radius can also be in km if the keyword argument use_miles=Falsecache.in_radius(-76.123456, 43.123456, 5) # latitude, longitude, radius_in_miles
# - radius can also be in km if the keyword argument use_miles=Falsecaches = points_within_radius(GeoCache, -76.123456, 43.123456, radius=5, use_miles=True)
```