kopia lustrzana https://github.com/onthegomap/planetiler
exclude pt-omt
rodzic
6bb55dc8f6
commit
140582fe28
|
@ -572,5 +572,5 @@ public class FeatureMerge {
|
|||
return result;
|
||||
}
|
||||
|
||||
private record WithIndex<T>(T feature, int hilbert) {}
|
||||
private record WithIndex<T> (T feature, int hilbert) {}
|
||||
}
|
||||
|
|
|
@ -51,10 +51,10 @@ public interface LongLongMap extends Closeable, MemoryEstimator.HasEstimate, Dis
|
|||
AppendStore.Longs.create(storage, params.resolve("values"))
|
||||
);
|
||||
case ARRAY -> switch (storage) {
|
||||
case MMAP -> new ArrayLongLongMapMmap(params.path(), params.madvise());
|
||||
case RAM -> new ArrayLongLongMapRam(false);
|
||||
case DIRECT -> new ArrayLongLongMapRam(true);
|
||||
};
|
||||
case MMAP -> new ArrayLongLongMapMmap(params.path(), params.madvise());
|
||||
case RAM -> new ArrayLongLongMapRam(false);
|
||||
case DIRECT -> new ArrayLongLongMapRam(true);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.slf4j.LoggerFactory;
|
|||
*
|
||||
* @param <T> type of data value associated with each expression
|
||||
*/
|
||||
public record MultiExpression<T>(List<Entry<T>> expressions) implements Simplifiable<MultiExpression<T>> {
|
||||
public record MultiExpression<T> (List<Entry<T>> expressions) implements Simplifiable<MultiExpression<T>> {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(MultiExpression.class);
|
||||
private static final Comparator<WithId> BY_ID = Comparator.comparingInt(WithId::id);
|
||||
|
@ -358,13 +358,13 @@ public record MultiExpression<T>(List<Entry<T>> expressions) implements Simplifi
|
|||
}
|
||||
|
||||
/** An expression/value pair with unique ID to store whether we evaluated it yet. */
|
||||
private record EntryWithId<T>(T result, Expression expression, @Override int id) implements WithId {}
|
||||
private record EntryWithId<T> (T result, Expression expression, @Override int id) implements WithId {}
|
||||
|
||||
/**
|
||||
* An {@code expression} to evaluate on input elements and {@code result} value to return when the element matches.
|
||||
*/
|
||||
public record Entry<T>(T result, Expression expression) {}
|
||||
public record Entry<T> (T result, Expression expression) {}
|
||||
|
||||
/** The result when an expression matches, along with the input element tag {@code keys} that triggered the match. */
|
||||
public record Match<T>(T match, List<String> keys, @Override int id) implements WithId {}
|
||||
public record Match<T> (T match, List<String> keys, @Override int id) implements WithId {}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ import org.locationtech.jts.index.strtree.STRtree;
|
|||
@ThreadSafe
|
||||
public class PointIndex<T> {
|
||||
|
||||
private record GeomWithData<T>(Coordinate coord, T data) {}
|
||||
private record GeomWithData<T> (Coordinate coord, T data) {}
|
||||
|
||||
private final STRtree index = new STRtree();
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ import org.locationtech.jts.index.strtree.STRtree;
|
|||
@ThreadSafe
|
||||
public class PolygonIndex<T> {
|
||||
|
||||
private record GeomWithData<T>(Polygon poly, T data) {}
|
||||
private record GeomWithData<T> (Polygon poly, T data) {}
|
||||
|
||||
private final STRtree index = new STRtree();
|
||||
|
||||
|
@ -77,7 +77,7 @@ public class PolygonIndex<T> {
|
|||
List<?> items = index.query(point.getEnvelopeInternal());
|
||||
// optimization: if there's only one then skip checking contains/distance
|
||||
if (items.size() == 1) {
|
||||
if (items.get(0) instanceof GeomWithData<?> value) {
|
||||
if (items.get(0)instanceof GeomWithData<?> value) {
|
||||
@SuppressWarnings("unchecked") T t = (T) value.data;
|
||||
return List.of(t);
|
||||
}
|
||||
|
|
|
@ -128,7 +128,7 @@ public abstract class SourceFeature implements WithTags, WithGeometryType {
|
|||
private Geometry computeCentroidIfConvex() throws GeometryException {
|
||||
if (!canBePolygon()) {
|
||||
return centroid();
|
||||
} else if (polygon() instanceof Polygon poly &&
|
||||
} else if (polygon()instanceof Polygon poly &&
|
||||
poly.getNumInteriorRing() == 0 &&
|
||||
GeoUtils.isConvex(poly.getExteriorRing())) {
|
||||
return centroid();
|
||||
|
|
|
@ -592,7 +592,7 @@ public class OsmReader implements Closeable, MemoryEstimator.HasEstimate {
|
|||
* @param role "role" of the relation member
|
||||
* @param relation user-provided data about the relation from pass1
|
||||
*/
|
||||
public record RelationMember<T extends OsmRelationInfo>(String role, T relation) {}
|
||||
public record RelationMember<T extends OsmRelationInfo> (String role, T relation) {}
|
||||
|
||||
/** Raw relation membership data that gets encoded/decoded into a long. */
|
||||
private record RelationMembership(String role, long relationId) {}
|
||||
|
|
|
@ -38,7 +38,7 @@ public class ProcessInfo {
|
|||
for (GarbageCollectorMXBean garbageCollectorMXBean : ManagementFactory.getGarbageCollectorMXBeans()) {
|
||||
if (garbageCollectorMXBean instanceof NotificationEmitter emitter) {
|
||||
emitter.addNotificationListener((notification, handback) -> {
|
||||
if (notification.getUserData() instanceof CompositeData compositeData) {
|
||||
if (notification.getUserData()instanceof CompositeData compositeData) {
|
||||
var info = GarbageCollectionNotificationInfo.from(compositeData);
|
||||
GcInfo gcInfo = info.getGcInfo();
|
||||
postGcMemoryUsage.set(gcInfo.getMemoryUsageAfterGc().entrySet().stream()
|
||||
|
@ -142,7 +142,7 @@ public class ProcessInfo {
|
|||
* Returns the total amount of memory available on the system if available.
|
||||
*/
|
||||
public static OptionalLong getSystemMemoryBytes() {
|
||||
if (ManagementFactory.getOperatingSystemMXBean() instanceof com.sun.management.OperatingSystemMXBean osBean) {
|
||||
if (ManagementFactory.getOperatingSystemMXBean()instanceof com.sun.management.OperatingSystemMXBean osBean) {
|
||||
return OptionalLong.of(osBean.getTotalMemorySize());
|
||||
} else {
|
||||
return OptionalLong.empty();
|
||||
|
|
|
@ -128,7 +128,7 @@ public class Translations {
|
|||
Map<String, String> result = new HashMap<>();
|
||||
for (var entry : tags.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
if (key.startsWith("name:") && entry.getValue() instanceof String stringVal) {
|
||||
if (key.startsWith("name:") && entry.getValue()instanceof String stringVal) {
|
||||
result.put(key, stringVal);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,14 +58,14 @@ public interface Try<T> {
|
|||
*/
|
||||
<O> Try<O> map(FunctionThatThrows<T, O> fn);
|
||||
|
||||
record Success<T>(T get) implements Try<T> {
|
||||
record Success<T> (T get) implements Try<T> {
|
||||
|
||||
@Override
|
||||
public <O> Try<O> map(FunctionThatThrows<T, O> fn) {
|
||||
return Try.apply(() -> fn.apply(get));
|
||||
}
|
||||
}
|
||||
record Failure<T>(@Override Exception exception) implements Try<T> {
|
||||
record Failure<T> (@Override Exception exception) implements Try<T> {
|
||||
|
||||
@Override
|
||||
public T get() {
|
||||
|
|
|
@ -34,7 +34,7 @@ import java.util.function.Consumer;
|
|||
*
|
||||
* @param <T> input type of this pipeline
|
||||
*/
|
||||
public record WorkerPipeline<T>(
|
||||
public record WorkerPipeline<T> (
|
||||
String name,
|
||||
WorkerPipeline<?> previous,
|
||||
WorkQueue<T> inputQueue,
|
||||
|
@ -219,7 +219,7 @@ public record WorkerPipeline<T>(
|
|||
*
|
||||
* @param <O> type of elements that the next step must process
|
||||
*/
|
||||
public record Builder<O>(
|
||||
public record Builder<O> (
|
||||
String prefix,
|
||||
String name,
|
||||
// keep track of previous elements so that build can wire-up the computation graph
|
||||
|
|
6
pom.xml
6
pom.xml
|
@ -175,6 +175,12 @@
|
|||
<version>2.40.0</version>
|
||||
<configuration>
|
||||
<java>
|
||||
<includes>
|
||||
<include>*.java</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>planetiler-openmaptiles/**/*.java</exclude>
|
||||
</excludes>
|
||||
<importOrder/>
|
||||
<removeUnusedImports/>
|
||||
<eclipse>
|
||||
|
|
Ładowanie…
Reference in New Issue