Skip to content
Open
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Tiles 4.15.3
------
- include Finnish trunk roads from zoom 3 [#221]

Tiles 4.15.2
------
- Fix parsing of commas in non-English locales [#628]
Expand Down
2 changes: 1 addition & 1 deletion tiles/src/main/java/com/protomaps/basemap/Basemap.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

private static final Logger LOGGER = LoggerFactory.getLogger(Basemap.class);

public Basemap(QrankDb qrankDb, CountryCoder countryCoder, Clip clip,

Check failure on line 43 in tiles/src/main/java/com/protomaps/basemap/Basemap.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Refactor this method to reduce its Cognitive Complexity from 21 to the 15 allowed.

See more on https://sonarcloud.io/project/issues?id=protomaps_basemaps&issues=AaEM1SMxi6Tm4CnzR5Av&open=AaEM1SMxi6Tm4CnzR5Av&pullRequest=640
String layer) {

if (layer.isEmpty() || layer.equals(Boundaries.LAYER_NAME)) {
Expand Down Expand Up @@ -135,7 +135,7 @@

@Override
public String version() {
return "4.15.2";
return "4.15.3";
}

@Override
Expand Down
7 changes: 7 additions & 0 deletions tiles/src/main/java/com/protomaps/basemap/layers/Roads.java
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,13 @@ public Roads(CountryCoder countryCoder) {
with("pm:country", "US"),
with("_r_network_US:I"),
use("pm:minzoom", 3)
),

// Finland tags its national road network highway=trunk, not motorway.
rule(
with("pm:country", "FI"),
with("pm:highway", "trunk"),
use("pm:minzoom", 3)
)

)).index();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ abstract class LayerTest {

// Coarse bounding boxes, not real borders: just enough for tests to land inside a locale.
final CountryCoder countryCoder = CountryCoder.fromJsonString(
"{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"properties\":{\"iso1A2\":\"US\",\"nameEn\":\"United States\"},\"geometry\":{\"type\":\"MultiPolygon\",\"coordinates\":[[[[-124,47],[-124,25],[-71,25],[-71,47],[-124,47]]]]}},{\"type\":\"Feature\",\"properties\":{\"iso1A2\":\"NL\",\"nameEn\":\"Netherlands\"},\"geometry\":{\"type\":\"MultiPolygon\",\"coordinates\":[[[[3.3,53.6],[3.3,50.7],[7.3,50.7],[7.3,53.6],[3.3,53.6]]]]}}]}");
"{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"properties\":{\"iso1A2\":\"US\",\"nameEn\":\"United States\"},\"geometry\":{\"type\":\"MultiPolygon\",\"coordinates\":[[[[-124,47],[-124,25],[-71,25],[-71,47],[-124,47]]]]}},{\"type\":\"Feature\",\"properties\":{\"iso1A2\":\"NL\",\"nameEn\":\"Netherlands\"},\"geometry\":{\"type\":\"MultiPolygon\",\"coordinates\":[[[[3.3,53.6],[3.3,50.7],[7.3,50.7],[7.3,53.6],[3.3,53.6]]]]}},{\"type\":\"Feature\",\"properties\":{\"iso1A2\":\"FI\",\"nameEn\":\"Finland\"},\"geometry\":{\"type\":\"MultiPolygon\",\"coordinates\":[[[[19.5,70.1],[19.5,59.7],[31.6,59.7],[31.6,70.1],[19.5,70.1]]]]}}]}");


final QrankDb qrankDb = new QrankDb(LongLongHashMap.from(new long[]{8888}, new long[]{100000}));
Expand Down
14 changes: 14 additions & 0 deletions tiles/src/test/java/com/protomaps/basemap/layers/RoadsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,20 @@ void relation4() {
);
}

@ParameterizedTest
@CsvSource({
"trunk, 3",
"trunk_link, 6",
"primary, 7",
})
void finnishTrunkRoadsEnterAtMotorwayZoom(String highway, int minZoom) {
// Kokkola - Kajaani: national route 28 is 218 km of highway=trunk with no motorway section
assertFeatures(0,
List.of(Map.of("kind", "major_road", "_minzoom", minZoom)),
processWithRelationAndCoords("", 23.34, 63.87, 27.45, 64.12, "highway", highway)
);
}

@Test
void relationShieldsOrderedByNetworkPriority() {
// Concurrent I 70 / US 6 relations: Interstate becomes the primary shield regardless of
Expand Down
Loading