kopia lustrzana https://github.com/onthegomap/planetiler
Vector tile feature ID method (#960)
rodzic
1d0b639141
commit
2b65295559
|
@ -235,4 +235,13 @@ public interface OsmElement extends WithTags {
|
|||
record Info(long changeset, long timestamp, int userId, int version, String user) {
|
||||
private static final int COST = 2;
|
||||
}
|
||||
|
||||
static long vectorTileFeatureId(int multiplier, long id, Type type) {
|
||||
return (id * multiplier) + switch (type) {
|
||||
case OTHER -> 0;
|
||||
case NODE -> 1;
|
||||
case WAY -> 2;
|
||||
case RELATION -> 3;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -646,12 +646,7 @@ public class OsmReader implements Closeable, MemoryEstimator.HasEstimate {
|
|||
|
||||
@Override
|
||||
public long vectorTileFeatureId(int multiplier) {
|
||||
return (id() * multiplier) + switch (originalElement.type()) {
|
||||
case OTHER -> 0;
|
||||
case NODE -> 1;
|
||||
case WAY -> 2;
|
||||
case RELATION -> 3;
|
||||
};
|
||||
return OsmElement.vectorTileFeatureId(multiplier, id(), originalElement.type());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -15,4 +15,8 @@ public interface OsmRelationInfo extends MemoryEstimator.HasEstimate {
|
|||
default long estimateMemoryUsageBytes() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
default long vectorTileFeatureId(int multiplier) {
|
||||
return OsmElement.vectorTileFeatureId(multiplier, id(), OsmElement.Type.RELATION);
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue