Truncate sequence durations to second in the GIS calls

This commit is contained in:
D. Berge
2020-08-11 16:02:34 +02:00
parent 9fa2b92d36
commit 380d39dd62
2 changed files with 12 additions and 4 deletions

View File

@@ -7,8 +7,12 @@ async function lines (projectId) {
await pool.query("CALL set_survey($1);", [projectId]);
const text = `
SELECT ST_AsGeoJSON(flsg.*) geojson
FROM final_lines_summary_geometry flsg;
SELECT ST_AsGeoJSON(s.*) geojson
FROM (
SELECT
flsg.*, date_trunc('second', flsg.duration) AS duration
FROM final_lines_summary_geometry flsg
) s;
`;
const res = await pool.query(text);

View File

@@ -7,8 +7,12 @@ async function lines (projectId, options = {}) {
await pool.query("CALL set_survey($1);", [projectId]);
const text = `
SELECT ST_AsGeoJSON(rlsg.*) geojson
FROM raw_lines_summary_geometry rlsg;
SELECT ST_AsGeoJSON(s.*) geojson
FROM (
SELECT
rlsg.*, date_trunc('second', rlsg.duration) AS duration
FROM raw_lines_summary_geometry rlsg
) s;
`;