I am working on a task that requires me to get sample points every 1000 km along coastlines, and have run into a problem with Antarctica. From what I can tell, it seems to be an issue with the use of geometry in the functions, when really I think geography should be used for this operation.
Using the function from this very similar question, I am able to produce a result that looks like this: .
As you can see,
ST_LocateAlong() don't seem to treat the geometry spherically, which results in many points that sit on the South Pole. A point was even added on the clip along the date line (left side). Per the documentation of these two functions, only geometry can be used.
The code used to generate the polygon and the points can be found here, but this is the SQL used to generate the points:
CREATE TABLE atest AS WITH line AS (SELECT id, ST_ExteriorRing((ST_Dump(geom)).geom) AS geom FROM line_sample_test), linemeasure AS (SELECT ST_AddMeasure(line.geom, 0, (ST_Length(line.geom))::int) AS linem, generate_series(0, (ST_Length(line.geom))::int, 10) AS i FROM line), geometries AS ( SELECT i, ST_LocateAlong(linem, i) AS geom FROM linemeasure) SELECT * from geometries;
How can I generate points at every 1000 Km along this coastline?