mirror of
https://github.com/cfpwastaken/planetiler-openmaptiles.git
synced 2026-02-04 04:21:08 +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,9 +151,11 @@ public class TransportationName implements
|
|||||||
@Override
|
@Override
|
||||||
public void preprocessOsmNode(OsmElement.Node node) {
|
public void preprocessOsmNode(OsmElement.Node node) {
|
||||||
if (node.hasTag("highway", "motorway_junction")) {
|
if (node.hasTag("highway", "motorway_junction")) {
|
||||||
|
synchronized (motorwayJunctionHighwayClasses) {
|
||||||
motorwayJunctionHighwayClasses.put(node.id(), HighwayClass.UNKNOWN.value);
|
motorwayJunctionHighwayClasses.put(node.id(), HighwayClass.UNKNOWN.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void preprocessOsmWay(OsmElement.Way way) {
|
public void preprocessOsmWay(OsmElement.Way way) {
|
||||||
@@ -162,6 +164,7 @@ public class TransportationName implements
|
|||||||
HighwayClass cls = HighwayClass.from(highway);
|
HighwayClass cls = HighwayClass.from(highway);
|
||||||
if (cls != HighwayClass.UNKNOWN) {
|
if (cls != HighwayClass.UNKNOWN) {
|
||||||
LongArrayList nodes = way.nodes();
|
LongArrayList nodes = way.nodes();
|
||||||
|
synchronized (motorwayJunctionHighwayClasses) {
|
||||||
for (int i = 0; i < nodes.size(); i++) {
|
for (int i = 0; i < nodes.size(); i++) {
|
||||||
long node = nodes.get(i);
|
long node = nodes.get(i);
|
||||||
if (motorwayJunctionHighwayClasses.containsKey(node)) {
|
if (motorwayJunctionHighwayClasses.containsKey(node)) {
|
||||||
@@ -175,6 +178,7 @@ public class TransportationName implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void process(Tables.OsmHighwayPoint element, FeatureCollector features) {
|
public void process(Tables.OsmHighwayPoint element, FeatureCollector features) {
|
||||||
|
|||||||
@@ -145,7 +145,9 @@ public class Waterway implements
|
|||||||
@Override
|
@Override
|
||||||
public List<OsmRelationInfo> preprocessOsmRelation(OsmElement.Relation relation) {
|
public List<OsmRelationInfo> preprocessOsmRelation(OsmElement.Relation relation) {
|
||||||
if (relation.hasTag("waterway", "river") && !Utils.nullOrEmpty(relation.getString("name"))) {
|
if (relation.hasTag("waterway", "river") && !Utils.nullOrEmpty(relation.getString("name"))) {
|
||||||
|
synchronized (riverRelationLengths) {
|
||||||
riverRelationLengths.put(relation.id(), new AtomicDouble());
|
riverRelationLengths.put(relation.id(), new AtomicDouble());
|
||||||
|
}
|
||||||
return List.of(new WaterwayRelation(relation.id(), LanguageUtils.getNames(relation.tags(), translations)));
|
return List.of(new WaterwayRelation(relation.id(), LanguageUtils.getNames(relation.tags(), translations)));
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user