Answer the question
In order to leave comments, you need to log in
How to calculate distance in select array?
Hello.
There is a table with a track
CREATE TABLE positions
(
id INTEGER GENERATED BY DEFAULT AS IDENTITY,
date_add TIMESTAMP WITHOUT TIME ZONE NOT NULL DEFAULT NOW(),
latitude DOUBLE PRECISION NOT NULL,
longitude DOUBLE PRECISION NOT NULL,
current_point_n geometry
);
current_point_n=st_geometryfromtext('POINT('|| latitude ||' '|| longitude ||')',4326);
SELECT ST_Distance( ARRAY( SELECT current_point_n FROM positions ORDER BY id) );
function st_distance(geometry[]) does not exist
SELECT st_Length(ST_MakeLine
( ARRAY( SELECT current_point_n FROM positions ORDER BY id) ));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question