Hi :-)
Whilst working on a geotagging program using opentopodata.org's API, I noticed some error when parsing the server's answer to a QJsonDocument. It yielded QJsonParseError::IllegalNumber. After having had a closer look, this happened when using the emod2018 dataset.
Example: Requesting https://api.opentopodata.org/v1/emod2018?locations=50,11 returns
{
"results": [
{
"elevation": NaN,
"location": {
"lat": 50.0,
"lng": 11.0
}
}
],
"status": "OK"
}
The elevation key's value is NaN (instead of null, as the other datasets return when a coordinate is out of bounds). This is, per RFC 4627, not permitted (cf. https://tools.ietf.org/html/rfc4627#section-2.4):
Numeric values that cannot be represented as sequences of digits
(such as Infinity and NaN) are not permitted.
Most probably, this is what QJsonDocument::fromJson complains about.
Anyway, thanks about this great piece of software and the great service you provide :-)
Hi :-)
Whilst working on a geotagging program using opentopodata.org's API, I noticed some error when parsing the server's answer to a
QJsonDocument. It yieldedQJsonParseError::IllegalNumber. After having had a closer look, this happened when using theemod2018dataset.Example: Requesting
https://api.opentopodata.org/v1/emod2018?locations=50,11returnsThe
elevationkey's value isNaN(instead ofnull, as the other datasets return when a coordinate is out of bounds). This is, per RFC 4627, not permitted (cf. https://tools.ietf.org/html/rfc4627#section-2.4):Most probably, this is what
QJsonDocument::fromJsoncomplains about.Anyway, thanks about this great piece of software and the great service you provide :-)