From b2eff136675f1340abb794fcd7b016663d981547 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Fri, 19 Dec 2014 14:33:39 -0800 Subject: [PATCH] Impose a limit on the maximum number of features in a tile. --- tile.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tile.cc b/tile.cc index d8fe408b1..99cb32361 100644 --- a/tile.cc +++ b/tile.cc @@ -569,6 +569,12 @@ long long write_tile(char **geoms, char *metabase, unsigned *file_bbox, int z, u } if (features.size() > 0) { + if (features.size() > 200000) { + fprintf(stderr, "tile %d/%u/%u has %lld features, >200000 \n", z, tx, ty, (long long) features.size()); + fprintf(stderr, "Try using -z to set a higher base zoom level.\n"); + exit(EXIT_FAILURE); + } + mapnik::vector::tile tile = create_tile(layername, line_detail, features, &count, &keys, &values); pool_free(&keys);