kopia lustrzana https://github.com/onthegomap/planetiler
tweaks
rodzic
ce486e2290
commit
2aa0fa5a35
|
@ -336,10 +336,14 @@ public final class FeatureGroup implements Consumer<FeatureSort.Entry>, Iterable
|
|||
this.tile = TileCoord.decode(tile);
|
||||
}
|
||||
|
||||
public long getNumFeatures() {
|
||||
public long getNumFeaturesProcessed() {
|
||||
return numFeaturesProcessed.get();
|
||||
}
|
||||
|
||||
public long getNumFeaturesToEmit() {
|
||||
return entries.size();
|
||||
}
|
||||
|
||||
public TileCoord coord() {
|
||||
return tile;
|
||||
}
|
||||
|
|
|
@ -99,7 +99,7 @@ public class MbtilesWriter {
|
|||
|
||||
var topology = Topology.start("mbtiles", stats);
|
||||
|
||||
int queueSize = 1_000;
|
||||
int queueSize = 5_000;
|
||||
|
||||
Topology<TileBatch> encodeBranch, writeBranch = null;
|
||||
if (config.emitTilesInOrder()) {
|
||||
|
@ -190,7 +190,12 @@ public class MbtilesWriter {
|
|||
LOGGER.info("[mbtiles] Starting z" + z);
|
||||
currentZoom = z;
|
||||
}
|
||||
long thisTileFeatures = features.numFeatures();
|
||||
long thisTileFeatures = feature.getNumFeaturesToEmit();
|
||||
maxInputFeaturesPerTile.accumulateAndGet(thisTileFeatures, Long::max);
|
||||
// TODO move to profile layer cost function
|
||||
if (z != 13) {
|
||||
thisTileFeatures /= 10;
|
||||
}
|
||||
if (tilesInThisBatch > 0 &&
|
||||
(tilesInThisBatch >= MAX_TILES_PER_BATCH ||
|
||||
((featuresInThisBatch + thisTileFeatures) > MAX_FEATURES_PER_BATCH))) {
|
||||
|
@ -200,7 +205,6 @@ public class MbtilesWriter {
|
|||
tilesInThisBatch = 0;
|
||||
}
|
||||
featuresInThisBatch += thisTileFeatures;
|
||||
maxInputFeaturesPerTile.accumulateAndGet(thisTileFeatures, Long::max);
|
||||
tilesInThisBatch++;
|
||||
batch.in.add(feature);
|
||||
}
|
||||
|
@ -223,7 +227,7 @@ public class MbtilesWriter {
|
|||
FeatureGroup.TileFeatures last = null;
|
||||
for (int i = 0; i < batch.in.size(); i++) {
|
||||
FeatureGroup.TileFeatures tileFeatures = batch.in.get(i);
|
||||
featuresProcessed.incBy(tileFeatures.getNumFeatures());
|
||||
featuresProcessed.incBy(tileFeatures.getNumFeaturesProcessed());
|
||||
byte[] bytes, encoded;
|
||||
if (tileFeatures.hasSameContents(last)) {
|
||||
bytes = lastBytes;
|
||||
|
|
|
@ -122,7 +122,7 @@ public class Building implements OpenMapTilesSchema.Building,
|
|||
.setAttrWithMinzoom(Fields.HIDE_3D, hide3d, 14);
|
||||
if (mergeZ13Buildings) {
|
||||
feature
|
||||
.setMinPixelSize(0.25)
|
||||
.setMinPixelSize(0.1)
|
||||
.setPixelTolerance(0.25); // improves performance of the building merge ~50% over default
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue