question

abrahim avatar image
0 Likes"
abrahim asked Kavika F commented

Retrieve coordinates from list as destinations on a GIS map

How can I retrieve the coordinates (I have got 50 coordinates) from my list and use them as destinations on a GIS map?

FlexSim 22.2.0
gis map coordinates
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Andrew O avatar image Andrew O commented ·

Hi @abrahim, was Kavika F's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

Kavika F avatar image
0 Likes"
Kavika F answered Kavika F commented

Hey @abrahim, you can set the latitude and longitude of a Point on a GIS map to the coordinates you have stored. You could do this programmatically if you've imported those points from an Excel sheet into a Global Table. Simply loop through each row in your table, create a GIS Point in the GIS Map, and set its coordinates.

· 4
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Maíra A avatar image Maíra A commented ·
@Kavika F can you give some details about how this loop could be created?


0 Likes 0 ·
Kavika F avatar image Kavika F ♦ Maíra A commented ·

Hey @Maíra A, here's an example of how you'd do this.

Let's say you have a GIS map and a table of coordinates:

1744752268276.png

1744752285605.png

You can run some code to (1) get the lat and long from the table, (2) create a GIS Point, and (3) set the coordinates of that point using the .setProperty() function on Objects. Points have a Latitude and Longitude property you can set.

Table table = Table("Coordinates");
for (int i = 1; i <= table.numRows; i++) {
  double lat = table[i][1];
  double long = table[i][2];
  Object point = Object.create("GIS::Point");
  point.setProperty("Latitude", lat);
  point.setProperty("Longitude", long);
}

It will look like this:

1744752484870.png

Here's the model (FlexSim 2025): GIS-Automation.fsm

To clear a GIS map of all points, you can clear the subnodes of the GISNavigator.

treenode nav = Model.find("GISNavigator");
nav.subnodes.clear();

Hope this helps.

0 Likes 0 ·
1744752268276.png (455.2 KiB)
1744752285605.png (337.8 KiB)
1744752484870.png (435.3 KiB)
gis-automation.fsm (31.5 KiB)
Maíra A avatar image Maíra A Kavika F ♦ commented ·
@Kavika F perfect explanation, thank you so much! My challenge is to test different combinations of these routes, gruping them by distance. How can i easly change the paths without clicking one by one?
0 Likes 0 ·
Show more comments