Skip to main content

Is it possible to obtain the coordinates of each point from a zone shape?

NaomiCostilla-1466
Original Poster

Hi everybody,

 

I would like to know if it is possible to obtain the coordinates of each point from a zone shape. There is this area and I would like to know the coordinates of each point (4 points).

 

N1 

Is it possible to obtain this information through a report? Or might it be possible to get this data from many zones?

 

 

 

I would appreciate your response

Join the conversation

You need to be logged in to reply to this post and participate in the Geotab Community discussions.

Top Answers

Hey, @NaomiCostilla-1466​!

 

This is not in a report that I can find, but you can obtain this information via the MyGeotab SDK. Go to the API Runner, log in, and choose Api call from the dropdown.

 

From there, change the "Device" to "Zone" so that your code looks like this:

api.call("Get", { "typeName": "Zone", "resultsLimit": 10 }, function(result) { console.log("Done: ", result); }, function(e) { console.error("Failed:", e); }); /*opt nomin*/

The results will show up in an array, and (I've redacted the exact points but) the coordinates will show up if you open the resulting arrays to see this view:

zone-point-arrayNOTE: The screenshot shows the wrong code to the left where "Device" hasn't yet been changed to "Zone"; however, the output display on the right still has the correct information.

 

If you've got a ton of zones in that database, you'll likely need to build in an IF statement to narrow down that zone and display only that in the console (let us know if you need help with that and I'm sure someone will chime in with extra info).

 

That should do it for you. Hope this helps. :)

 

Best,

Joy B

5 Replies

Hey, @NaomiCostilla-1466​!

 

This is not in a report that I can find, but you can obtain this information via the MyGeotab SDK. Go to the API Runner, log in, and choose Api call from the dropdown.

 

From there, change the "Device" to "Zone" so that your code looks like this:

api.call("Get", { "typeName": "Zone", "resultsLimit": 10 }, function(result) { console.log("Done: ", result); }, function(e) { console.error("Failed:", e); }); /*opt nomin*/

The results will show up in an array, and (I've redacted the exact points but) the coordinates will show up if you open the resulting arrays to see this view:

zone-point-arrayNOTE: The screenshot shows the wrong code to the left where "Device" hasn't yet been changed to "Zone"; however, the output display on the right still has the correct information.

 

If you've got a ton of zones in that database, you'll likely need to build in an IF statement to narrow down that zone and display only that in the console (let us know if you need help with that and I'm sure someone will chime in with extra info).

 

That should do it for you. Hope this helps. :)

 

Best,

Joy B

NaomiCostilla-1466
Original Poster

@JoyB-1408​ Thanks for your hard work on this!

 

Sure, glad it worked for ya! This was a really good question. :D

 

Best,

Joy B

 

@JoyB-1751​ Thank you for always having the answers!

 

I'm not sure if this is the correct place to ask this but here goes..

I have a customer asking for this information about zone coordinates as well but I need to present them in a table for 62 zones. I see that the API Call is providing all of the necessary information but how could I get it in a more usable format?

I have very little API/coding experience but I can follow directions.

Hey there, @paul-1080​!

 

Happy to help. I would typically recommend posting your questions like this in a separate topic, as that'll help other users to be informed that you have a question (e.g. if I'm unavailable to help or you'd like other perspectives) and also helps keep similar-but-different topics separate.

 

Anyway, having read your question more thoroughly, I will actually say that you'd be best off posting this as a separate question in the Developer discussions topic, since I know that LP and some of the other guys there will be able to help you a lot more than I can.

 

Sorry I can't be more useful here, but I think you'll get better and faster results there.

 

Hope this helps, and that you had a great weekend. :)

 

Best,

Joy B

Still have questions?