- Ruby with Sinatra framework for 
routerandpointerREST API. - Routing mechanism using Astar algorithm implementation of 
mormonlibrary by readingosmfiles generated by mapzen. Routing by osm is done by calculating between nodes. - Pointer converts 
longitudeandlatitudeinto array of osm nodes using Elasticsearch's feature of geo distance query. 
- Electron app that called 
router,pointerandGoogle MapsAPI. 
Sample Request:
POST /pointer HTTP/1.1
Content-Type: application/json; charset=utf-8
Host: localhost:4567
{
  "lat": -6.893559,
  "lon": 107.611851,
  "distance": "15m"
}
Sample Response:
{
  "status": "success",
  "data": {
    "took": 5,
    "timed_out": false,
    "_shards": {
      "total": 5,
      "successful": 5,
      "failed": 0
    },
    "hits": {
      "total": 2,
      "max_score": 1.0,
      "hits": [
        {
          "_index": "bandung",
          "_type": "location",
          "_id": "32524032",
          "_score": 1.0,
          "_source": {
            "pin": {
              "location": {
                "lat": -6.8936441,
                "lon": 107.6119504
              }
            }
          }
        },
        {
          "_index": "bandung",
          "_type": "location",
          "_id": "1880477622",
          "_score": 1.0,
          "_source": {
            "pin": {
              "location": {
                "lat": -6.893564,
                "lon": 107.6119466
              }
            }
          }
        }
      ]
    }
  }
}
Sample Request:
POST /router HTTP/1.1
Content-Type: application/json
Host: localhost:4567
{
  "start": 3376871364,
  "destination": 32524032
}
Sample Response:
{
  "status": "success",
  "data": [
    [
      -6.893759,
      107.6084671
    ],
    [
      -6.8935901,
      107.6087933
    ],
    [
      -6.8933655,
      107.6093821
    ],
    [
      -6.8932224,
      107.6101272
    ],
    [
      -6.8932083,
      107.6103897
    ],
    [
      -6.893203,
      107.6105077
    ],
    [
      -6.8932536,
      107.610902
    ],
    [
      -6.8934601,
      107.6115446
    ],
    [
      -6.8936441,
      107.6119504
    ]
  ]
}
- 
This project was tested on Elasticsearch 5.4.0, Ruby 2.3.1 and NodeJS 6.10.3.
 - 
Clone the project.
 - 
Extract
bandung_coord.csv.zipandbandung_indonesia.osm.zipinsidedatadirectory. - 
Make sure Elasticsearch is up and running.
 - 
Create Elasticsearch mapping by running
$ curl -X "PUT" "http://localhost:9200/bandung" -H "Content-Type:application/json" -d $'{"mappings":{"location":{"properties":{"pin":{"properties":{"location":{"type":"geo_point"}}}}}}}' - 
Run
$ gem install faradayand then$ ruby seeder.rband wait till the process finished. - 
After seeding process finished, go to
source/router-apidirectory and run$ bundle installto install the dependencies. - 
In
source/router-apidirectory, run$ ruby application.rbto start the API. - 
Obtain API Key of Google Maps and edit
index.htmlinsidesource/maps-guidirectory. - 
In
sourcedirectory run$ npm install electron -gto fetch the Electron binaries. - 
Run
$ electron maps-gui. 
- Danny Pranoto for helping me with 
index.htmlandmain.csscreation. 
