From a33f3b8327d6a2f9a434a51a27c105fb41c19a79 Mon Sep 17 00:00:00 2001 From: Mike Barry Date: Sun, 3 Mar 2024 21:15:20 -0500 Subject: [PATCH] smaller ids --- .../java/com/onthegomap/planetiler/FeatureCollector.java | 8 ++++---- .../java/com/onthegomap/planetiler/PlanetilerTests.java | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/planetiler-core/src/main/java/com/onthegomap/planetiler/FeatureCollector.java b/planetiler-core/src/main/java/com/onthegomap/planetiler/FeatureCollector.java index f73f6907..0fed5255 100644 --- a/planetiler-core/src/main/java/com/onthegomap/planetiler/FeatureCollector.java +++ b/planetiler-core/src/main/java/com/onthegomap/planetiler/FeatureCollector.java @@ -284,10 +284,10 @@ public class FeatureCollector implements Iterable { if (source instanceof OsmSourceFeature osmSourceFeature) { long osmId = osmSourceFeature.originalElement().id(); this.id = switch (osmSourceFeature.originalElement()) { - case OsmElement.Node node -> node.id() * 10 + 1; - case OsmElement.Way way -> way.id() * 10 + 2; - case OsmElement.Relation relation -> relation.id() * 10 + 3; - default -> osmId * 10; + case OsmElement.Node node -> node.id() * 3; + case OsmElement.Way way -> way.id() * 3 + 1; + case OsmElement.Relation relation -> relation.id() * 3 + 2; + default -> osmId; }; } else { this.id = source.id(); diff --git a/planetiler-core/src/test/java/com/onthegomap/planetiler/PlanetilerTests.java b/planetiler-core/src/test/java/com/onthegomap/planetiler/PlanetilerTests.java index a1bf43b9..f1166ab0 100644 --- a/planetiler-core/src/test/java/com/onthegomap/planetiler/PlanetilerTests.java +++ b/planetiler-core/src/test/java/com/onthegomap/planetiler/PlanetilerTests.java @@ -875,7 +875,7 @@ class PlanetilerTests { feature(newPoint(128, 128), Map.of( "attr", "value", "name", "name value" - )).withId(11) + )).withId(3) ) ), results.tiles); } @@ -964,7 +964,7 @@ class PlanetilerTests { feature(newLineString(128, 128, 192, 192), Map.of( "attr", "value", "name", "name value" - )).withId(32) + )).withId(3 * 3 + 1) ) ), results.tiles); } @@ -1089,7 +1089,7 @@ class PlanetilerTests { "attr", "value", "name", "name value", "relname", "rel name" - )).withId(173) + )).withId(17 * 3 + 2) ) ), results.tiles); }