minor tweaks to obs_getmeasuremeta and obs_getmeasuredata, good behavior for geometryscores even when null is passed as desired_num_geoms

This commit is contained in:
John Krauss
2016-12-13 00:14:19 +00:00
parent fad7bb991b
commit 9567f52a36
2 changed files with 10 additions and 7 deletions

View File

@@ -416,7 +416,7 @@ $$ LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION cdb_observatory._OBS_GetGeometryScores(
bounds Geometry(Geometry, 4326) DEFAULT NULL,
filter_geom_ids TEXT[] DEFAULT NULL,
desired_num_geoms INTEGER DEFAULT 3000
desired_num_geoms INTEGER DEFAULT NULL
) RETURNS TABLE (
score NUMERIC,
numtiles BIGINT,
@@ -428,6 +428,9 @@ CREATE OR REPLACE FUNCTION cdb_observatory._OBS_GetGeometryScores(
meanmediansize NUMERIC
) AS $$
BEGIN
IF desired_num_geoms IS NULL THEN
desired_num_geoms := 3000;
END IF;
filter_geom_ids := COALESCE(filter_geom_ids, (ARRAY[])::TEXT[]);
-- Very complex geometries simply fail. For a boundary check, we can
-- comfortably get away with the simplicity of an envelope