# Routing with one stopping point

**URL:** <https://community.thinkgeo.com/t/routing-with-one-stopping-point/7567>\
**Category:** Routing\
**Created:** [October 18, 2011, 8:40pm UTC](https://community.thinkgeo.com/t/routing-with-one-stopping-point/7567 "2011-10-18T20:40:33Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kaori](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/kaori/32/16175_2.png) [@Kaori](https://community.thinkgeo.com/u/Kaori)\
**Post date:** [October 18, 2011, 8:40pm UTC](https://community.thinkgeo.com/t/routing-with-one-stopping-point/7567/1 "2011-10-18T20:40:33Z")

</div>

When&nbsp;using&nbsp;one&nbsp;of&nbsp;follwing&nbsp;method,

RoutingEngine.GetRouteWithStops(start\_point,&nbsp;IEnumerable  
\<pointshape\>)  
  
RoutingEngine.GetRouteViaVisitStops(start\_point,&nbsp;IEnumerable  
\<pointshape\>)\</pointshape\>  
\</pointshape\>

with&nbsp;only&nbsp;one&nbsp;stopping&nbsp;point&nbsp;(=&nbsp;IEnumerable  
\<pointshape\>.Count&nbsp;==&nbsp;1)),&nbsp;it&nbsp;would&nbsp;hang&nbsp;up&nbsp;in&nbsp;here&nbsp;when&nbsp;it&nbsp;runs.&nbsp;It&nbsp;works&nbsp;fine&nbsp;if&nbsp;the&nbsp;count&nbsp;property&nbsp;is&nbsp;more&nbsp;than&nbsp;one.\</pointshape\>

&nbsp;

---

<div class="post-metadata">

**Author:** ![Gary2](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/g/49beb7/32.png) [@Gary2](https://community.thinkgeo.com/u/Gary2)\
**Post date:** [October 19, 2011, 2:44pm UTC](https://community.thinkgeo.com/t/routing-with-one-stopping-point/7567/2 "2011-10-19T14:44:22Z")

</div>

Hello&nbsp;Kaori,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thank&nbsp;you&nbsp;for&nbsp;your&nbsp;post,&nbsp;I&nbsp;have&nbsp;tested&nbsp;this&nbsp;situation&nbsp;in&nbsp;our&nbsp;HowDoISamples,&nbsp;sorry&nbsp;I&nbsp;can’t&nbsp;recreate&nbsp;the&nbsp;problem.&nbsp;  
&nbsp;&nbsp;  
&nbsp;In&nbsp;the&nbsp;TSPAnalysisWithFixedEnds&nbsp;Sample.&nbsp;  
&nbsp;TspRoutingResult&nbsp;routingResult&nbsp;=&nbsp;routingEngine.GetRouteViaVisitStops(routingLayer.StartPoint,&nbsp;routingLayer.EndPoint,&nbsp;routingLayer.StopPoints,&nbsp;int.Parse(txtIterations.Text));&nbsp;  
&nbsp;I&nbsp;have&nbsp;removed&nbsp;the&nbsp;other&nbsp;stopPoints&nbsp;only&nbsp;one&nbsp;left,&nbsp;the&nbsp;result&nbsp;is&nbsp;fine&nbsp;and&nbsp;fast.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Can&nbsp;you&nbsp;provide&nbsp;some&nbsp;sample&nbsp;code?&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Gary

---

<div class="post-metadata">

**Author:** ![Kaori](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/kaori/32/16175_2.png) [@Kaori](https://community.thinkgeo.com/u/Kaori)\
**Post date:** [October 27, 2011, 5:18pm UTC](https://community.thinkgeo.com/t/routing-with-one-stopping-point/7567/3 "2011-10-27T17:18:51Z")

</div>

&nbsp;Hi,&nbsp;thanks&nbsp;for&nbsp;the&nbsp;response,&nbsp;and&nbsp;sorry&nbsp;for&nbsp;coming&nbsp;back&nbsp;late.

&nbsp;  
Here&nbsp;is&nbsp;the&nbsp;test&nbsp;project&nbsp;that&nbsp;you&nbsp;can&nbsp;see.  
dl.dropbox.com/u/11338429/ThinkGeoTest\_RoutingError.zip  
&nbsp;  
The&nbsp;version&nbsp;of&nbsp;routing&nbsp;extension&nbsp;is&nbsp;5.0.159.0  
&nbsp;  
I&nbsp;think&nbsp;you&nbsp;already&nbsp;have&nbsp;it&nbsp;but&nbsp;you&nbsp;can&nbsp;download&nbsp;the&nbsp;OSM&nbsp;routing&nbsp;data&nbsp;from&nbsp;here  
dl.dropbox.com/u/11338429/CA.zip  
&nbsp;  
The&nbsp;text&nbsp;file&nbsp;in&nbsp;the&nbsp;project&nbsp;named&nbsp;CA\_Test\_01.txt&nbsp;contains&nbsp;the&nbsp;starting&nbsp;point&nbsp;(the&nbsp;first&nbsp;line),&nbsp;and&nbsp;the&nbsp;stopping&nbsp;points&nbsp;(from&nbsp;the&nbsp;second&nbsp;line).  
&nbsp;  
RoutingEngine.GetRouteViaVisitStops(start\_point,&nbsp;IEnumerable  
\<pointshape\>)\</pointshape\>  
  
I&nbsp;didn't&nbsp;mention&nbsp;in&nbsp;the&nbsp;previous&nbsp;post,&nbsp;but&nbsp;**1)&nbsp;**with&nbsp;no&nbsp;stopping&nbsp;point&nbsp;(only&nbsp;the&nbsp;first&nbsp;line&nbsp;in&nbsp;txt&nbsp;file)&nbsp;will&nbsp;throw&nbsp;an&nbsp;index&nbsp;out&nbsp;of&nbsp;range&nbsp;exception.  
**2)&nbsp;**With&nbsp;one&nbsp;stopping&nbsp;point&nbsp;(two&nbsp;lines&nbsp;in&nbsp;the&nbsp;txt&nbsp;file),&nbsp;it&nbsp;will&nbsp;hang-up&nbsp;the&nbsp;process..  
With&nbsp;more&nbsp;than&nbsp;one&nbsp;stopping&nbsp;points,&nbsp;it&nbsp;seems&nbsp;fine.  
&nbsp;  
Also,&nbsp;this&nbsp;is&nbsp;additional&nbsp;too&nbsp;but&nbsp;  
RoutingEngine.GetRouteViaVisitStops(start\_point,&nbsp;end\_point,&nbsp;IEnumerable,&nbsp;iterations&nbsp;  
\<pointshape\>)\</pointshape\>  
  
this&nbsp;overloaded&nbsp;method&nbsp;causes&nbsp;similar&nbsp;issue;&nbsp;3**)**&nbsp;it&nbsp;throws&nbsp;the&nbsp;index&nbsp;out&nbsp;of&nbsp;range&nbsp;exceptions&nbsp;when&nbsp;the&nbsp;stopping&nbsp;point&nbsp;is&nbsp;0.  
&nbsp;  
I&nbsp;mentioned&nbsp;GetRouteWithStops&nbsp;too,&nbsp;but&nbsp;I&nbsp;can't&nbsp;see&nbsp;GetRouteWithStops&nbsp;method&nbsp;in&nbsp;the&nbsp;newest&nbsp;build,&nbsp;although&nbsp;the&nbsp;last&nbsp;build&nbsp;that&nbsp;I&nbsp;used&nbsp;warned&nbsp;me&nbsp;GetRouteViaVisitStops&nbsp;is&nbsp;obsolete.&nbsp;(Well,&nbsp;it's&nbsp;fine&nbsp;to&nbsp;me&nbsp;either&nbsp;one&nbsp;as&nbsp;long&nbsp;as&nbsp;it&nbsp;works)  
&nbsp;  
So&nbsp;please&nbsp;try&nbsp;three&nbsp;things&nbsp;above&nbsp;with&nbsp;my&nbsp;project&nbsp;and&nbsp;let&nbsp;me&nbsp;know..  
&nbsp;  
Thank&nbsp;you&nbsp;so&nbsp;much&nbsp;for&nbsp;your&nbsp;help.  
&nbsp;  
Kaori

---

<div class="post-metadata">

**Author:** ![Gary2](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/g/49beb7/32.png) [@Gary2](https://community.thinkgeo.com/u/Gary2)\
**Post date:** [November 1, 2011, 2:33pm UTC](https://community.thinkgeo.com/t/routing-with-one-stopping-point/7567/4 "2011-11-01T14:33:44Z")

</div>

Hello&nbsp;Kaori,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;the&nbsp;sample,&nbsp;I&nbsp;can&nbsp;recreate&nbsp;the&nbsp;problem,&nbsp;we&nbsp;have&nbsp;obsolete&nbsp;the&nbsp;GetRouteViaVisitStops&nbsp;and&nbsp;GetRouteViaVisitStops&nbsp;function&nbsp;and&nbsp;use&nbsp;new&nbsp;GetRoute&nbsp;overload&nbsp;function&nbsp;to&nbsp;replace&nbsp;them,&nbsp;looks&nbsp;like&nbsp;there&nbsp;are&nbsp;a&nbsp;some&nbsp;problems&nbsp;in&nbsp;this&nbsp;process,&nbsp;we&nbsp;will&nbsp;find&nbsp;it&nbsp;and&nbsp;fix&nbsp;it&nbsp;very&nbsp;soon.&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;will&nbsp;let&nbsp;you&nbsp;know&nbsp;when&nbsp;we&nbsp;make&nbsp;progress.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;your&nbsp;patience&nbsp;and&nbsp;sorry&nbsp;for&nbsp;the&nbsp;inconvenience.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Gary

---

<div class="post-metadata">

**Author:** ![Kaori](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/kaori/32/16175_2.png) [@Kaori](https://community.thinkgeo.com/u/Kaori)\
**Post date:** [November 29, 2011, 2:40am UTC](https://community.thinkgeo.com/t/routing-with-one-stopping-point/7567/5 "2011-11-29T02:40:22Z")

</div>

Any&nbsp;updates?&nbsp;  
&nbsp;&nbsp;  
&nbsp;Using&nbsp;5.5.17.0,&nbsp;and&nbsp;overload&nbsp;GetRoute&nbsp;function,&nbsp;it&nbsp;still&nbsp;seems&nbsp;to&nbsp;have&nbsp;the&nbsp;same&nbsp;issue…

---

<div class="post-metadata">

**Author:** ![Gary2](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/g/49beb7/32.png) [@Gary2](https://community.thinkgeo.com/u/Gary2)\
**Post date:** [November 29, 2011, 12:03pm UTC](https://community.thinkgeo.com/t/routing-with-one-stopping-point/7567/6 "2011-11-29T12:03:53Z")

</div>

Hello&nbsp;Kaori,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Sorry&nbsp;for&nbsp;inconvenience,&nbsp;our&nbsp;develop&nbsp;team&nbsp;still&nbsp;working&nbsp;on&nbsp;that,&nbsp;I&nbsp;will&nbsp;post&nbsp;here&nbsp;as&nbsp;soon&nbsp;as&nbsp;I&nbsp;get&nbsp;the&nbsp;result.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;your&nbsp;patience.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Gary

---

<div class="post-metadata">

**Author:** ![Kaori](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/kaori/32/16175_2.png) [@Kaori](https://community.thinkgeo.com/u/Kaori)\
**Post date:** [January 10, 2012, 5:19pm UTC](https://community.thinkgeo.com/t/routing-with-one-stopping-point/7567/7 "2012-01-10T17:19:37Z")

</div>

Any&nbsp;update?

---

<div class="post-metadata">

**Author:** ![Gary2](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/g/49beb7/32.png) [@Gary2](https://community.thinkgeo.com/u/Gary2)\
**Post date:** [January 13, 2012, 2:12pm UTC](https://community.thinkgeo.com/t/routing-with-one-stopping-point/7567/8 "2012-01-13T14:12:56Z")

</div>

Hello&nbsp;Kaori,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;your&nbsp;patience&nbsp;and&nbsp;sorry&nbsp;for&nbsp;waiting.&nbsp;for&nbsp;all&nbsp;of&nbsp;the&nbsp;three&nbsp;question,&nbsp;here&nbsp;is&nbsp;the&nbsp;answer:&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;For&nbsp;issue&nbsp;1&nbsp;and&nbsp;3,&nbsp;we&nbsp;do&nbsp;not&nbsp;support&nbsp;the&nbsp;following&nbsp;conditions.&nbsp;  
&nbsp;1,&nbsp;the&nbsp;start&nbsp;or&nbsp;the&nbsp;end&nbsp;is&nbsp;null.&nbsp;&nbsp;  
&nbsp;2,&nbsp;the&nbsp;start&nbsp;and&nbsp;the&nbsp;end&nbsp;are&nbsp;the&nbsp;same&nbsp;point.&nbsp;&nbsp;  
&nbsp;3,&nbsp;the&nbsp;stops&nbsp;are&nbsp;empty.&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;  
&nbsp;So&nbsp;if&nbsp;you&nbsp;have&nbsp;these&nbsp;invalid&nbsp;points&nbsp;to&nbsp;route,&nbsp;please&nbsp;validate&nbsp;as&nbsp;early&nbsp;as&nbsp;possible&nbsp;in&nbsp;the&nbsp;application.&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;  
&nbsp;For&nbsp;issue&nbsp;2,&nbsp;it’s&nbsp;a&nbsp;bug&nbsp;where&nbsp;goes&nbsp;into&nbsp;the&nbsp;dead&nbsp;loop.&nbsp;We&nbsp;have&nbsp;fixed&nbsp;it.&nbsp;Please&nbsp;get&nbsp;the&nbsp;latest&nbsp;version&nbsp;and&nbsp;have&nbsp;a&nbsp;try.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Please&nbsp;let&nbsp;us&nbsp;know&nbsp;if&nbsp;you&nbsp;still&nbsp;meet&nbsp;problem&nbsp;in&nbsp;issue2.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Gary&nbsp;
