GithubHelp home page GithubHelp logo

google-geoengine's Introduction

Scalable geofencing API for Google App Engine

An architecture proposal for a geofencing API on Google's App Engine using Google Cloud Endpoints. This API is able to geofence complex polygons at a large throughput using App Engine, Cloud Datastore and Memcache. It uses the Java Topology Suite to create a spatial index which is stored in Memcache for fast querying access. You can download, build and deploy the project as is using the Google App Engine Maven plugin. For a detailed explanation of the architecture please refer to this Google Developers Blogpost.

Endpoints

  • add: Add a fence to a certain group.
  • buildIndex: Build the spatial index and write it to Memcache.
  • getById: Get a fence's metadata by it's id.
  • list: List all fences in a certain group.
  • point: Get all fences that contain a certain point.
  • polygon: Get all fences that aren't disjoint with a certain polygon.
  • polyline: Get all fences that intersect with a certain polyline.

Test & Deploy to App Engine

  1. Update the value of application in src/main/webapp/WEB-INF/appengine-web.xml to the app ID you have registered in the App Engine admin console and would like to use to host your instance of this sample.

  2. Optional step: These sub steps are not required but you need this if you want to have auth protected methods.

    1. Update the values in src/main/java/com/google/appengine/geo/fencing/Constants.java to reflect the respective client IDs you have registered in the APIs Console.

    2. You also need to supply the web client ID you have registered in the APIs Console to your client of choice (web, Android, iOS).

  3. Run the application with mvn appengine:devserver, and ensure it's running by visiting your local server (by default localhost:8080.)

  4. Optional step: Get the client library with

    $ mvn appengine:endpoints_get_client_lib

    It will generate a client library jar file under the target/endpoints-client-libs/<api-name>/target directory of your project, as well as install the artifact into your local maven repository.

    For more information on client libraries see:

  5. Deploy your application to Google App Engine with

    $ mvn appengine:update

    Please note that you should always first test on the development server since that creates indexes for our datastore queries. Also after the first deployment App Engine takes a while to create the necessary indexes and connections, so if you get errors, just wait for a bit.

  • src/main/webapp/addFence.html is an example of how to use the Google Maps JavaScript API Drawing Layer to draw fences to the map and store them to your App Engines Datastore using the add endpoint.

  • src/main/webapp/query.html shows you how to query your API for points, polylines and polygons.

These examples can also be used to test your API. You should always first test on the devserver (mvn appengine:devserver), since this automatically creates indexes that are needed for our Datastore queries.

google-geoengine's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  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.