I am developing my own cartographic server using leaflet and GeoTools in the back end, I use streaming render to draw a map in given bbox, all geometries are in 3857 coordinate reference system,here is a simple request from leaflet http://localhost:8080/server/tile/mymap/12/2083/1598.png where z = 12 and x=2083 and y=1598 when getting such request in backend i convert zxy to a reference envelope,every thing work fine so far, when i use SimpleFeatureSource the result in frontend with leflet looks good
ReferencedEnvelope env = new ReferencedEnvelope(this.getBounds(tile), this.webMercator);
for (MapLayer mapLayer : mapLayers) {
try {
SimpleFeatureSource featureSource = postgisDataStore.getFeatureSource(mapLayer.getLayer().getSlug());
Style style = createFromSLD(mapLayer);
mapContent.addLayer(new FeatureLayer(source, style));
} catch (IOException e) {
log.error(e.getMessage());
}
}
saveMap(mapContent, os, mapBounds);
the result have not problems:
But when i use a FeatureCollection instead of a SimpleFeatureSource I get a problem with the points, they are cropped in some way ,could some one explain what happening:
ReferencedEnvelope env = new ReferencedEnvelope(this.getBounds(tile), this.webMercator);
for (MapLayer mapLayer : mapLayers) {
try {
SimpleFeatureCollection fc = featureService.getTile(mapLayer.getLayer(), tile, env);
Style style = createFromSLD(mapLayer);
mapContent.addLayer(new FeatureLayer(source, style));
} catch (IOException e) {
log.error(e.getMessage());
}
}
saveMap(mapContent, os, mapBounds);

