Skip to content

Commit

Permalink
disambiguate lat & lon
Browse files Browse the repository at this point in the history
  • Loading branch information
windytan committed Dec 11, 2016
1 parent 4bae8a0 commit 9137b32
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
19 changes: 14 additions & 5 deletions schema.json
Expand Up @@ -212,11 +212,20 @@
"type": "string"
},
"coordinates": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number"
"description": "Affected point or route",
"type": "object",
"properties": {
"lat": {
"description": "Degrees North",
"type": "number",
"minimum": -90,
"maximum": 90
},
"lon": {
"description": "Degrees East",
"type": "number",
"minimum": -180,
"maximum": 180
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions src/tmc/tmc.cc
Expand Up @@ -376,8 +376,8 @@ void decodeLocation(const LocationDatabase& db, uint16_t ltn,

for (int i=0; i < static_cast<int>(pts.size()); i++) {
// (*jsroot)["tmc"]["message"]["locations"].append(pts[i].lcd);
(*jsroot)["tmc"]["message"]["coordinates"][i].append(pts[i].lat);
(*jsroot)["tmc"]["message"]["coordinates"][i].append(pts[i].lon);
(*jsroot)["tmc"]["message"]["coordinates"][i]["lat"] = pts[i].lat;
(*jsroot)["tmc"]["message"]["coordinates"][i]["lon"] = pts[i].lon;
}

if (pts.size() > 1 && pts.at(0).name1.length() > 0 &&
Expand Down

0 comments on commit 9137b32

Please sign in to comment.