Closed robe2 closed 5 years ago
Might be worthwhile back porting this fix to 2.1 and 2.0
As noted by @cvvergara this works:
SELECT *
FROM pgr_alphaShape( $$SELECT v.id::int4, ST_X(v.the_geom) AS x, ST_Y(v.the_geom) As y
FROM pgr_drivingDistance('SELECT gid As id, source, target,
cost_s AS cost, reverse_cost_s AS reverse_cost
FROM ospr.ways',
(SELECT n.id
FROM ospr.ways_vertices_pgr AS n
ORDER BY ST_SetSRID(
ST_Point(-77.02734, 38.97328),4326) <-> n.the_geom LIMIT 1)
, 20, true
) AS dd INNER JOIN ospr.ways_vertices_pgr AS v ON dd.node = v.id$$);
but annoying thing i is its inconsistent with pgr_pointsAsPolygons, because to use same query in that I need double-quotes
SELECT *
FROM pgr_pointsAsPolygon( $$SELECT v.id::int4, ST_X(v.the_geom) AS x, ST_Y(v.the_geom) As y
FROM pgr_drivingDistance(''SELECT gid As id, source, target,
cost_s AS cost, reverse_cost_s AS reverse_cost
FROM ospr.ways'',
(SELECT n.id
FROM ospr.ways_vertices_pgr AS n
ORDER BY ST_SetSRID(
ST_Point(-77.02734, 38.97328),4326) <-> n.the_geom LIMIT 1)
, 20, true
) AS dd INNER JOIN ospr.ways_vertices_pgr AS v ON dd.node = v.id$$);
I pushed this to 2.3.0 since even though I consider this a bug, it would be a breaking change for anyone who is working around this broken functionality. If we do put in 2.2.2 probably should be a news note that this is a breaking change, but brings consistency.
actually, pushed to 3.0, could not make it for 2.3
This function is deleted in v3.0 This one should be used https://docs.pgrouting.org/dev/en/pgr_alphaShape.html
I tried running this query:
and got this error:
The problem is the line in pgr_pointsAsPolygon that does this:
If you change that to a parameterized query:
Then it works.