Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OMT 3.15.0 updates based on review, round 2 #40

Merged
merged 4 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/org/openmaptiles/layers/Place.java
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ public void process(Tables.OsmBoundaryPolygon element, FeatureCollector features
int rank = AREA_RANKS.ceilingEntry(element.source().area()).getValue();
int minzoom = rank <= 4 ? rank + 5 : 10;

features.centroid(LAYER_NAME).setBufferPixels(BUFFER_SIZE)
features.pointOnSurface(LAYER_NAME).setBufferPixels(BUFFER_SIZE)
.putAttrs(OmtLanguageUtils.getNames(element.source().tags(), translations))
.setAttr(OpenMapTilesSchema.Boundary.Fields.CLASS, element.boundary())
.setAttr(Fields.RANK, rank)
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/org/openmaptiles/layers/TransportationName.java
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,13 @@ public void process(Tables.OsmHighwayLinestring element, FeatureCollector featur
.setMinZoom(minzoom);

// populate route_1_<something>, route_2_<something>, ... route_n_<something> tags and remove duplicates
Set<Long> routes = new HashSet<>();
Set<String> routes = new HashSet<>();
for (var route : relations) {
if (routes.add(route.id())) {
String routeString = route.network() + "=" +
coalesce(route.ref(), "") + "=" +
coalesce(route.name(), "") + "=" +
coalesce(route.colour(), "");
if (routes.add(routeString)) {
String keyPrefix = "route_" + routes.size() + "_";

feature.setAttr(keyPrefix + "network", route.network());
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/openmaptiles/layers/WaterName.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public class WaterName implements
// need to synchronize updates from multiple threads
private final LongObjectMap<Geometry> lakeCenterlines = Hppc.newLongObjectHashMap();
// may be updated concurrently by multiple threads
private ConcurrentSkipListMap<String, NaturalEarthRegion> importantMarinePoints = new ConcurrentSkipListMap<>();
private final ConcurrentSkipListMap<String, NaturalEarthRegion> importantMarinePoints = new ConcurrentSkipListMap<>();
private final Stats stats;

public WaterName(Translations translations, PlanetilerConfig config, Stats stats) {
Expand All @@ -100,7 +100,7 @@ public WaterName(Translations translations, PlanetilerConfig config, Stats stats
@Override
public void release() {
lakeCenterlines.release();
importantMarinePoints = null;
importantMarinePoints.clear();
}

@Override
Expand Down