1

I would like to combine several catchment areas (points feature) into one catchment area. There are examples of my catchment areas.

enter image description here

Each area has one source (POI).I will use the combined area to create a map like this oneenter image description here(isochrone map by Anita Graser)

What should I do to get my areas combined?

3
  • If the values are the same ranges - you can merge the 2 point files and groupby source
    – Mapperz
    Jun 16, 2017 at 16:03
  • Yes they're the same ranges. I've tried to merge them using merge vector layers (both SAGA and qgis geoalgorithms) but the result was the same with one of those layers
    – Afif
    Jun 17, 2017 at 4:16
  • related: Create isochrone from multiple start points
    – underdark
    Jun 23, 2017 at 14:51

1 Answer 1

1

Here is a possible solution, starting with a query, that writes all distances in a single table first. The example uses OSM data imported with osm2pgrouting. Your attributes may have a different naming.

INSERT INTO data.distances SELECT 123456 AS source_id, a.*, b.id, b.the_geom FROM pgr_drivingDistance( 'SELECT gid AS id, source, target, cost_s AS cost, reverse_cost_s AS reverse_cost FROM osm.ways', 123456, 1000 ) AS a LEFT JOIN osm.ways_vertices_pgr AS b ON a.node = b.id; In the query above the source node ID is 123456, but you will run this query for each of your source nodes:

Then all your distances from each source node are stored in data.distances table and you can query the minimum distance to each node in your network:

SELECT DISTINCT ON (node) * FROM data.distances ORDER BY node, agg_cost ASC;

5
  • For your first source node start your query with CREATE TABLE data.distances AS, if the table doesn't exist yet.
    – dkastl
    Jun 18, 2017 at 12:45
  • Thank you dkastl. What does osm.ways_vertices_pgr mean? Does it refer to vertices_pgr column on osm.ways table?
    – Afif
    Jun 21, 2017 at 14:53
  • osm.ways_vertices_pgr is a table, that is also available after using osm2pgrouting. It contains a list of nodes, that are used as source and target ID's, and this table also contains geometry information of the nodes. You may have this in a different table or you can create it with pgr_createVerticesTable: docs.pgrouting.org/latest/en/…
    – dkastl
    Jun 22, 2017 at 4:09
  • Hello dkastl, long time no see. I've tried your query and it works. Thank you! Does your query create line geometric table?
    – Afif
    Jul 5, 2017 at 3:22
  • No, it doesn't. Btw., if your original question is answered, it may be good to mark it as resolved.
    – dkastl
    Jul 5, 2017 at 15:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.