/** * Create a {@link VectorTileEncoder} with the given extent value. * <p> * The extent value control how detailed the coordinates are encoded in the * vector tile. 4096 is a good default, 256 can be used to reduce density. * <p> * The clip buffer value control how large the clipping area is outside of * the tile for geometries. 0 means that the clipping is done at the tile * border. 8 is a good default. * * @param extent * a int with extent value. 4096 is a good value. * @param clipBuffer * a int with clip buffer size for geometries. 8 is a good value. * @param autoScale * when true, the encoder expects coordinates in the 0..255 range * and will scale them automatically to the 0..extent-1 range * before encoding. when false, the encoder expects coordinates * in the 0..extent-1 range. * */ public VectorTileEncoder(int extent, int clipBuffer, boolean autoScale) { this.extent = extent; this.autoScale = autoScale; final int size = autoScale ? 256 : extent; clipGeometry = createTileEnvelope(clipBuffer, size); }
/** * Create a {@link VectorTileEncoder} with the given extent value. * <p> * The extent value control how detailed the coordinates are encoded in the * vector tile. 4096 is a good default, 256 can be used to reduce density. * <p> * The clip buffer value control how large the clipping area is outside of * the tile for geometries. 0 means that the clipping is done at the tile * border. 8 is a good default. * * @param extent * a int with extent value. 4096 is a good value. * @param clipBuffer * a int with clip buffer size for geometries. 8 is a good value. * @param autoScale * when true, the encoder expects coordinates in the 0..255 range * and will scale them automatically to the 0..extent-1 range * before encoding. when false, the encoder expects coordinates * in the 0..extent-1 range. * @param autoincrementIds * */ public VectorTileEncoder(int extent, int clipBuffer, boolean autoScale, boolean autoincrementIds) { this.extent = extent; this.autoScale = autoScale; this.autoincrementIds = autoincrementIds; this.autoincrement = 1; final int size = autoScale ? 256 : extent; clipGeometry = createTileEnvelope(clipBuffer, size); }