From eb508c5d165ca35d8bca17c60530b407b992fd5a Mon Sep 17 00:00:00 2001 From: John Krauss Date: Wed, 28 Dec 2016 18:40:01 +0000 Subject: [PATCH] Revert "subdivide complex geoms in obs_getmeasure" This reverts commit d44887b2b3c7e3698037f04b2c7d08c57bd28b45. --- src/pg/sql/41_observatory_augmentation.sql | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/pg/sql/41_observatory_augmentation.sql b/src/pg/sql/41_observatory_augmentation.sql index 0a6a043..ac3472e 100644 --- a/src/pg/sql/41_observatory_augmentation.sql +++ b/src/pg/sql/41_observatory_augmentation.sql @@ -837,19 +837,11 @@ BEGIN USING (SELECT ARRAY(SELECT json_array_elements_text(params))::json[]); RETURN QUERY EXECUTE format($query$ - WITH _geoms AS ( - SELECT - (UNNEST($1)).val as id, - (UNNEST($1)).geom AS geom - ), _simple_geoms AS ( - SELECT id, - CASE WHEN ST_GeometryType(geom) = 'ST_Point' THEN geom - ELSE ST_Subdivide(geom) - END AS geom - FROM _geoms - ) + WITH _geoms AS (SELECT + (UNNEST($1)).val as id, + (UNNEST($1)).geom AS geom) SELECT _geoms.id::INT, %s - FROM %s, _simple_geoms _geoms + FROM %s, _geoms WHERE %s AND %s GROUP BY _geoms.id