Skip to content

Commit

Permalink
Change transportation name defaults (#2)
Browse files Browse the repository at this point in the history
Default to `transportation_name_brunnel=false` and `transportation_z13_paths=true`
  • Loading branch information
msbarry authored Oct 23, 2021
1 parent b21439f commit 0a3d9b1
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 17 deletions.
2 changes: 1 addition & 1 deletion PLANET.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ java -Xmx100g -Xms100g \
--download-threads=10 --download-chunk-size-mb=1000 \
`# Also download name translations from wikidata` \
--fetch-wikidata \
`# Personal preference overrides to default OpenMapTiles schema` \
`# Personal preference overrides from OpenMapTiles schema (these are default now)` \
--transportation-name-brunnel=false --transportation-z13-paths=true \
--mbtiles=output.mbtiles \
--nodemap-type=sparsearray --nodemap-storage=ram 2>&1 | tee logs.txt
Expand Down
10 changes: 5 additions & 5 deletions config-example.properties
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,17 @@
# boundary_country_names=false

#### "transportation"/"transportation_name" layer
# Include paths and path names at z13 (default is only 14)
# transportation_z13_paths=true
# Set minimum zoom for paths and path names to z14 (default is 13)
# transportation_z13_paths=false

# We attempt to merge any road name lines with the same attributes and touching endpoints,
# but any 3-way nodes and intersections prevent line merging.
# To prevent merging from combining onramps/offramps or opposite directions of divided highways, set:
# transportation_name_limit_merge=true

# To exclude "brunnel" attribute from road name line features so that tunnels and bridges don't
# prevent merging:
# transportation_name_brunnel=false
# By default, the "brunnel" attribute is excluded from from road name line features so that tunnels
# and bridges don't prevent merging. To include "brunnel" tag:
# transportation_name_brunnel=true

# To set a shorter length limit for road name lines so you can render a shield, but not the full name:
# transportation_name_size_for_shield=true
Expand Down
9 changes: 9 additions & 0 deletions flatmap-basemap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
This basemap profile is based on [OpenMapTiles](https://github.com/openmaptiles/openmaptiles) v3.12.2.
See [README.md](../README.md) in the parent directory for instructions on how to run.

## Differences from OpenMapTiles

- `transportation_name` layer does not abbreviate road names yet
- `poi` layer missing the `agg_stop` tag
- Paths are visible at z13 in `transportation` and `transportation_name` layers instead of z14 in OpenMapTiles, to
revert this behavior set `--transportation-z13-paths=false`
- `brunnel` tag is excluded from `transportation_name` layer to avoid breaking apart long `transportation_name`
lines, to revert this behavior set `--transportation-name-brunnel=true`

## Code Layout

[Generate.java](./src/main/java/com/onthegomap/flatmap/basemap/Generate.java) generates code in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public Transportation(Translations translations, FlatmapConfig config, Stats sta
boolean z13Paths = config.arguments().getBoolean(
"transportation_z13_paths",
"transportation(_name) layer: show paths on z13",
false
true
);
MINZOOMS = Map.of(
FieldValues.CLASS_TRACK, 14,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public TransportationName(Translations translations, FlatmapConfig config, Stats
this.brunnel = config.arguments().getBoolean(
"transportation_name_brunnel",
"transportation_name layer: set to false to omit brunnel and help merge long highways",
true
false
);
this.sizeForShield = config.arguments().getBoolean(
"transportation_name_size_for_shield",
Expand All @@ -157,7 +157,7 @@ public TransportationName(Translations translations, FlatmapConfig config, Stats
boolean z13Paths = config.arguments().getBoolean(
"transportation_z13_paths",
"transportation(_name) layer: show paths on z13",
false
true
);
MINZOOMS = Map.of(
FieldValues.CLASS_TRACK, 14,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public void testTransportationName() {
assertNumFeatures("transportation_name", Map.of(
"name", "Boulevard du Larvotto",
"class", "primary"
), 14, 22, LineString.class);
), 14, 12, LineString.class);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void testNamedFootway() {
"name", "<null>",
"_buffer", 4d,
"_minpixelsize", 0d,
"_minzoom", 14,
"_minzoom", 13,
"_maxzoom", 14
), Map.of(
"_layer", "transportation_name",
Expand All @@ -48,7 +48,7 @@ public void testNamedFootway() {
"name_int", "Lagoon Path",
"name:latin", "Lagoon Path",
"_minpixelsize", 0d,
"_minzoom", 14,
"_minzoom", 13,
"_maxzoom", 14
)), result);
assertFeatures(13, List.of(Map.of(
Expand Down Expand Up @@ -143,7 +143,7 @@ public void testInterstateMotorway() {
"ref", "90",
"ref_length", 2,
"network", "us-interstate",
"brunnel", "bridge",
"brunnel", "<null>",
"_minzoom", 6
)), features);

Expand All @@ -166,7 +166,7 @@ public void testInterstateMotorway() {
"ref", "90",
"ref_length", 2,
"network", "us-interstate",
"brunnel", "bridge",
"brunnel", "<null>",
"_minzoom", 6
)), features);
}
Expand All @@ -184,7 +184,7 @@ public void testPrimaryRoadConstruction() {
"_layer", "transportation_name",
"name", "North Washington Street",
"class", "primary_construction",
"brunnel", "bridge",
"brunnel", "<null>",
"_minzoom", 12
)), process(lineFeature(Map.of(
"highway", "construction",
Expand Down Expand Up @@ -239,13 +239,13 @@ public void testMountainBikeTrail() {
"mtb_scale", "4",
"surface", "unpaved",
"bicycle", "yes",
"_minzoom", 14
"_minzoom", 13
), Map.of(
"_layer", "transportation_name",
"class", "path",
"subclass", "path",
"name", "Path name",
"_minzoom", 14
"_minzoom", 13
)), process(lineFeature(Map.of(
"highway", "path",
"mtb:scale", "4",
Expand Down

0 comments on commit 0a3d9b1

Please sign in to comment.