Skip to content
LocatorAPI Trilateration Service (using non-linear least squares method) on Spring Boot framework
Java
Branch: master
Clone or download
Pull request Compare This branch is even with artemantcev:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle/wrapper
src
.gitignore
README.md
build.gradle
gradlew
gradlew.bat
settings.gradle

README.md

locatorapi

LocatorAPI Trilateration Service (using non-linear least squares method)

This application calculates the approximate position of mobile station point based on information from various base stations. Base stations communicate with API using these methods:

Firstly, the base station needs to initialize itself on API server and get its own identifier. Base station should provide to API its coordinates in two dimensions. Here's an example of request: /stations/base/new?xCoord=67&yCoord=8

Response is:

{  
      "newBaseStationId": 57  
}

Now your base station can send the information about mobile points using /stations/update endpoint.

Here's an example of request body:

{
	"stationId": 57,
	"mobileStations": [
		{"stationId": 101, "distance": 69.5} //you can add more points here
	]
}

After that, the system will automatically create all non-existent mobile stations and persist them. Or, if these mobile points are already known to server by their identifiers (stationId), their calculated data will be overwritten each time the base stations update position records.

Now, you need to look at the position of some mobile station. Just use /stations/mobile/find route.
Request is:
/stations/mobile/find?stationId=101

Response is:

{
    "stationId": 101,
    "xCoord": -38.354332552623994,
    "yCoord": 9.016995594006096,
    "error": 4.598659769237272
}

There's nothing more to add. Maybe, someone will find it useful.

You can’t perform that action at this time.