﻿{"id":7912,"date":"2019-01-25T04:54:11","date_gmt":"2019-01-25T03:54:11","guid":{"rendered":"http:\/\/www.sigterritoires.fr\/?p=7912"},"modified":"2019-01-25T08:40:19","modified_gmt":"2019-01-25T07:40:19","slug":"how-to-develop-an-application-with-pgrouting-in-windows-4-catchment-areas-and-isochrones","status":"publish","type":"post","link":"https:\/\/www.sigterritoires.fr\/index.php\/en\/how-to-develop-an-application-with-pgrouting-in-windows-4-catchment-areas-and-isochrones\/","title":{"rendered":"How to develop an application with pgRouting in Windows (4): catchment areas and isochrones"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">pgRouting includes a\nfunction\ncalled\npgr_drivingDistance\n, that, together with three others functions , pgr_withPointsDD\n, pgr_alphaShape and pgr_pointsAsPolygon , can be used to establish which\npaths\nhave\na certain cost versus a starting or arrival\npoint . <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The area surrounding these paths\nis\ndesignated\nas\na\ncatchment area . pgr_drivingDistance , in\nconjunction\nwith pgr_pointsAsPolygon is often\nused\nto determine coverage requirements for a service or to determine optimal\nlocations for new facilities. <\/p>\n\n\n\n<!--more-->\n\n\n\n<p class=\"wp-block-paragraph\">For example , if you have\na\nfire\nstation, you must determine\nall\nparts of the city that can be reached\nwithin five minutes. A reverse\nproblem would be to find all parts of the city\nwhere\nthe residents could drive\nto\na hospital within five minutes.\n<br>\nThe\nfunction that calculates the paths for both problems\nis\ncalled\npgr_drivingDistance\nbecause it is often used\nwhen\nthe cost is measured as driving\ntime . However, the costs are not necessarily\n&nbsp; limited to a time or a\ndistance. <br>\nFor\nthis type of application , knowing all routes towards\nor\nfrom a given point is not very useful. &nbsp;It\nis here where the functions &nbsp; pgr _alphaShape and\npgr_pointsAsPolygon come into play. The\npgr_alphaShape use as input a set of x, y\ncoordinates and returns a set of x, y which correspond to the vertices of a\npolygon that includes all the input points. <br>\npgr_pointsAsPolygon\nis\nsimilar\nto pgr_alphaShape , it uses as input a set of coordinates x, y, but instead of\nreturning another\nseries\nof points, returns a polygon &nbsp; that &nbsp;surrounds all input\npoints . Internally, it uses the pgr_alphaShape function .\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Using<\/strong> <strong>pgr_drivingDistance<\/strong>\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let&rsquo;s take the case of a\nfire\nstation and search the area covered in 5 minutes. The\norder sql corresponding to these\ncriteria\ncan be translated by the following: <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><em>SELECT * FROM<\/em><\/strong> <strong><em>pgr_drivingDistance<\/em><\/strong>\n<strong><em>(&lsquo;SELECT<\/em><\/strong> <strong><em>gid<\/em><\/strong> <strong><em>as id, source, target,<\/em><\/strong> <strong><em>cost_s<\/em><\/strong>\n<strong><em>as cost,<\/em><\/strong> <strong><em>reverse_cost_s<\/em><\/strong> <strong><em>as<\/em><\/strong> <strong><em>reverse_cost<\/em><\/strong>\n<strong><em>FROM<\/em><\/strong> <strong><em>public.ways<\/em><\/strong> <strong><em>&lsquo;, 25736, 300, true)<\/em><\/strong>\n\n\nIn the SELECT clause we use\nthe cost of a section in\nseconds\n(cost_s), and indicate the reverse_cost_s because even fire trucks cannot drive\nagainst traffic. <strong><em>25736<\/em><\/strong> is\nthe node corresponding to the fire station, <strong><em>300<\/em><\/strong>\nis\nthe forecasted cost (5 minutes x 60 seconds ), and the <strong><em>true<\/em><\/strong>\nvalue indicates that the graph is\ndirectional\n(takes into account the forbidden driving\nsense ). \n\n\n\n<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"525\" height=\"246\" data-attachment-id=\"7913\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/how-to-develop-an-application-with-pgrouting-in-windows-4-catchment-areas-and-isochrones\/attachment\/251\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/251.png?fit=525%2C246&amp;ssl=1\" data-orig-size=\"525,246\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"251\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/251.png?fit=525%2C246&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/251.png?resize=525%2C246&#038;ssl=1\" alt=\"\" class=\"wp-image-7913\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/251.png?w=525&amp;ssl=1 525w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/251.png?resize=300%2C141&amp;ssl=1 300w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The result of the query returns\n6948 nodes that are in within\n5 minutes from the fire station. By cons the result of the query\nhaving\nno geometry , we can not visualize them in QGis. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You have to modify the query as\nfollows: <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><em>SELECT * FROM<\/em><\/strong> <strong><em>pgr_drivingDistance<\/em><\/strong>\n<strong><em>(&lsquo;SELECT<\/em><\/strong> <strong><em>gid<\/em><\/strong> <strong><em>as id, source, target,<\/em><\/strong> <strong><em>cost_s<\/em><\/strong>\n<strong><em>as cost,<\/em><\/strong> <strong><em>reverse_cost_s<\/em><\/strong> <strong><em>as<\/em><\/strong> <strong><em>reverse_cost<\/em><\/strong>\n<strong><em>FROM<\/em><\/strong> <strong><em>public.ways<\/em><\/strong> <strong><em>&lsquo;, 25736, 300, true) as JOIN<\/em><\/strong>\n<strong><em>ways_vertices_pgr<\/em><\/strong> <strong><em>on di.node = ways_vertices_pgr.id<\/em><\/strong>\n\n\nWe perform a join with the node table (\nways_vertices_pgr ) and the result of the query includes\nthe geometries : &nbsp;&nbsp;\n\n\n\n<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"525\" height=\"246\" data-attachment-id=\"7914\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/how-to-develop-an-application-with-pgrouting-in-windows-4-catchment-areas-and-isochrones\/attachment\/252\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/252.png?fit=525%2C246&amp;ssl=1\" data-orig-size=\"525,246\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"252\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/252.png?fit=525%2C246&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/252.png?resize=525%2C246&#038;ssl=1\" alt=\"\" class=\"wp-image-7914\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/252.png?w=525&amp;ssl=1 525w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/252.png?resize=300%2C141&amp;ssl=1 300w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We can see the\nresult in QGis:\n\n\n\n<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"525\" height=\"295\" data-attachment-id=\"7916\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/how-to-develop-an-application-with-pgrouting-in-windows-4-catchment-areas-and-isochrones\/253-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/253-1.png?fit=525%2C295&amp;ssl=1\" data-orig-size=\"525,295\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"253\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/253-1.png?fit=525%2C295&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/253-1.png?resize=525%2C295&#038;ssl=1\" alt=\"\" class=\"wp-image-7916\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/253-1.png?w=525&amp;ssl=1 525w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/253-1.png?resize=300%2C169&amp;ssl=1 300w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>How to create<\/strong>\n<strong>the<\/strong>\n<strong>catchment<\/strong>\n<strong>area<\/strong>\n<strong>with<\/strong>\n<strong>pgr_pointsAsPolygon<\/strong>\n\n\nTo create the catchment area, we use\nthe former query as sql\nof the function pgr_pointsAsPolygon , by\ncreating\na polygon in output that we can load in QGis: <br><strong><em>SELECT 1 As id,<\/em><\/strong><strong><em>ST_SetSRID<\/em><\/strong><strong><em>(<\/em><\/strong><strong><em>pgr_pointsAsPolygon<\/em><\/strong><strong><em>(<\/em><\/strong><br><strong><em>$$ SELECT<\/em><\/strong><strong><em>di.seq<\/em><\/strong><strong><em>AS id, ST_X\n(<\/em><\/strong><strong><em>v.the_geom<\/em><\/strong><strong><em>) AS x, ST_Y (<\/em><\/strong><strong><em>v.the_geom<\/em><\/strong><strong><em>) As y<\/em><\/strong><br><strong><em>FROM<\/em><\/strong><strong><em>pgr_drivingDistance<\/em><\/strong><strong><em>(<\/em><\/strong><strong><em>SELECT<\/em><\/strong><strong><em>gid<\/em><\/strong><strong><em>As id, source, target,<\/em><\/strong><br><strong><em>cost_s<\/em><\/strong><strong><em>AS cost,<\/em><\/strong><strong><em>reverse_cost_s<\/em><\/strong><strong><em>AS<\/em><\/strong><strong><em>reverse_cost<\/em><\/strong><br><strong><em>FROM<\/em><\/strong><strong><em>public.ways<\/em><\/strong><strong><em>\u00bb, 25736, 300, true<\/em><\/strong><br><strong><em>) AS di INNER JOIN<\/em><\/strong><strong><em>public.ways_vertices_pgr<\/em><\/strong><strong><em>AS v ON<\/em><\/strong><strong><em>di.node<\/em><\/strong><strong><em>= v.id $$<\/em><\/strong><br><strong><em>), 4326) As<\/em><\/strong><strong><em>geom<\/em><\/strong><strong><em>;<\/em><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"525\" height=\"283\" data-attachment-id=\"7917\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/how-to-develop-an-application-with-pgrouting-in-windows-4-catchment-areas-and-isochrones\/attachment\/254\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/254.png?fit=525%2C283&amp;ssl=1\" data-orig-size=\"525,283\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"254\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/254.png?fit=525%2C283&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/254.png?resize=525%2C283&#038;ssl=1\" alt=\"\" class=\"wp-image-7917\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/254.png?w=525&amp;ssl=1 525w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/254.png?resize=300%2C162&amp;ssl=1 300w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">pgr_pointAsPolygon uses the id, x, and y points\ngenerated by pgr_drivingDistance . For x\nand y we use the functions St_x and St_y on the points geometry.\n\n\nOnce loaded in QGis, the\nresult is as follows : &nbsp;&nbsp;\n\n\n\n<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"525\" height=\"298\" data-attachment-id=\"7918\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/how-to-develop-an-application-with-pgrouting-in-windows-4-catchment-areas-and-isochrones\/attachment\/255\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/255.png?fit=525%2C298&amp;ssl=1\" data-orig-size=\"525,298\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"255\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/255.png?fit=525%2C298&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/255.png?resize=525%2C298&#038;ssl=1\" alt=\"\" class=\"wp-image-7918\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/255.png?w=525&amp;ssl=1 525w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/255.png?resize=300%2C170&amp;ssl=1 300w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>How to create the\nisochrones<\/strong> <strong><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The isochrones correspond to the reachable areas\nin\na\nseries\nof time steps. We could , in this\nexample\n, want to know which are\nthe areas we can reach\nin\n1, 2, 3, 4 and 5 minutes. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Therefore we will proceed in\ntwo\nsteps\n. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The first one, is to create a\ntable with our nodes resulting\nfrom pgr_drivingDistance for the fastest time step (5 minutes). Logically\n, in this table it will, also, be found the nodes\nreachable\nin\nthe shortest periods of time. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We create this table ( dd_caserne )\nwith the following sql command &nbsp;: <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><em>CREATE TABLE<\/em><\/strong> <strong><em>dd_caserne<\/em><\/strong> <strong><em>AS<\/em><\/strong>\n<br>\n<strong><em>SELECT<\/em><\/strong> <strong><em>di.seq<\/em><\/strong> <strong><em>As id,<\/em><\/strong>\n<strong><em>di.node<\/em><\/strong> <strong><em>,<\/em><\/strong> <strong><em>di.edge<\/em><\/strong> <strong><em>,<\/em><\/strong>\n<br>\n<strong><em>di.agg_cost<\/em><\/strong> <strong><em>As<\/em><\/strong> <strong><em>time_access<\/em><\/strong>\n<strong><em>,<\/em><\/strong> <strong><em>v.the_geom<\/em><\/strong> <strong><em>As<\/em><\/strong> <strong><em>geom<\/em><\/strong>\n<br>\n<strong><em>FROM<\/em><\/strong> <strong><em>pgr_drivingDistance<\/em><\/strong> <strong><em>(SELECT<\/em><\/strong>\n<strong><em>gid<\/em><\/strong> <strong><em>As id, source, target,<\/em><\/strong> <br>\n<strong><em>cost_s<\/em><\/strong> <strong><em>AS cost,<\/em><\/strong> <strong><em>reverse_cost_s<\/em><\/strong>\n<strong><em>AS<\/em><\/strong> <strong><em>reverse_cost<\/em><\/strong> <br>\n<strong><em>FROM public.ways&rsquo;, 25736, 300, true<\/em><\/strong>\n<br>\n<strong><em>) AS di INNER JOIN<\/em><\/strong> <strong><em>public.ways_vertices_pgr<\/em><\/strong>\n<strong><em>AS v ON<\/em><\/strong> <strong><em>di.node<\/em><\/strong> <strong><em>= v.id;<\/em><\/strong>\n\n\nThe resulting table is the following :\n\n\n\n\n<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"525\" height=\"371\" data-attachment-id=\"7919\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/how-to-develop-an-application-with-pgrouting-in-windows-4-catchment-areas-and-isochrones\/attachment\/256\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/256.png?fit=525%2C371&amp;ssl=1\" data-orig-size=\"525,371\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"256\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/256.png?fit=525%2C371&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/256.png?resize=525%2C371&#038;ssl=1\" alt=\"\" class=\"wp-image-7919\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/256.png?w=525&amp;ssl=1 525w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/256.png?resize=300%2C212&amp;ssl=1 300w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Based on this table we will build\na\nseries\nof polygons with pgr_pointsAsPolygon for points at 60, 120 180 240 and 300\nseconds of access time by using generate_series\n<strong><em>SELECT<\/em><\/strong><strong><em>i<\/em><\/strong><strong><em>As<\/em><\/strong><strong><em>time_access,\nST_SetSRID<\/em><\/strong><strong><em>(<\/em><\/strong><strong><em>pgr_pointsAsPolygon<\/em><\/strong><strong><em>(<\/em><\/strong><br><strong><em>&lsquo;SELECT id, ST_X (<\/em><\/strong><strong><em>geom<\/em><\/strong><strong><em>) AS\nx, ST_Y (<\/em><\/strong><strong><em>geom<\/em><\/strong><strong><em>) As y<\/em><\/strong><br><strong><em>FROM<\/em><\/strong><strong><em>dd_caserne<\/em><\/strong><br><strong><em>WHERE<\/em><\/strong><strong><em>access_time<\/em><\/strong><strong><em>&lt;= &lsquo;||<\/em><\/strong><strong><em>i :: text), 4326) As<\/em><\/strong><strong><em>geom<\/em><\/strong><br><strong><em>FROM<\/em><\/strong><strong><em>generate_series<\/em><\/strong><strong><em>(60,300,60)\nAs<\/em><\/strong><strong><em>i<\/em><\/strong><br><strong><em>ORDER BY<\/em><\/strong><strong><em>i<\/em><\/strong><strong><em>DESC<\/em><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"525\" height=\"274\" data-attachment-id=\"7920\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/how-to-develop-an-application-with-pgrouting-in-windows-4-catchment-areas-and-isochrones\/attachment\/257\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/257.png?fit=525%2C274&amp;ssl=1\" data-orig-size=\"525,274\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"257\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/257.png?fit=525%2C274&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/257.png?resize=525%2C274&#038;ssl=1\" alt=\"\" class=\"wp-image-7920\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/257.png?w=525&amp;ssl=1 525w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/257.png?resize=300%2C157&amp;ssl=1 300w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nThe\nresult includes\nthe 5 isochrones polygons , which we can, now,\ndisplay\nin\nQGis:\n\n\n\n<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"525\" height=\"300\" data-attachment-id=\"7921\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/how-to-develop-an-application-with-pgrouting-in-windows-4-catchment-areas-and-isochrones\/attachment\/258\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/258.png?fit=525%2C300&amp;ssl=1\" data-orig-size=\"525,300\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"258\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/258.png?fit=525%2C300&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/258.png?resize=525%2C300&#038;ssl=1\" alt=\"\" class=\"wp-image-7921\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/258.png?w=525&amp;ssl=1 525w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/01\/258.png?resize=300%2C171&amp;ssl=1 300w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>pgRouting includes a function called pgr_drivingDistance , that, together with three others functions , pgr_withPointsDD , pgr_alphaShape and pgr_pointsAsPolygon , can be used to establish which paths have a certain cost versus a starting or arrival&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"give_campaign_id":0,"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"sfsi_plus_gutenberg_text_before_share":"","sfsi_plus_gutenberg_show_text_before_share":"","sfsi_plus_gutenberg_icon_type":"","sfsi_plus_gutenberg_icon_alignemt":"","sfsi_plus_gutenburg_max_per_row":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1260],"tags":[],"class_list":["post-7912","post","type-post","status-publish","format-standard","hentry","category-non-classe-en"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p6XU0A-23C","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/posts\/7912","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/comments?post=7912"}],"version-history":[{"count":0,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/posts\/7912\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/media?parent=7912"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/categories?post=7912"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/tags?post=7912"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}