3

I tried to solve a problem I had in QGIS (see Simplifying multiple lines to create central axis?).

I just need to know how the correct syntax works to use the function ST_ApproximateMedialAxis(geometry geom)

I successfully added the geometry to the pgAdmin4 Geometry Viewer with the query

select geom
from public.bufferrail

so that seems to be correct.

But how to include this geometry as argument to the function?

SELECT ST_ApproximateMedialAxis (select geom from public.bufferrail);

does not work. I tried several variations, with no success.

Taras
  • 32,823
  • 4
  • 66
  • 137
Babel
  • 71,072
  • 14
  • 78
  • 208

1 Answers1

4

The correct query is:

SELECT
    uid,
    ST_ApproximateMedialAxis(geom)
FROM
    public.bufferrail;
Taras
  • 32,823
  • 4
  • 66
  • 137
MrXsquared
  • 34,292
  • 21
  • 67
  • 117