I would like to get points from polygon border using PostGIS.
I've tried using ST_DumpPoints() function, like this:
CREATE OR REPLACE FUNCTION get_points_from_polygon(polygon geometry)
RETURNS SETOF geometry AS
$$
DECLARE
point geometry;
BEGIN
FOR point IN
SELECT DISTINCT
points.geom
FROM (
SELECT (ST_DumpPoints(polygon)).*
) AS points LOOP
RETURN NEXT point;
END LOOP;
END;
$$
LANGUAGE plpgsql ;
But it gets sometimes huge list of points (~100-500) and that is not what I need. I need to get N equidistant points on the border, like on the screenshot attached. Then, when I have these points I will analyze viewshed polygons from point as observer
I've found, how to identify is the point on the polygon border But have no idea , how to create first them and get as a list of points geometry.
What would be your suggestion to do this?
