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

The article was written several years ago, so some of the functions have been updated and names have changed. I have updated the code and it all appears to work fine apart from the last step. I am getting the following error for the last three lines of code:

"ERROR: missing FROM-clause entry for table "home_catchment10km""

    CREATE TABLE "os_m2".home_catchment10km AS
   FROM "os_m2"."m2_roads_vertices_pgr"
   (SELECT * FROM pgr_drivingdistance('
      SELECT gid AS id,
          cost_time AS cost
      FROM "os_m2"."m2_roads"',
      false)) AS route
   "m2_roads_vertices_pgr".id = route.id1

   CREATE TABLE "os_m2".home_isodist (id serial, max_cost double precision);
    SELECT addgeometrycolumn('os_m2','home_isodist','the_geom2',27700,'POLYGON',2);

INSERT INTO "os_m2".home_isodist (max_cost, the_geom2) (
SELECT 600, ST_SetSRID("home_catchment10km"."the_geom",27700) <**ERROR HAPPENS HERE**
FROM pgr_alphashape('SELECT id, ST_X(home_catchment10km.the_geom) AS x, ST_Y(home_catchment10km.the_geom) AS y FROM "os_m2".home_catchment10km where cost < 600'));

1 Answer 1


The CREATE TABLE statement creates a table, home_catchment10km in a schema, os_m2. The SELECT statement is trying to access home_catchment10km without a schema qualifier, which causes it to search in the public (default) schema instead. It should be "os_m2"."home_catchment10km"."the_geom".

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.