public FeatureIterable decode(byte[] data, Set<String> layerNames) throws IOException { return decode(data, new Filter.Any(layerNames)); }
@Override public void addFeature( String layerName, String featureId, String geometryName, Geometry geometry, Map<String, Object> properties) { encoder.addFeature(layerName, properties, geometry); }
public FeatureIterable decode(byte[] data, String layerName) throws IOException { return decode(data, new Filter.Single(layerName)); }
public FeatureIterable decode(byte[] data) throws IOException { return decode(data, Filter.ALL); }
public MapBoxTileBuilder(Rectangle mapSize, ReferencedEnvelope mapArea) { final int extent = Math.max(mapSize.width, mapSize.height); final int polygonClipBuffer = extent / 32; final boolean autoScale = false; this.encoder = new VectorTileEncoderNoClip(extent, polygonClipBuffer, autoScale); }
List<Integer> commands(Geometry geometry) { if (geometry instanceof MultiLineString) { return commands((MultiLineString) geometry); } if (geometry instanceof Polygon) { return commands((Polygon) geometry); } if (geometry instanceof MultiPolygon) { return commands((MultiPolygon) geometry); } return commands(geometry.getCoordinates(), shouldClosePath(geometry), geometry instanceof MultiPoint); }
@Override public RawMap build(WMSMapContent mapContent) throws IOException { byte[] contents = encoder.encode(); return new RawMap(mapContent, contents, MIME_TYPE); }
public boolean hasNext() { findNext(); return next != null; }
public Iterator<Feature> iterator() { return new FeatureIterator(tile, filter, autoScale); }
/** * // // // Ex.: MoveTo(3, 6), LineTo(8, 12), LineTo(20, 34), ClosePath // * Encoded as: [ 9 3 6 18 5 6 12 22 15 ] // == command type 7 (ClosePath), * length 1 // ===== relative LineTo(+12, +22) == LineTo(20, 34) // === * relative LineTo(+5, +6) == LineTo(8, 12) // == [00010 010] = command type * 2 (LineTo), length 2 // === relative MoveTo(+3, +6) // == [00001 001] = * command type 1 (MoveTo), length 1 // Commands are encoded as uint32 * varints, vertex parameters are // encoded as sint32 varints (zigzag). * Vertex parameters are // also encoded as deltas to the previous position. * The original // position is (0,0) * * @param cs * @return */ List<Integer> commands(Coordinate[] cs, boolean closePathAtEnd) { return commands(cs, closePathAtEnd, false); }
@Override public void addFeature(String layerName, String featureId, String geometryName, Geometry geometry, Map<String, Object> properties) { encoder.addFeature(layerName, properties, geometry); }
public FeatureIterable decode(byte[] data, Set<String> layerNames) throws IOException { return decode(data, new Filter.Any(layerNames)); }
public FeatureIterable decode(byte[] data, String layerName) throws IOException { return decode(data, new Filter.Single(layerName)); }
public FeatureIterable decode(byte[] data) throws IOException { return decode(data, Filter.ALL); }
public MapBoxTileBuilder(Rectangle mapSize, ReferencedEnvelope mapArea) { final int extent = Math.max(mapSize.width, mapSize.height); final int polygonClipBuffer = extent / 32; final boolean autoScale = false; this.encoder = new VectorTileEncoderNoClip(extent, polygonClipBuffer, autoScale); }
public boolean hasNext() { findNext(); return next != null; }
public Iterator<Feature> iterator() { return new FeatureIterator(tile, filter, autoScale); }
/** * // // // Ex.: MoveTo(3, 6), LineTo(8, 12), LineTo(20, 34), ClosePath // * Encoded as: [ 9 3 6 18 5 6 12 22 15 ] // == command type 7 (ClosePath), * length 1 // ===== relative LineTo(+12, +22) == LineTo(20, 34) // === * relative LineTo(+5, +6) == LineTo(8, 12) // == [00010 010] = command type * 2 (LineTo), length 2 // === relative MoveTo(+3, +6) // == [00001 001] = * command type 1 (MoveTo), length 1 // Commands are encoded as uint32 * varints, vertex parameters are // encoded as sint32 varints (zigzag). * Vertex parameters are // also encoded as deltas to the previous position. * The original // position is (0,0) * * @param cs * @return */ List<Integer> commands(Coordinate[] cs, boolean closePathAtEnd) { return commands(cs, closePathAtEnd, false); }
public void addFeature(String layerName, Map<String, ?> attributes, Geometry geometry) { this.addFeature(layerName, attributes, geometry, this.autoincrementIds ? this.autoincrement++ : -1); }
private void splitAndAddFeatures(String layerName, Map<String, ?> attributes, GeometryCollection geometry) { for (int i = 0; i < geometry.getNumGeometries(); i++) { Geometry subGeometry = geometry.getGeometryN(i); addFeature(layerName, attributes, subGeometry); } }