<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=utf-8"><meta name=Generator content="Microsoft Word 15 (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;}
@font-face
        {font-family:"Trebuchet MS";
        panose-1:2 11 6 3 2 2 2 2 2 4;}
@font-face
        {font-family:"trebuchet ms \,sans-serif";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;}
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
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></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 bgcolor=white lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Andrew,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Sounds like you are asking for virtual points functionality.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>In the table we presented I think we had logic to put in edge_id, fraction.  Though we didn't have time to cover it in the workshop so we took it out of the presentation.  I think we still have it in the code.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Anyrate if you use those which gives you an interpolated point along the edge, you can use the function:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>pgr_withPointsDD which works with virtual nodes  instead of pgr_drivingDistance<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><a href="http://docs.pgrouting.org/latest/en/pgr_withPointsDD.html#pgr-withpointsdd">http://docs.pgrouting.org/latest/en/pgr_withPointsDD.html#pgr-withpointsdd</a><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Hope that helps,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Regina<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext'> Pgrouting-users [mailto:pgrouting-users-bounces@lists.osgeo.org] <b>On Behalf Of </b>Stephen Woodbridge<br><b>Sent:</b> Saturday, September 02, 2017 9:39 AM<br><b>To:</b> Andrew Wooley <awooley@mountainland.org>; pgRouting Users List <pgrouting-users@lists.osgeo.org><br><b>Subject:</b> Re: [pgrouting-users] PG Routing Question<o:p></o:p></span></p></div></div><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p><div><p class=MsoNormal style='margin-left:.5in'>Hi Andrew,<br><br>This is a really good question it gets asked every so often. So I will cc the pgRouting-users list with my response.<br><br>The routing algorithm computes the cost to get to each node following the road network. If the cost is time based then it takes the speed of the road segments into account. You can't do meaningful interpolation between points without taking into account the edges. Think about a path following the letter "S" or "C",  interpolation between the end points does not take into account the path of the letter or in our case the roads. Also if you pick two arbitrary nodes they may or may not be connected directly. So interpolation is not going to make sense.<br><br>One option might be to examine each edge, and get the values of the their respective nodes, then interpolate along the edge and add the interpolated points into a temporary table, then you can union the original points plus the interpolated points into pgr_pointsAsPolygon()<br><br>Another solution that might work for you if you need better resolution but this would be the same as above and require more work, would be to take every edge and break it into 4 equal edges and replace the original edge so that instead of having one edge and 2 node, you now have 4 edges and 5 nodes. Then you can rebuild the topology and your driving distance will have a high density of node.<br><br>I hope this helps,<br>  -Steve<br><br>On 9/1/2017 10:52 AM, Andrew Wooley wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal style='margin-left:.5in'>Stephen <o:p></o:p></p><div><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>I attended your workshop at the FOSS4G Boston conference. I really enjoyed it and learned a lot. I have been working on some projects using it.<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>I came across an issue that I was hoping that you could help me. I am using the following example function from Regina's workshop:<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p></div><div><div><p class=MsoNormal style='margin-left:.5in'>SELECT <o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>    1 As id, <o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>    ST_SetSRID(<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>        pgr_pointsAsPolygon(<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>            $$<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>                SELECT D.seq AS id, ST_X(V.the_geom) AS x, ST_Y(V.the_geom) As y <o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>                FROM <o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>                    pgr_drivingDistance(<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>                        $sql$<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>                            SELECT gid As id, source, target, length_m AS cost, length_m AS reverse_cost FROM osm_ways<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>                        $sql$,<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>                        (SELECT id FROM osm_ways_vertices_pgr N ORDER BY N.the_geom <-> ST_SetSRID(ST_Point(-111.69429,40.28984),4326) LIMIT 1), <o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>                        500, <o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>                        TRUE<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>                    ) D INNER JOIN <o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>                    osm_ways_vertices_pgr V ON D.node = V.id<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>            $$<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>        ),<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>    4326<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>    ) As the_geom<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>;<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>It is selecting the vertices in the table and the creating the polygon. It works well, but I was wondering if there was a strategy for interpolating points along the line to make the distance be the input distance between vertices even if there isn't a vertex there in the table.<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>Thanks a lot for your help.<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p></div><div><div><div><p class=MsoNormal style='margin-left:.5in'><b><span style='font-family:"Arial",sans-serif;color:#000099'>Andrew Wooley</span></b><span style='font-family:"Arial",sans-serif'> |</span><span style='font-family:"Arial",sans-serif;color:#999999'> IT Director</span><o:p></o:p></p></div><div><div><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Arial",sans-serif;color:#006600'>Mountainland Association of Governments</span><o:p></o:p></p></div><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Trebuchet MS",sans-serif'><a href="https://www.google.com/maps/place/40%C2%B018%2741.0%22N+111%C2%B040%2755.0%22W/@40.3112687,-111.68232,19z/data=%214m2%213m1%211s0x0:0x0" target="_blank">40.311,-111.682</a></span><o:p></o:p></p><div><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Arial",sans-serif'><a href="http://www.mountainland.org" target="_blank"><span style='color:#666666'>http://www.mountainland.org</span></a></span><o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"trebuchet ms ,sans-serif",serif;color:#666666'>801-229-3844 </span><o:p></o:p></p></div></div></div></div></div></div></blockquote><p style='margin-left:.5in'><o:p> </o:p></p><div id=DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p><table class=MsoNormalTable border=1 cellpadding=0 style='margin-left:.5in;border:none;border-top:solid #D3D4DE 1.0pt'><tr><td width=55 style='width:39.0pt;border:none;padding:9.75pt .75pt .75pt .75pt'><p class=MsoNormal><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient&utm_term=icon" target="_blank"><span style='text-decoration:none'><img border=0 width=46 height=29 id="_x0000_i1025" src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif"></span></a><o:p></o:p></p></td><td width=470 style='width:350.25pt;border:none;padding:9.0pt .75pt .75pt .75pt'><p class=MsoNormal style='line-height:13.5pt'><span style='font-size:10.0pt;font-family:"Arial",sans-serif;color:#41424E'>Virus-free. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient&utm_term=link" target="_blank"><span style='color:#4453EA'>www.avast.com</span></a> <o:p></o:p></span></p></td></tr></table><p class=MsoNormal style='margin-left:.5in'><span style='color:windowtext'><o:p> </o:p></span></p></div></div></body></html>