Address warnings and deprecations (#173)

This commit is contained in:
Michael Barry
2024-06-17 05:22:41 -04:00
committed by GitHub
parent 3c7e26da08
commit 4469a50ad9
16 changed files with 65 additions and 66 deletions

View File

@@ -66,7 +66,7 @@ import org.slf4j.LoggerFactory;
public class Housenumber implements
OpenMapTilesSchema.Housenumber,
Tables.OsmHousenumberPoint.Handler,
ForwardingProfile.FeaturePostProcessor {
ForwardingProfile.LayerPostProcesser {
private static final Logger LOGGER = LoggerFactory.getLogger(Housenumber.class);
private static final String OSM_SEPARATOR = ";";
@@ -75,7 +75,7 @@ public class Housenumber implements
private static final String TEMP_PARTITION = "_partition";
private static final String TEMP_HAS_NAME = "_has_name";
private static final Comparator<VectorTile.Feature> BY_TEMP_HAS_NAME = Comparator
.comparing(i -> (Boolean) i.attrs().get(TEMP_HAS_NAME), Boolean::compare);
.comparing(i -> (Boolean) i.tags().get(TEMP_HAS_NAME), Boolean::compare);
private final Stats stats;
public Housenumber(Translations translations, PlanetilerConfig config, Stats stats) {
@@ -144,7 +144,7 @@ public class Housenumber implements
public List<VectorTile.Feature> postProcess(int zoom, List<VectorTile.Feature> list) throws GeometryException {
// remove duplicate house numbers, features without name tag are prioritized
var items = list.stream()
.collect(Collectors.groupingBy(f -> f.attrs().get(TEMP_PARTITION)))
.collect(Collectors.groupingBy(f -> f.tags().get(TEMP_PARTITION)))
.values().stream()
.flatMap(
g -> g.stream().min(BY_TEMP_HAS_NAME).stream()
@@ -153,8 +153,8 @@ public class Housenumber implements
// remove temporary attributes
for (var item : items) {
item.attrs().remove(TEMP_HAS_NAME);
item.attrs().remove(TEMP_PARTITION);
item.tags().remove(TEMP_HAS_NAME);
item.tags().remove(TEMP_PARTITION);
}
// reduces the size of some heavy z14 tiles with many repeated housenumber values by 60% or more