Add limit to the grid-generating functions

This adds an optinal maxcells parameter to the rectangle and hexagonal grids,
with a default value of 262144 (2^18).
An error occurs when the grids would need more cells.
This commit is contained in:
Javier Goizueta
2018-02-14 17:50:06 +01:00
parent 5243192296
commit 7ea428913a
6 changed files with 46 additions and 4 deletions

View File

@@ -0,0 +1,5 @@
-- Check small grids are generated...
SELECT COUNT(*) FROM cartodb.CDB_RectangleGrid(ST_MakeEnvelope(0,0,1000,1000,3857), 10, 10);
-- But large grids produce an error
SELECT COUNT(*) FROM cartodb.CDB_RectangleGrid(ST_MakeEnvelope(0,0,1000,1000,3857), 1, 1);