Format for GPS geopoint

Joshua Bailey 201 Reputation points
2020-10-28T16:01:43.26+00:00

I'm sure this should be really simple to find but i can't see this info anywhere.

What is the required format for the location property on Iot Central? I can see it is geopoint but i have formatted my data as per the below and this doesn't work:

"gps":"lat: 53.065151, lon: -2.478252"

gps in the data handle, i can see the data is sat against the correct data handle in raw data but none of the map tiles are working so i am presuming i have the wrong format?

Azure IoT Central
Azure IoT Central
An Azure hosted internet of things (IoT) application platform.
364 questions
Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
736 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. rbrundritt 18,686 Reputation points Microsoft Employee
    2020-10-28T23:11:34.193+00:00

    I believe it expects and object with lat and lon properties, not a string. For example:

    "devicelocation": { "lat": 53.065151, "lon": -2.478252 }
    
    0 comments No comments

  2. Joshua Bailey 201 Reputation points
    2020-10-29T16:26:03.577+00:00

    I’ve spent most of the day trying to debug this and it’s bizarre, i think i’ve now managed to get everything in the right place but i still get blank maps “Awaiting Data”. I have tried both with and wihout lat: lon: and that made no difference. I don’t really know who to ask as Microsoft don’t appear to offer any kind of support? Any ideas welcome!

    My code to get to this point is (summarised a little):

    location_format =(String(GPS.latitudeDegrees) + "," + String(GPS.longitudeDegrees));
    createEventPayload(27,location_format,longi,lati);

    void createEventPayload(int temp, String location_format, float longi, float lati)
    {
    temp=32;
    JsonWriterStatic<256> jw;
    {
    JsonWriterAutoObject obj(&jw);
    jw.insertKeyValue("temp", temp);
    jw.insertKeyValue("gps", location_format);

    }
    Particle.publish("Test_data", jw.getBuffer(), PRIVATE);
    Serial.println("Sent Test Data");
    Serial.println(jw.getBuffer());

    }

    36152-presentation1.jpg


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.