Vector tiles buffer is used to include data that is just outside of the tile. This data is used to prevent border effects when rendering the geometries. It is currently [hardcoded to 5 pixels](https://github.com/elastic/elasticsearch/blob/de2781f98696c1e6cfad2b5bf46fe752a5e3edbb/x-pack/plugin/vector-tile/src/main/java/org/elasticsearch/xpack/vectortile/feature/FeatureFactory.java#L63) but it should probably need to be user configurable by adding a new property on the vector tiles API which can change the value.




x-pack/plugin/vector-tile/src/test/java/org/elasticsearch/xpack/vectortile/rest/VectorTileRequestTests.java
assertThat(sortBuilder.getFieldName(), Matchers.equalTo(sortName));
            }
        );
    }
    public void testWrongTile() {
        final String index = randomAlphaOfLength(10);
        final String field = randomAlphaOfLength(10);
        {
            
            final int z = randomIntBetween(Integer.MIN_VALUE, -1);
            final int x = 0;
            final int y = 0;
            final FakeRestRequest request = getBasicRequestBuilder(index, field, z, x, y).build();
            final IllegalArgumentException ex = expectThrows(
                IllegalArgumentException.class,
                () -> VectorTileRequest.parseRestRequest(request)
            );
            assertThat(ex.getMessage(), Matchers.equalTo("Invalid geotile_grid precision of " + z + ". Must be between 0 and 29."));
        }
        {
            
            final int z = -randomIntBetween(GeoTileUtils.MAX_ZOOM + 1, Integer.MAX_VALUE);
            final int x = 0;
            final int y = 0;
            final FakeRestRequest request = getBasicRequestBuilder(index, field, z, x, y).build();
            final IllegalArgumentException ex = expectThrows(
                IllegalArgumentException.class,
                () -> VectorTileRequest.parseRestRequest(request)
            );
            assertThat(ex.getMessage(), Matchers.equalTo("Invalid geotile_grid precision of " + z + ". Must be between 0 and 29."));