Git Product home page Git Product logo

poly_check's Introduction

PolyCheck

A simple application that takes an address from a user, and determines whether that address is inside or outside a polygon projected onto a map.

Deployed App

https://polycheck.herokuapp.com/

  • The app will load up a random polygon and show it on the map.
  • Search for an address and the map will show a marker at your chosen address and display if it is contained within the randomly loaded polygon.
  • You can search again for a different address or refresh the page to choose a different polygon (although note there are currently only 3 polygons in the "database", so you may get the same one twice!)
  • Note the app is written using newer ES6 features, without polyfills, and won't run in older browsers like IE.

Development

PolyCheck is a NodeJS app, using Express as the server to provide both a user interface and minimal API.

The app provides a publically accessible GET /polygon endpoint, which can be accessed via the browser or curl, and returns a custom data format representing a polygon in the structure:

{
  "name": <name-of-polygon>,
  "coordinates": [
    {
      "lng": <longitude>,
      "lat":  <latitude>
    },
    ...
  ]
}

The polygon data is stored in a static JSON file which was created from http://geojson.io. Additions to this data must satisfy the polygon validation check, ensuring the shape is a closed loop. That is;

  1. First and last coordinate should be the same
  2. The number of coordinates must be more than 2

To run locally, you will need to set a Google API key in a .env file. See env.example for required format.

$ git clone [email protected]:dawner/poly_check.git
$ cd poly_check
$ npm run build:local
$ npm run start
>> Open on localhost:3000

poly_check's People

Contributors

dawner avatar

Watchers

 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.