openSenseMap-API
openSenseMap-API copied to clipboard
lat/long is confused in api documentation
Hi, I encountered a problem with latitude/longitude in the csv submission. In the documentation https://docs.opensensemap.org/#parameter-examples-Measurements-postNewMeasurements-0_0_0-2 The example for csv is:
sensorID,value
anotherSensorId,value,RFC 3339-timestamp
sensorIDtheThird,value
anotherSensorId,value,RFC 3339-timestamp,longitude,latitude
anotherSensorId,value,RFC 3339-timestamp,longitude,latitude,height
...
However, I have to submit latitude/longitude to get the right location. If I submit latitude/longitude the sensor readings are at the correct location but in the opensensemap overview, the sensebox still zooms in a way that both locations (the lat/long and the long/lat location) are in the view. See picture below:
Hey, thanks for taking the time for writing down the issue.
Could you provide the actual csv you've sent?
Hi, this is a post request that I printed into the serial. Does this help? Edit: This is the lon/lat version
POST /boxes/5f775f2fe6255b001bd228ed/data HTTP/1.1
Host: ingress.opensensemap.org
Content-Type: text/csv
Connection: close
Content-Length: 810
5f775f2fe6255b001bd228f1, 42.97,2020-10-08T14:37:30Z,8.541694,47.376888, 100.00
5f775f2fe6255b001bd228f0, 22.12,2020-10-08T14:37:30Z,8.541694,47.376888, 100.00
5f775f2fe6255b001bd228ef, 96748.00,2020-10-08T14:37:30Z,8.541694,47.376888, 100.00
5f775f2fe6255b001bd228ee, 0.50,2020-10-08T14:37:30Z,8.541694,47.376888, 100.00
5f79c4b5e6255b001bd47c8e, 409.00,2020-10-08T14:37:30Z,8.541694,47.376888, 100.00
5f79c4b5e6255b001bd47c8f, 1.00,2020-10-08T14:37:30Z,8.541694,47.376888, 100.00
5f79c4b5e6255b001bd47c90, 24.32,2020-10-08T14:37:30Z,8.541694,47.376888, 100.00
5f79c4b5e6255b001bd47c91, 100.00,2020-10-08T14:37:30Z,8.541694,47.376888, 100.00
5f79c4b5e6255b001bd47c92, 96639.00,2020-10-08T14:37:30Z,8.541694,47.376888, 100.00
The example you've posted looks fine. The order is exactly as specified in the docs (longitude,latitude). Assuming your location should be in Zurich/Switzerland.
I also used your csv for testing against our API and the measurement ends up in Zurich. So It seems the documenation is correct
I think its just confusing that the docs list objects this way
{ "lat": 51.972, "lng": 7.684, "height": 66.6 }
whereas when for csv's (where the order actually matters) it is:
[7.684, 51.972, 66.6]