diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ac941aa..24d87792 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +Tiles 4.14.7 +------ +- fix race condition in determining locale for high way shields [#586] + Tiles 4.14.6 ------ - fix parsing of integers in feature matcher by @pekkine [#599] diff --git a/tiles/src/main/java/com/protomaps/basemap/Basemap.java b/tiles/src/main/java/com/protomaps/basemap/Basemap.java index 9e4c30c3..4c1b2b66 100644 --- a/tiles/src/main/java/com/protomaps/basemap/Basemap.java +++ b/tiles/src/main/java/com/protomaps/basemap/Basemap.java @@ -134,7 +134,7 @@ public String description() { @Override public String version() { - return "4.14.6"; + return "4.14.7"; } @Override diff --git a/tiles/src/main/java/com/protomaps/basemap/layers/Roads.java b/tiles/src/main/java/com/protomaps/basemap/layers/Roads.java index 8360c74d..4986841b 100644 --- a/tiles/src/main/java/com/protomaps/basemap/layers/Roads.java +++ b/tiles/src/main/java/com/protomaps/basemap/layers/Roads.java @@ -310,7 +310,6 @@ public String name() { } // Hardcoded to US for now - private CartographicLocale locale = new CartographicLocale(); private record RouteRelationInfo( @Override long id, @@ -340,7 +339,7 @@ private void processOsmHighways(SourceFeature sf, FeatureCollector features) { String highway = sf.getString("highway"); - CartographicLocale.Shield shield = locale.getShield(sf); + var locale = new CartographicLocale(); for (var routeInfo : sf.relationInfo(RouteRelationInfo.class)) { RouteRelationInfo relation = routeInfo.relation(); @@ -354,9 +353,11 @@ private void processOsmHighways(SourceFeature sf, FeatureCollector features) { code.ifPresent(s -> sf.setTag("pm:country", s)); locale = CountryCoder.getLocale(code); } catch (GeometryException e) { - // do nothing + e.log("Failed to determine country code"); } + CartographicLocale.Shield shield = locale.getShield(sf); + var matches = osmKindsIndex.getMatches(sf); String kind = getString(sf, matches, "pm:kind", "other");