kopia lustrzana https://github.com/onthegomap/planetiler
smaller ids
rodzic
b38b8b37a1
commit
a33f3b8327
|
@ -284,10 +284,10 @@ public class FeatureCollector implements Iterable<FeatureCollector.Feature> {
|
|||
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();
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue