<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle18
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
 /* List Definitions */
 @list l0
        {mso-list-id:75328086;
        mso-list-type:hybrid;
        mso-list-template-ids:-350329750 -1083511204 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:20.25pt;
        text-indent:-18.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-font-family:Calibri;
        mso-bidi-font-family:"Times New Roman";}
@list l0:level2
        {mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level3
        {mso-level-tab-stop:108.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level4
        {mso-level-tab-stop:144.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level5
        {mso-level-tab-stop:180.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level6
        {mso-level-tab-stop:216.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level7
        {mso-level-tab-stop:252.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level8
        {mso-level-tab-stop:288.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level9
        {mso-level-tab-stop:324.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span lang=EN-GB>Hi,<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p>

<p class=MsoNormal><span lang=EN-GB>I am trying to make a query where is given
the nearest aid station (hospital / fire station – either which passed
through a parameter). Nearest being on the road network itself, thus I am using
pgRouting’s function : Shooting_star. <o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p>

<p class=MsoNormal><span lang=EN-GB>My idea to tackle the problem is :<o:p></o:p></span></p>

<p class=MsoListParagraph style='margin-left:20.25pt;text-indent:-18.0pt;
mso-list:l0 level1 lfo2'><![if !supportLists]><span lang=EN-GB><span
style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>         
</span></span></span><![endif]><span lang=EN-GB>Make an expansion of the
accident of 20 KM<o:p></o:p></span></p>

<p class=MsoListParagraph style='margin-left:20.25pt;text-indent:-18.0pt;
mso-list:l0 level1 lfo2'><![if !supportLists]><span lang=EN-GB><span
style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>         
</span></span></span><![endif]><span lang=EN-GB>Check which hospital / fire
station is within that expansion<o:p></o:p></span></p>

<p class=MsoListParagraph style='margin-left:20.25pt;text-indent:-18.0pt;
mso-list:l0 level1 lfo2'><![if !supportLists]><span lang=EN-GB><span
style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>         
</span></span></span><![endif]><span lang=EN-GB>Find the shortest distance
between every hospital / fire station to the accident location<o:p></o:p></span></p>

<p class=MsoListParagraph style='margin-left:20.25pt;text-indent:-18.0pt;
mso-list:l0 level1 lfo2'><![if !supportLists]><span lang=EN-GB><span
style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>         
</span></span></span><![endif]><span lang=EN-GB>Prepare the route for the
shortest distance<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p>

<p class=MsoNormal><span lang=EN-GB>What I am finding hard to implement is the
part where to find the shortest distance on the road network.  It is taking
more or a less a minute there. Any idea how I can improve it please?<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p>

<p class=MsoNormal><span lang=EN-GB>This is my code :  <a
href="http://yancho.pastebin.com/f75683d8b">http://yancho.pastebin.com/f75683d8b</a>
- The section I am worried about is : 72 – 96 (highlighted in yellow)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p>

<p class=MsoNormal><span lang=EN-GB>Any idea is extremely appreciated.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p>

<p class=MsoNormal><span lang=EN-GB>Regards<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p>

<p class=MsoNormal><span lang=EN-GB>Matthew<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p> </o:p></span></p>

<div class=MsoNormal align=center style='text-align:center'><span
style='font-size:12.0pt;font-family:"Times New Roman","serif"'>

<hr size=2 width="100%" align=center>

</span></div>

<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'>I
am using the free version of SPAMfighter for private users.<br>
It has removed 27617 spam emails to date.<br>
Paying users do not have this message in their emails.<br>
Try <a href="http://www.spamfighter.com/len">SPAMfighter</a> for free now!<o:p></o:p></span></p>

</div>

</body>

</html>