Code Monkey home page Code Monkey logo

gmaproadapi's Introduction

 ,-----.,--.                  ,--. ,---.   ,--.,------.  ,------.
'  .--./|  | ,---. ,--.,--. ,-|  || o   \  |  ||  .-.  \ |  .---'
|  |    |  || .-. ||  ||  |' .-. |`..'  |  |  ||  |  \  :|  `--, 
'  '--'\|  |' '-' ''  ''  '\ `-' | .'  /   |  ||  '--'  /|  `---.
 `-----'`--' `---'  `----'  `---'  `--'    `--'`-------' `------'
----------------------------------------------------------------- 

Demo link

https://gmap-road.herokuapp.com

APIs

Add new raw GPS data

POST https://gmap-road.herokuapp.com/api/gps/raw

Sample Request body
{
	"gpx": {
		"wpt": [{
			"ele": "141.4",
			"name": "WP01-A",
			"_lat": "41.07794",
			"_lon": "29.0291"
		}, {
			"ele": "141.5",
			"name": "WP02-B",
			"_lat": "41.0778",
			"_lon": "29.02886"
		}, {
			"ele": "141.7",
			"name": "WP03-C",
			"_lat": "41.07775",
			"_lon": "29.02866"
		}, {
			"ele": "142.7",
			"name": "WP04-D",
			"_lat": "41.07769",
			"_lon": "29.02834"
		},........]
	}
}
Sample output
{
	"_id": "589bffd42da3292cd15cfad4",
	"gpsData": [{
        "ele": "141.4",
        "name": "WP01-A",
        "_lat": "41.07794",
        "_lon": "29.0291"
    }, {
        "ele": "141.5",
        "name": "WP02-B",
        "_lat": "41.0778",
        "_lon": "29.02886"
    }, {
        "ele": "141.7",
        "name": "WP03-C",
        "_lat": "41.07775",
        "_lon": "29.02866"
    }, {
        "ele": "142.7",
        "name": "WP04-D",
        "_lat": "41.07769",
        "_lon": "29.02834"
    },........],
	"__v": 0
}

Get all raw GPS data

GET https://gmap-road.herokuapp.com/api/gps/raw

Sample Output
[{
	"_id": "589c02bcf9c7f53a5fee39fb",
	"gpsData": [{
		"ele": "118.3",
		"name": "WP148",
		"_lat": "41.06672",
		"_lon": "29.00071"
	}, {
		"ele": "118.2",
		"name": "WP149",
		"_lat": "41.06672",
		"_lon": "29.00065"
	}, 
	....],
	"__v": 0
}, {
	"_id": "589bffd42da3292cd15cfad4",
	"name": "tirp one",
	"gpsData": [{
		"_lon": "29.0291",
		"_lat": "41.07794",
		"name": "WP01-A",
		"ele": "141.4"
	}, {
		"_lon": "29.02886",
		"_lat": "41.0778",
		"name": "WP02-B",
		"ele": "141.5"
	},  
	....],
	"__v": 0
}]

Get single raw GPS data by id

GET https://gmap-road.herokuapp.com/api/gps/raw/?id=589c02bcf9c7f53a5fee39fb

{
	"_id": "589bffd42da3292cd15cfad4",
	"gpsData": [{
		"_lon": "29.0291",
		"_lat": "41.07794",
		"name": "WP01-A",
		"ele": "141.4"
	}, {
		"_lon": "29.02886",
		"_lat": "41.0778",
		"name": "WP02-B",
		"ele": "141.5"
	}, {
		"_lon": "29.02866",
		"_lat": "41.07775",
		"name": "WP03-C",
		"ele": "141.7"
	},
	.....],
	"__v": 0
}

Get single raw GPS data by id (Returns Formatted data)

GET https://gmap-road.herokuapp.com/api/gps/raw/?id=589c02bcf9c7f53a5fee39fb&formatted=true

Sample Output
{
	"_id": "589c02bcf9c7f53a5fee39fb",
	"gpsData": [{
		"lng": 29.00071,
		"lat": 41.06672
	}, {
		"lng": 29.00065,
		"lat": 41.06672
	}, {
		"lng": 29.00055,
		"lat": 41.06671
	}, {
		"lng": 29.00041,
		"lat": 41.06673
	}, 
	.......],
	"__v": 0
}

Get single Road api snapedToRoad GPS data by id

GET https://gmap-road.herokuapp.com/api/gps/road/?id=589c02bcf9c7f53a5fee39fb

Sample Output
{
	"_id": "589c3f13c321fa9cccf741ec",
	"snappedPoints": [{
		"location": {
			"latitude": 41.06672002402712,
			"longitude": 29.000710001123153
		},
		"originalIndex": 0,
		"placeId": "ChIJCZjV4FW2yhQRDEeRFX0AmwA"
	}, {
		"location": {
			"latitude": 41.06672161631816,
			"longitude": 29.000650075553303
		},
		"originalIndex": 1,
		"placeId": "ChIJCZjV4FW2yhQRDEeRFX0AmwA"
	}, {
		"location": {
			"latitude": 41.06672259634441,
			"longitude": 29.00054981436102
		},
		"originalIndex": 2,
		"placeId": "ChIJIezW5FW2yhQRihVTi_Rse9s"
	}, 
	......],
	"gpsId": "589c02bcf9c7f53a5fee39fb",
	"__v": 0
}

Note: For only first time this data will come from google and will be saved to mongoDB,
    Next time it will be retrieved form mongoDB.

Get single Road api snapedToRoad GPS data by id (Returns Formatted data)

GET https://gmap-road.herokuapp.com/api/gps/road/?id=589c02bcf9c7f53a5fee39fb&formatted=true

Sample Output
    {
    	"_id": "589c3f13c321fa9cccf741ec",
    	"snappedPoints": [{
            "lng": 29.00071,
            "lat": 41.06672
        }, {
            "lng": 29.00065,
            "lat": 41.06672
        }, {
            "lng": 29.00055,
            "lat": 41.06671
        }, {
            "lng": 29.00041,
            "lat": 41.06673
        }, 
        .......],
    	"gpsId": "589c02bcf9c7f53a5fee39fb",
    	"__v": 0
    }

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.