Giter Club home page Giter Club logo

geoencoding's Introduction

Geo Encoding Service.

Table of Contents

Requirements

  • Python 3.6.5
  • Django framework
  • Django Rest Framework

Setup

  • Clone the repository.

  • Install Python 3.6.5 and above. You can use your favourite tool to install the software (HomeBrew, pyenv)

  • Set up virtualenv with the following command virtualenv -p `which python3` env

  • Install the python packages required by the project by executing pip install -r requirements.txt.

  • Run the migration scripts by executing the following commands from the home directory cd geoencoding

  • Run the command python manage.py runserver to start the server.

API Endpoints

To fetch the latitude and longitude response, you need the API Keys for both Here and Google Maps.

Make sure that you have a module named api_keys in your django app. Module should define the following variables.

HERE_APP_ID=<HERE_APP_ID>
HERE_APP_CODE=<HERE_APP_CODE>
GOOGLE_APP_KEY=<GOOGLE_APP_KEY>

Get Latitude Longitude

GET /encoding/lat_long?address=<address>

Returns the latitude and longitude

Request Query Parameter

Name Type Description Required
address string Addressed to be looked up true

The sample request is given below:

/encoding/lat_long?address=1600+Amphitheatre+Parkway+Mountain+View

Response Body

A response status code will be 200 OK and will have the following characteristics.

Name Type Description Required
latitude decimal Unique latitude true
longitude decimal Unique longitude true

Error Response Body

The error response body represents an error of errors returned as 200 OK

Name Type Description Read only
errors array array of error objects true

where each error object consists of the following fields

Name Type Description Read only
error code number error code indicating the kind of error true
error message string user friendly message true

Some of the sample responses are given below

 {
   'errors': [
       {
         'error_code': 400,
         'error_message': 'No Data Found'
       }
   ]
 }

geoencoding's People

Contributors

krishnanand avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.