Tag Info

Hot answers tagged

1

In the example of Anita Graser the st_distance function is used in combination with min() to get the nearest node for every airport.if you have the id's of the nearest nodes you can loop through your table and use this id's for the pgr_drivingdistance function. You can also have a look at the following three links where you always find a good answer from ...


1

You didn't post the whole function, so there could be several reasons, why it doesn't work. For example the declaration of output values could be wrong. You need to have something like this, if you want to return id and geom: CREATE OR REPLACE FUNCTION pgr_nearest_node1( IN tbl varchar, IN x1 double precision, ...


1

If you look at the source declaration of pgr_drivingDistance you will see that it is linking to a C function, driving_distance. So unless you want to change the underlying C function, and recompile, you are stuck, as this is not one of those plpgsql functions that you can change directly, unlike say ...


1

If you can intersect the point with the table containing the records with the line geometry, then you can obtain some unique record of the line that intersects the point. Say the column containing unique identification is id, and the line that intersects the point has an id = 12. Then your pgRouting query would be something like this (modified from the ...


1

Your query that is producing rec is this one with only field id: EXECUTE 'SELECT id::integer FROM layer_vertices_pgr ORDER BY the_geom <-> ST_GeometryFromText(''POINT(' || x || ' ' || y || ')'',4326) LIMIT 1' INTO rec; You create the query with field source in text variable sql, but never actually execute ...


1

You could write a pl/pgsql-function in which you create a temp table(which you can drop on commit).then loop through the records of your (executed) sql-statement and write one result during each loop in this table.if all loops are done execute a "select * from temptable" and set the result of this query as return value.



Only top voted, non community-wiki answers of a minimum length are eligible