Select to view content in your preferred language

Routing Error Between Two Addresses

2667
10
10-12-2011 04:47 AM
DavidHowell
Emerging Contributor
I am currently using ArcGIS Online by consuming the web services located at:

http://premiumtasks.arcgisonline.com/Server/services/NetworkAnalysis/ESRI_Route_NA/MapServer/NAServe...{our token}

However, when I try to get routing between the following two addresses, I get this error..


"[End Site Name]" in "Stops" is on a non-traversable network element position. Invalid locations detected.


Here are the two addresses:

Start:  4145 So Alameda, Corpus Christi, TX 78414
End: 4525 Gollihar, Corpus Christi, TX 78411

The End address does get a valid geocoding from ESRI, so it would seem that the address is fine as far as ESRI finding it.

I've tried using a number of different start addresses, but it always gives this error for this end address.

Here are the NAServerRouteParams that I am explicitly setting with our code...


routeParams.DirectionsLengthUnits = esriNetworkAttributeUnits.esriNAUMiles;
routeParams.FindBestSequence = false;
routeParams.IgnoreInvalidLocations = false;
routeParams.PreserveFirstStop = true;
routeParams.PreserveLastStop = true;
routeParams.ReturnCompactDirections = true;
routeParams.ReturnDirections = false;
routeParams.ReturnMap = false;
routeParams.ReturnRouteGeometries = false;
routeParams.ReturnStops = false;


Any ideas?
Tags (2)
0 Kudos
10 Replies
MikeMinami
Esri Notable Contributor
Here's some info from the team that manages this service...


The street where this address is located has been marked as a Restricted Service Road. That�??s the reason why users are not able to route to 4245 Gollihar Road.

They can use this attribute doNotLocateOnRestrictedElements and set it to true if they want to bypass the restrictions.


Thanks,

Mike
0 Kudos
DavidHowell
Emerging Contributor
Thanks for the reply Mike.

I do not have that property to set.  I have attached screenshots of the properties that I have available from the proxy class that's generated by Visual Studio.

Could it be done using the RestrictionAttributeNames property?
0 Kudos
MikeMinami
Esri Notable Contributor
0 Kudos
DavidHowell
Emerging Contributor
Awesome reference.
0 Kudos
DavidHowell
Emerging Contributor
Nevermind, I found the property.
0 Kudos
DavidHowell
Emerging Contributor
I set the DoNotLocateOnRestrictedElements property to true, and I still get the same error message.
0 Kudos
MikeMinami
Esri Notable Contributor
Don't you want to set the value to false? Because you want to locate on this road. True seems to imply the current behavior, where you can't locate on that street. I think the original info from our developer was in error.

Mike
0 Kudos
DavidHowell
Emerging Contributor
I have tried both true and false, and both give the same error.

Here is the code where I changed it.

NAServerPropertySets serverStopsPropertySets = new NAServerPropertySets();
serverStopsPropertySets.PropertySets = stopPropertySets.ToArray();
routeParams.Stops = serverStopsPropertySets;
routeParams.Stops.DoNotLocateOnRestrictedElements = false;


I thought this was all I had to do.
0 Kudos
MikeMinami
Esri Notable Contributor
Here are two more suggestions from our developer. I think you want suggestion 2...

1st suggestion:
Setting DoNotLocateOnRestrictedElements to True in this case will move the stop to the nearest traversable street. Make sure he also specifies the �??Specified�?� flag:

.DoNotLocateOnRestrictedElements = true
.DoNotLocateOnRestrictedElementsSpecified = true

The reason is due to the way how .NET generates proxies for optional SOAP params.

2nd suggestion:
If user wants the route to go through this particular street, he will need to turn off the �??Service Roads�?� restriction which by default makes the street non-traversable.

On the 2nd page of this OMD http://help.arcgis.com/en/sdk/10.0/Arcobjects_net/pdf/NetworkAnalystObjectModel.pdf
There is RestrictionAttributeNames:IStringArray parameter: ask him to remove �??Service Roads�?� from it before making the Solver request.
0 Kudos