From cc156ab56385c9aaaee6385fa147fca1021a438c Mon Sep 17 00:00:00 2001 From: "D. Berge" Date: Tue, 11 Aug 2020 15:41:12 +0200 Subject: [PATCH] Remove commented out code --- lib/www/server/lib/db/gis/project/final.js | 22 -------------- lib/www/server/lib/db/gis/project/raw.js | 34 ---------------------- 2 files changed, 56 deletions(-) diff --git a/lib/www/server/lib/db/gis/project/final.js b/lib/www/server/lib/db/gis/project/final.js index 18648f2..4004750 100644 --- a/lib/www/server/lib/db/gis/project/final.js +++ b/lib/www/server/lib/db/gis/project/final.js @@ -6,28 +6,6 @@ async function lines (projectId) { await pool.query("CALL set_survey($1);", [projectId]); -// const text = ` -// SELECT json_build_object( -// 'type', 'FeatureCollection', -// 'features', json_agg(geojson::json)) geojson -// FROM ( -// SELECT ST_AsGeoJSON(t.*) geojson -// FROM ( -// SELECT -// sequence, -// line, -// min(tstamp) ts0, -// max(tstamp) ts1, -// count(point) num_points, -// ST_Transform(ST_MakeLine(fs.geometry ORDER BY tstamp), 4326) geometry -// FROM final_lines fl -// INNER JOIN final_shots fs USING (sequence) -// GROUP BY sequence -// -// ) t -// ) f; -// `; - const text = ` SELECT ST_AsGeoJSON(flsg.*) geojson FROM final_lines_summary_geometry flsg; diff --git a/lib/www/server/lib/db/gis/project/raw.js b/lib/www/server/lib/db/gis/project/raw.js index 27d2152..bcfdb7d 100644 --- a/lib/www/server/lib/db/gis/project/raw.js +++ b/lib/www/server/lib/db/gis/project/raw.js @@ -6,40 +6,6 @@ async function lines (projectId, options = {}) { await pool.query("CALL set_survey($1);", [projectId]); -// const values = [ -// "bbox" in options, -// ...(options.bbox||[null, null, null, null]), -// options.limit || 5000 -// ]; - -// const text = ` -// SELECT json_build_object( -// 'type', 'FeatureCollection', -// 'features', json_agg(geojson::json)) geojson -// FROM ( -// SELECT ST_AsGeoJSON(t.*) geojson -// FROM ( -// SELECT -// sequence, -// 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 -// -- FIXME This restriction does not do the job properly -// -- WHERE -// -- ($1 IS true -// -- AND t.geometry && ST_MakeEnvelope($2, $3, $4, $5, 4326) -// -- ) -// -- OR ($1 IS false AND true) -// -- LIMIT $6 -// ) f; -// `; - const text = ` SELECT ST_AsGeoJSON(rlsg.*) geojson FROM raw_lines_summary_geometry rlsg;