Hi,
I have some data I'd like to import into Traccar, and I'll be using the API to do it. (I love having an API to do stuff like this - thanks for providing it!)
I'm comfortable with the docs describing the API calls but I'm new to Traccar and I'm having difficulty understanding the vocabulary and data model.
To be concrete: I have a couple of million records like this, and I'd like to import them into Traccar with the best fidelity I can.
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
171.725274,
-43.161877
]
},
"properties": {
"battery_status": null,
"ping": null,
"battery": null,
"tracker_id": "google-maps-timeline-export",
"topic": "Google Maps Timeline Export",
"altitude": null,
"longitude": "171.725274",
"velocity": null,
"trigger": null,
"bssid": null,
"ssid": null,
"connection": null,
"vertical_accuracy": null,
"accuracy": null,
"timestamp": 1444863716,
"latitude": "-43.161877",
"mode": null,
"inrids": [],
"in_regions": [],
"city": null,
"country": "New Zealand",
"geodata": {
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
171.7238527,
-43.159522
]
},
"properties": {
"name": "Proposed Sidle 73 extension from Dixons to Craigieburn Campground",
"type": "house",
"state": "Canterbury",
"county": "Selwyn District",
"extent": [
171.7186489,
-43.1528212,
171.7316202,
-43.1670156
],
"osm_id": 284390097,
"street": "Broken River Road",
"country": "New Zealand",
"osm_key": "highway",
"osm_type": "W",
"osm_value": "proposed",
"countrycode": "NZ"
}
},
"course": null,
"course_accuracy": null,
"external_track_id": null,
"track_id": null,
"country_name": null
}
}
(They're not all Google Timeline exports - they are all Dawarich exports in 'GeoJSON' format.)
There are some obvious bits to capture, like latitude, longitude, altitude, and timestamp. I'd also like to capture some less-obvious bits like country, tracker_id, and topic. I'm not sure about the geodata - I plan on installing traccar-geocoder soon, maybe that will be sufficient?
I guess I need to create a Device to import the positions into. I can do that, but I can't see a way in the REST API to store each of the locations. Do I use the OsmAnd (https://www.traccar.org/osmand/) JSON format and post to the root of the site? Is there a better way?
And what do I do about the data I want to capture that isn't in the OsmAnd format? Do I create them as 'attributes' somewhere? Or do I put them in the OsmAnd 'extras' property?
I'd really appreciate any insights or advice here.
Many thanks.
Hi,
I have some data I'd like to import into Traccar, and I'll be using the API to do it. (I love having an API to do stuff like this - thanks for providing it!)
I'm comfortable with the docs describing the API calls but I'm new to Traccar and I'm having difficulty understanding the vocabulary and data model.
To be concrete: I have a couple of million records like this, and I'd like to import them into Traccar with the best fidelity I can.
{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [ 171.725274, -43.161877 ] }, "properties": { "battery_status": null, "ping": null, "battery": null, "tracker_id": "google-maps-timeline-export", "topic": "Google Maps Timeline Export", "altitude": null, "longitude": "171.725274", "velocity": null, "trigger": null, "bssid": null, "ssid": null, "connection": null, "vertical_accuracy": null, "accuracy": null, "timestamp": 1444863716, "latitude": "-43.161877", "mode": null, "inrids": [], "in_regions": [], "city": null, "country": "New Zealand", "geodata": { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ 171.7238527, -43.159522 ] }, "properties": { "name": "Proposed Sidle 73 extension from Dixons to Craigieburn Campground", "type": "house", "state": "Canterbury", "county": "Selwyn District", "extent": [ 171.7186489, -43.1528212, 171.7316202, -43.1670156 ], "osm_id": 284390097, "street": "Broken River Road", "country": "New Zealand", "osm_key": "highway", "osm_type": "W", "osm_value": "proposed", "countrycode": "NZ" } }, "course": null, "course_accuracy": null, "external_track_id": null, "track_id": null, "country_name": null } }(They're not all Google Timeline exports - they are all Dawarich exports in 'GeoJSON' format.)
There are some obvious bits to capture, like latitude, longitude, altitude, and timestamp. I'd also like to capture some less-obvious bits like country, tracker_id, and topic. I'm not sure about the geodata - I plan on installing traccar-geocoder soon, maybe that will be sufficient?
I guess I need to create a Device to import the positions into. I can do that, but I can't see a way in the REST API to store each of the locations. Do I use the OsmAnd (https://www.traccar.org/osmand/) JSON format and post to the root of the site? Is there a better way?
And what do I do about the data I want to capture that isn't in the OsmAnd format? Do I create them as 'attributes' somewhere? Or do I put them in the OsmAnd 'extras' property?
I'd really appreciate any insights or advice here.
Many thanks.