mirror of
https://github.com/cfpwastaken/planetiler-openmaptiles.git
synced 2026-02-04 12:31:10 +00:00
Node location cache: off-heap storage and “array” implementation that supports parallel inserts (#131)
* Add --nodemap-type=array option for 2-3x faster osm pass 1 imports * Add --nodemap-storage=direct option to experiment with direct (off-heap) memory usage * Extract ResourceUsage and OsmPhaser utilities
This commit is contained in:
@@ -151,7 +151,9 @@ public class TransportationName implements
|
||||
@Override
|
||||
public void preprocessOsmNode(OsmElement.Node node) {
|
||||
if (node.hasTag("highway", "motorway_junction")) {
|
||||
motorwayJunctionHighwayClasses.put(node.id(), HighwayClass.UNKNOWN.value);
|
||||
synchronized (motorwayJunctionHighwayClasses) {
|
||||
motorwayJunctionHighwayClasses.put(node.id(), HighwayClass.UNKNOWN.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,13 +164,15 @@ public class TransportationName implements
|
||||
HighwayClass cls = HighwayClass.from(highway);
|
||||
if (cls != HighwayClass.UNKNOWN) {
|
||||
LongArrayList nodes = way.nodes();
|
||||
for (int i = 0; i < nodes.size(); i++) {
|
||||
long node = nodes.get(i);
|
||||
if (motorwayJunctionHighwayClasses.containsKey(node)) {
|
||||
byte oldValue = motorwayJunctionHighwayClasses.get(node);
|
||||
byte newValue = cls.value;
|
||||
if (newValue > oldValue) {
|
||||
motorwayJunctionHighwayClasses.put(node, newValue);
|
||||
synchronized (motorwayJunctionHighwayClasses) {
|
||||
for (int i = 0; i < nodes.size(); i++) {
|
||||
long node = nodes.get(i);
|
||||
if (motorwayJunctionHighwayClasses.containsKey(node)) {
|
||||
byte oldValue = motorwayJunctionHighwayClasses.get(node);
|
||||
byte newValue = cls.value;
|
||||
if (newValue > oldValue) {
|
||||
motorwayJunctionHighwayClasses.put(node, newValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,7 +145,9 @@ public class Waterway implements
|
||||
@Override
|
||||
public List<OsmRelationInfo> preprocessOsmRelation(OsmElement.Relation relation) {
|
||||
if (relation.hasTag("waterway", "river") && !Utils.nullOrEmpty(relation.getString("name"))) {
|
||||
riverRelationLengths.put(relation.id(), new AtomicDouble());
|
||||
synchronized (riverRelationLengths) {
|
||||
riverRelationLengths.put(relation.id(), new AtomicDouble());
|
||||
}
|
||||
return List.of(new WaterwayRelation(relation.id(), LanguageUtils.getNames(relation.tags(), translations)));
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user