Select to view content in your preferred language

Routing on multiple layers (floors)

3647
3
12-03-2013 05:47 AM
MariusGächter
Emerging Contributor
Hello all

I have the following task to achieve:

general:
iOS app which displays the rooms of a building on a map.
the user can choose which floor of the building he wants to be visible.

routing:
the user can choose 2 rooms of the building (not necessarily on the same floor)
the app shows him the shortest path between the 2 selected rooms. (including the "floor-change")

solution:
I have already a ArcGIS NAServer with the network etc. (I'm not experienced with the ArcGIS Server side, I'm only the iOS developer)

I use AGSRouteTask etc. to address the problem and it works more or less.

No my problems:

1. Is it possible to define on which Layer a AGSStopGraphic is? If I only pass the coordinates to the service it chooses not always the right one.

2. Is it possible to get multiple lines from the RoutingService? Example:
I want to go from roomX on floor 1 to roomY on floor 2 --> now I would like to have a line from roomX to the elevator and another one from the elevator to roomY.

I hope my explanations are more or less clear.
(maybe a screenshot helps: [ATTACH=CONFIG]29527[/ATTACH]

I'm glad for every answer, question or solution.
0 Kudos
3 Replies
YueWu1
by Esri Regular Contributor
Esri Regular Contributor
Hello Marius,

The AGSStopGraphic inherited from AGSGraphic, therefore the layer properties can access from AGSStopGraphic, check this link about the AGSStopGraphic API reference might be helpful to understand:
https://developers.arcgis.com/en/ios/api-reference/interface_a_g_s_stop_graphic.html

For the multiple lines route, I assume it can refer to different stops due to the level of the floor changed. I found this method in< AGSRouteTaskParamters> called �??setStopsWithLayerDefinition�?� and �??setStopsWithFeatures�?�. I think the setStopsWithFeature might be closed to resolve the question since it means about the AGSStopGraphic objects, check this link:
https://developers.arcgis.com/en/ios/api-reference/interface_a_g_s_route_task_parameters.html

Also, I am curious about how much detail about the local network dataset you used?  Because the route task requires the service to contain a route analysis layer in order to compute routes. I am not really sure how much the code can override if the network dataset not create such detail to create different stops through the route. As a reference, here I attach the documentation about network dataset: http://resources.arcgis.com/en/help/main/10.2/index.html#//004700000007000000

I am still new in iOS and hope those tips can help you about this issue.

Thank you.
0 Kudos
MariusGächter
Emerging Contributor
Thanks a lot for your fast response.

I'll check the links you provided and give you a feedback whether it solved my problems.
0 Kudos
MariusGächter
Emerging Contributor

Also, I am curious about how much detail about the local network dataset you used?  Because the route task requires the service to contain a route analysis layer in order to compute routes. I am not really sure how much the code can override if the network dataset not create such detail to create different stops through the route. As a reference, here I attach the documentation about network dataset: http://resources.arcgis.com/en/help/main/10.2/index.html#//004700000007000000

I am still new in iOS and hope those tips can help you about this issue.

Thank you.



I checked your links and did some tests. They were really helpful for my understanding, however they didn't resolve my problems.

Concerning your question: I didn't configure the ArcGIS Server myself but there is a route analysis layer.


I'll try to clarify my problem maybe you'll have another idea:

[ATTACH=CONFIG]29643[/ATTACH]
On this screenshot you can see the main problem.
There is the basement in the background to give you somewhat of an overview.
The black and red lines are the routes of the ArcGIS-Service of the two floors of the building.
The red route is the route of the visible basement. The black one is the route of the ground floor, which is not visible.

the procedure

To select the "From Room" and the "To Room" the user simply clicks on the wanted room.
Once the user has selected his rooms, I take the point in the center of the room and pass the AGSPoint encapsulated in an AGSStopGraphic object to the ArcGIS service (using the setStopsWithFeatures method).

THE PROBLEM:
Obviously the ArcGIS service can't know which layer he has to take if I pass for example the center point of the blue room. So it takes the closest one i guess.

--> Is there a possibility to say to the server "I want to go from this point on THIS LAYER to that point on THAT LAYER!"

I already tried various stuff:

  • I tried to pass the layer using the attributes of the AGSStopGraphic object. (keyname: F_ELEV) But obviously it didn't work I guess the attributes aren't event considered by the server during the process of finding the route. I think they are useful if you want them to be returned after the routingtask is finished.

  • I passed a query to the ArcGIS service with the name of the segment of the route using the setStopsWithLayerDefinition. But that doesn't work at all I get an error



Thanks a lot for your help
0 Kudos