mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 11:17:08 +00:00
Return full line summary info for raw lines GIS endpoint
This commit is contained in:
@@ -41,21 +41,11 @@ async function lines (projectId, options = {}) {
|
|||||||
// `;
|
// `;
|
||||||
|
|
||||||
const text = `
|
const text = `
|
||||||
SELECT ST_AsGeoJSON(t.*) geojson
|
SELECT ST_AsGeoJSON(rlsg.*) geojson
|
||||||
FROM (
|
FROM raw_lines_summary_geometry rlsg;
|
||||||
SELECT
|
|
||||||
sequence,
|
|
||||||
rl.line,
|
|
||||||
min(tstamp) ts0,
|
|
||||||
max(tstamp) ts1,
|
|
||||||
count(point) num_points,
|
|
||||||
ST_Transform(ST_MakeLine(rs.geometry ORDER BY tstamp), 4326) geometry
|
|
||||||
FROM raw_lines rl
|
|
||||||
INNER JOIN raw_shots rs USING (sequence)
|
|
||||||
GROUP BY sequence
|
|
||||||
) t;
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|
||||||
const res = await pool.query(text);
|
const res = await pool.query(text);
|
||||||
|
|
||||||
if (res.rows && res.rows.length) {
|
if (res.rows && res.rows.length) {
|
||||||
|
|||||||
Reference in New Issue
Block a user