Skip to content

A Python-Flask application using a MongoDB database to cache results returned by Google Geolocation API.

License

Notifications You must be signed in to change notification settings

cmfcruz/geocache

Repository files navigation

Address Cache Using MongoDB

Introduction

Acts as a drop-in cache for Google API Reverse Geocoder responses to locations. Allows you to use addresses of "near" locations based on a specified maximum distance if tolerable. The cache is good for edge cases when most location requests are centered around certain "hot spots" and the addresses are only used to validate if the location is near a specific place of interest.

Quick Start Guide

Run a MongoDB local database using Docker:

docker run --name mongo -d mongo:latest

Run the Address Cache app using Gunicorn:

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
gunicorn app:app

Make sure that the app is accessible by doing a GET HTTP request to the local URL:

http://localhost:8000/maps/api/geocode/status

Try retrieving a location by doing a GET HTTP request with valid coordinates and a Google API key. See the sample request below:

https://localhost:8000/maps/api/geocode/json?latlng=14.4288586,121.0229493&key=MkVEREI1MkItQUEyRS00Qzg0LThCRTAtQjE1N0IwRDFDMkM4Cg

TODO

  • Exception handlers
  • Unit tests
  • Proper logger
  • Unit testing
  • XML Output Support

References

About

A Python-Flask application using a MongoDB database to cache results returned by Google Geolocation API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published