Closed mnameghi closed 7 years ago
Hey, I'll need some more information in order to help out. Would recommend starting with:
You could double check you are on the latest library version, otherwise that method with a separate clipping envelope will not be available (see changelog). A troubleshooting method you could try is try alternate geometry, start with something simple and see if that works correctly also.
Hi I used last version. this is my code:
VectorTile.Tile.Layer.Builder area = MvtLayerBuild.newLayerBuilder("area", layerParams);
List<Geometry> areaGeometries = new ArrayList<>();
List<Geometry> areaGeometries = new ArrayList<>();
for (AreaEntity at : areaEntities) {
Geometry geometry = at.getShape();
Map<String, Object> map = new HashMap<>();
map.put("type", at.getType());
map.put("area",at.getArea());
areaGeometries.add(g);
geometry.setUserData(map);
areaGeometries.add(geometry);
}
final GeometryFactory geomFactory = new GeometryFactory();
final TileGeomResult tileGeom = JtsAdapter.createTileGeom(
geometries,
envelope,
geomFactory,
defaultMvtParam,
acceptAllGeomFilter
);
final MvtLayerProps layerProps = new MvtLayerProps();
List<VectorTile.Tile.Feature> features = JtsAdapter.toFeatures(tileGeom.mvtGeoms, layerProps, userDataConverter);
builder.addAllFeatures(features);
MvtLayerBuild.writeProps(builder, layerProps);
tileBuilder.addLayers(builder.build());
VectorTile.Tile mvt = tileBuilder.build();
and I used osm data. With line and point data everything is OK, but polygons data are not showed on my map!
OK I found my fault! I used wrong version and now I found that function. but there is problem with polygon!
Maybe try starting with something simple like the write example:
See if you can get that working, then add in your logic and isolate the issue you are experiencing some more.
Feel free to re-open when you've isolated your problem more.
I'd tried to create mvt from polygon but there is a problem in rendering it. I Read.me explain something about Buffering Polygons but I can't find this method: