*/current, location data

API with real-time geolocation data, for TV graphics, speed monitor, gap time calculation, or any other applications.

Request

URL https://racemap.com/api/data/v1/:eventId/current Method GET

Live sample https://racemap.com/api/data/v1/66bf4318d1c783279d183dd3/currentarrow-up-right Corresponding map https://racemap.com/player/100KmDuathlon2018_API-live-samplearrow-up-right

Optional query parameters

Specify the query parameters when calling the API endpoint, e.g. to smoothen gap values.

The participantId of a specified reference participant for the calculation of gapAverage, gap, gapChase, gapDistance, gapAverageEx, gapEx, gapChaseEx and gapDistanceEx.

You can call the same API endpoint with different query parameters at the same time. You can also combine parameters with & in one call eg. https://racemap.com/api/data/v1/66bf4318d1c783279d183dd3/current?avgSpeedWindow=600&participantId=66bf4318d1c783279d183e3darrow-up-right

Response

Event object

Field
Description [unit]
Sample

name

Name of event

"100km Duathlon"

location

Location

"Dresden"

startTime

Start time in UTC

"2022-01-24T15:00:10.000Z"

endTime

End time in UTC

"2022-01-24T22:59:45.000Z"

resultTime

UTC timestamp for which you retrieve API data.

"2022-01-24T20:00:10.000Z"

starters

Array for participant objects

shadowTrackUrl

URL to download the shadowtrack as a geojson file

Participant object

Field
Description [unit]
Sample

id

Unique RACEMAP ID of the participant

"61a2122f181c0a0ff7b53765"

name*

Name

"CLV Megware"

startNumber*

Bib number

"001"

markerColor*

Color of dot in tracking map, hex code

"#ffffff"

tags*

Object with optional attributes to filter participants eg. age group or nation, format "tag": "value"

"age": "40", "sex": "male"

importId

User-defined ID with imported participant data, Generic API (importId) or RACE|RESULT API (Id)

"UniqueImportId_1" or null if no importId exists

current

Object for real-time location data and gap measurements and extrapolations

Inner values are null if no locations within startTime and endTime are known

device

Object for device information

null if device is not used in tracker management

*The parameter is imported or synchronized with RACEMAP from an external source.

Current object

  • current-object provides the latest data for the specified resultTime parameter.

  • (*) These parameters are calculated only for events with a shadowtrack and a mapping of the geolocation on the shadowtrack. The default max mapping distance is 100 m and can be changed in the Advanced Settings of the event. If the geolocation can not be mapped the corresponding (*) parameters are null.

  • gapDistance, gap, gapChase, gapAverage, gapDistanceEx, gapEx, gapChaseEx and gapAverageEx are calculated for the leader by default. Leader: The device with the smallest toFinish value at resultTime. Attention: Each time a leader reaches the finish, the next device closest to the finish becomes the new leader. In this moment, the speed value of the next leader may impact fluctuating gap values. Reference: Query with participantId or startNumber for calculation against the reference participant instead of the leader.

Recorded geolocations for two GPS devices. The geolocations are mapped on the shadowtrack (offset) over the time.
Field
Description [unit]
Sample

lat/lng: Coordinate of the latest recorded geolocation.

time

UTC timestamp when the latest geolocation was recorded.

"2022-01-24T16:33:47.012Z"

lng

Longitude of the latest recorded geolocation.

13.727678288

lat

Latitude of the latest recorded geolocation.

50.976534023

speedRaw

Average speed [m/s]. distance: straight line between two coordinates time: avgSpeedWindow

circle-info

Curves are cut between the two geolocations.

4.9574

distanceToShadowTrack

Shortest distance [m] between lat/lng and the shadowtrack.

175.9

lngSt/latSt: Mapping of the latest recorded geolocation (lat/lng) on the shadowtrack.

lngSt *

Longitude of the latest recorded geolocation mapped on the shadowtrack.

13.805551232 or null

latSt *

Latitude of the latest recorded geolocation mapped on the shadowtrack.

50.93151590 or null

speed *

Average speed [m/s] distance: segment of the shadowtrack time: avgSpeedWindow

5.2727 or null

elvSt *

Altitude [m] above zero of lngSt/latSt.

85.2 or null if device is not on shadowtrack

fromStart *

Distance [m] from the start point of the shadowtrack along the track to latSt/lngSt.

9962.6826 or null

toFinish *

Distance [m] from latSt/lngSt along the shadowtrack to the end point of the track.

89097.3173 or null

eta *

Estimated time of arrival [s], duration to move from latSt/lngSt to the end point of the shadowtrack, extrapolation with speed.

16897.77 or null

gapCalcTime *

UTC timestamp for which gapDistance, gap, gapChase and gapAverage is obtained. Value is older (or equal) than resultTime.

circle-info

Q: What is the latest UTC timestamp (at the specified resultTime) for which the API knows recorded geolocations?

"2022-01-24T16:32:30.012Z" or null

gapDistance *

Distance [m] between latSt/lngSt and the toFinish value of the leader.

circle-info

Q: What is the current distance between chaser and leader?

null or 3364.91 or -554.03 if reference is behind device

gap *

Duration [s] to move from latSt/lngSt along the shadowtrack to the toFinish value of the leader, calculated with the speed value of the leader.

If speed of leader < 1 km/h than calculation with the default speed value of the event.

null or 1205.68 or -581.20 if reference is behind device

gapChase *

Duration [s] to move from latSt/lngSt along the shadowtrack to the toFinish value of the leader, calculated with the speed value of the chaser.

If speed of chaser < 1 km/h than calculation with the default speed value of the event.

null or 968.81 or -73.02 if reference is behind device

gapAverage *

Duration [s] to move from latSt/lngSt to the toFinish value of the leader, calculated with the timestamp of when the leader was at latSt/lngSt.

circle-info

Q: How long did it take the leader to cover the distance gapDistance?

null or 2360.36 or -112.6 if reference is behind device

lngStEx/latStEx: Mapping of the latest recorded geolocation (lat/lng) on the shadowtrack (lngSt/latSt), further extrapolation on the track to the point in time of resultTime with the speed value.

lngStEx *

Longitude of the latest recorded geolocation mapped on the shadowtrack and extrapolated to resultTime.

5.2727 or 13.805551232 or null

latStEx *

Latitude of the latest recorded geolocation mapped on the shadowtrack and extrapolated to resultTime.

50.93151590 or null

fromStartEx *

Distance [m] from the start point of shadowtrack along the track to lngStEx/latStEx.

9963.6826 or null

toFinishEx *

Distance [m] from lngStEx/latStEx along the shadowtrack to the end point of the track.

890967.3173 or null

gapDistanceEx *

Distance [m] from lngStEx/latStEx along the shadowtrack to reach the toFinishEx value of the leader.

null or 3374.91 or -564.03 if reference is behind device

gapEx *

Duration [s] to move from lngStEx/latStEx along the shadowtrack to the toFinishEx value of the leader, calculated with the speed value of the leader.

If speed of leader < 1 km/h than the default speed value of the event is used.

circle-info

Q: How long does it take the leader to move backward with his current speed until he reaches the chaser's location?

null or 1305.68 or -591.20 if reference is behind device

gapChaseEx *

Duration [s] to move from lngStEx/latStEx along the shadowtrack to the toFinishEx value of the leader, calculated with the speed value of the chaser.

If speed of device < 1 km/h than the default speed value of the event is used.

circle-info

Q: How long does it take for the chaser with his current speed to reach the leader's location?

null or 978.81 or -93.02 if reference is behind device

gapAverageEx *

Duration [s] to move from lngStEx/latStEx along the shadowtrack to the toFinishEx value of the leader, calculated with the timestamp of when the leader was at the same offset on the track.

circle-info

Q: How long did it take the leader to cover the distance gapDistanceEx?

null or 2560.36 or -132.6 if reference is behind device

Device object

The device object provides additional information for those GPS trackers, that are used in the tracker management.

Field
Description [unit]
Sample

externalId

Unique id of tracking device, can be IMEI or transponder id or App id depending on the type of device.

"4106050246" or "860599002489748" or "RRPing_ZDKAR32" or "d40ad78e-b929-4224-967e-62ca93effc68"

battery

Charge level [%] of device.

3, 52, 99

online

Connection status with RACEMAP server, determined by checking if there is a socket connection to the device and evaluating the time since the last message was received.

true or false

isMoving

Shows wether a device is moving or not. Only valid if a device is online.

true or false

lastLocationGpsFix

Showing whether the device had a GPS fix when recording the latest coordinate.

true or false

lastLocationAt

Timestamp in UTC when the latest coordinate was recorded. Note: If interpolation=true lastLocationAt can differ from time.

"2022-01-24T16:33:47.012Z"

deviceId

Unique id of the tracking device in RACEMAP.

"5b6ac1561c6a700020a00010"

The GPS tracker does not send the information when it loses the GPS fix. If the device loses the fix, no coordinates are recorded. Therefore, evaluating online status along with lastLocationAt provides a more reliable observation than relying solely on the lastLocationGpsFix parameter.

If online is true but there is no current lastLocationAt:

  • Device may have lost its GPS fix and is unable to record coordinates.

  • Could suggest potential tampering or manipulation, also.

If online is false:

  • Device may have lost its network connection.

  • Device may have been turned off, also.

Sample response// Some code

Speed calculations

Speeds can vary significantly in dense datasets, mainly because of GPS position inaccuracies. To reduce these fluctuations, you can use the avgSpeedWindow parameter to smooth the speed curve. The figure below illustrates the effect of avgSpeedWindow on both dense and sparse datasets.

Increase the avgSpeedWindow query parameter to smooth the speed values in the API more.

How gaps are calculated

There are 3 types of gaps provided. Each gap is a duration in seconds. You can frame it as answer to the question: How long does it take to get there?

  • Gap & GapEx - calculated with last known speed of the leader

  • GapChase & GapChaseEx - calculated with last known speed of the chaser

  • GapAverage & GapAverageEx - calculated with averge speed of the leader

the average speed of the reference device smoothens the gapAverage values in the API

Subsequent calculations

You can calculate on your side using the */current API.

Gap distance between two participants: fromStart (participant 1) - fromStart (participant 2)

Gap duration between two participants:

  • option 1: gapAverage (participant 2) - gapAverage (participant 1) => value with flatten peaks

  • option 2: eta (participant 2) - eta (participant 1)

  • option 3: gap (participant 2) - gap (participant 1)

Identify the leader: the smallest value of toFinish

Last updated