use simple envelope for very complex geometries in obs_getgetgeometryscores

This commit is contained in:
John Krauss
2016-12-09 21:47:30 +00:00
parent 95b6cba085
commit 9f640f0c35

View File

@@ -434,6 +434,11 @@ CREATE OR REPLACE FUNCTION cdb_observatory._OBS_GetGeometryScores(
) AS $$
BEGIN
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
IF ST_Npoints(bounds) > 10000 THEN
bounds := ST_Envelope(bounds);
END IF;
RETURN QUERY
EXECUTE format($string$
SELECT