Skip to content

3. Rest API

Omer A edited this page Apr 11, 2015 · 2 revisions

In order to use GETIOM, an API which allows GET requests to the database containing the GeoTagged information and returning it in the specified GeoJSON format is required. The API has a REST - like url structure but requires only GET requests to be implemented. Therefore, from now on all paths refer specifically to GET requests to those paths.

In order to add your server to the project, go to the app.js file (located under /backend/) and modify the next line:

var restURL = "http://localhost:8081/messages"

You can use our server example inside: /RestExamples/NodeRestServices.
We have there a working Node.JS server with a fully working REST server - inside it you can load your own .JSON GeoJSON file and use it on your own data!
In order to use it just type:
node server.js
The server will load the GeoJSON file specified in this line:
var messages = JSON.parse(fs.readFileSync('./models/messages.json', 'utf8'));
The default server's settings are: localhost:8081 (can also be modified manually).


REST API

  • /dbsize

Parameters: None.
Return: The number of entries in the database.


  • /samples

Parameters: None.
Return: Returns 100 random points, In order to show as a Heat Map before the filtering.


  • /filter

    Parameters: None.
    Return: Return all entries in the database.


  • /filter/location/circle

    Parameters: lat,lng,radius.
    Return : Return all entries for which their coordinates are inside the given circle.


  • /filter/location/rectangle

    Parameters: lat1,lng1,lat2,lng2 - which are the bounding edges of the rectangle.
    Return : Return all entries for which their coordinates are inside the given rectangle.


  • /filter/location/polygon

    Parameters: TO BE IMPLEMENTED.
    Return : Return all entries for which their coordinates are inside the given polygon.


Clone this wiki locally