0

I am attempting to follow Anita Grazer's post on creating alpha shapes in pgRouting.

My query:

CREATE TABLE home_isodist (id serial, max_cost double precision);
SELECT addgeometrycolumn('home_isodist','geom',4326,'POLYGON',2);

INSERT INTO home_isodist (max_cost, geom) (
SELECT 1.5, ST_SetSRID(geom_way,4326)
FROM 
pgr_alphashape('SELECT id, ST_X(geom_way) AS x, ST_Y(geom_way) AS y FROM home_catchment5km WHERE cost < 1.5'));

I am getting the following error code:

ERROR:  column "geom_way" does not exist
LINE 5: SELECT 1.5, ST_SetSRID(geom_way,4326)
2
  • 1
    Does the table home_catchment5km have a column called geom_way? If not, that will be your problem. Commented Feb 28, 2016 at 12:48
  • yes It does.. :(
    – Balazs
    Commented Feb 28, 2016 at 12:56

1 Answer 1

2

The result of

pgr_alphashape('SELECT id, ST_X(geom_way) AS x, ST_Y(geom_way) AS y 
FROM home_catchment5km WHERE cost < 1.5')

does not contain a column called "geom_way". That explains the error you get.

Please see the pgRouting docs for details:

pgr_alphashape Returns a table with (x, y) rows that describe the vertices of an alpha shape.

You want:

pgr_pointsAsPolygon Returns the alpha shape as polygon geometry.

1
  • I changed the function name but its not working
    – Balazs
    Commented Feb 29, 2016 at 14:18

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.