kopia lustrzana https://github.com/onthegomap/planetiler
z13 paths optional
rodzic
68842f5b4b
commit
7e4add6a1c
|
@ -64,25 +64,32 @@ public class Transportation implements
|
|||
"paved", "asphalt", "cobblestone", "concrete", "concrete:lanes", "concrete:plates", "metal",
|
||||
"paving_stones", "sett", "unhewn_cobblestone", "wood"
|
||||
);
|
||||
private static final Map<String, Integer> MINZOOMS = Map.of(
|
||||
FieldValues.CLASS_TRACK, 14,
|
||||
FieldValues.CLASS_PATH, 13,
|
||||
FieldValues.CLASS_MINOR, 13,
|
||||
FieldValues.CLASS_RACEWAY, 12,
|
||||
FieldValues.CLASS_TERTIARY, 11,
|
||||
FieldValues.CLASS_SECONDARY, 9,
|
||||
FieldValues.CLASS_PRIMARY, 7,
|
||||
FieldValues.CLASS_TRUNK, 5,
|
||||
FieldValues.CLASS_MOTORWAY, 4
|
||||
);
|
||||
private final Map<String, Integer> MINZOOMS;
|
||||
private static final ZoomFunction.MeterThresholds MIN_LENGTH = ZoomFunction.meterThresholds()
|
||||
.put(7, 50)
|
||||
.put(6, 100)
|
||||
.put(5, 500)
|
||||
.put(4, 1_000);
|
||||
private static final double PIXEL = 256d / 4096d;
|
||||
private final boolean z13Paths;
|
||||
|
||||
public Transportation(Translations translations, Arguments args, Stats stats) {
|
||||
this.z13Paths = args.get(
|
||||
"transportation_z13_paths",
|
||||
"transportation(_name) layer: show paths on z13",
|
||||
false
|
||||
);
|
||||
MINZOOMS = Map.of(
|
||||
FieldValues.CLASS_TRACK, 14,
|
||||
FieldValues.CLASS_PATH, z13Paths ? 13 : 14,
|
||||
FieldValues.CLASS_MINOR, 13,
|
||||
FieldValues.CLASS_RACEWAY, 12,
|
||||
FieldValues.CLASS_TERTIARY, 11,
|
||||
FieldValues.CLASS_SECONDARY, 9,
|
||||
FieldValues.CLASS_PRIMARY, 7,
|
||||
FieldValues.CLASS_TRUNK, 5,
|
||||
FieldValues.CLASS_MOTORWAY, 4
|
||||
);
|
||||
}
|
||||
|
||||
private static String surface(String value) {
|
||||
|
|
|
@ -54,14 +54,7 @@ public class TransportationName implements
|
|||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(TransportationName.class);
|
||||
private static final Pattern GREAT_BRITAIN_REF_NETWORK_PATTERN = Pattern.compile("^[AM][0-9AM()]+");
|
||||
private static final Map<String, Integer> MINZOOMS = Map.of(
|
||||
FieldValues.CLASS_TRACK, 14,
|
||||
FieldValues.CLASS_PATH, 13,
|
||||
FieldValues.CLASS_MINOR, 13,
|
||||
FieldValues.CLASS_TRUNK, 8,
|
||||
FieldValues.CLASS_MOTORWAY, 6
|
||||
// default: 12
|
||||
);
|
||||
private final Map<String, Integer> MINZOOMS;
|
||||
private static final ZoomFunction.MeterThresholds MIN_LENGTH = ZoomFunction.meterThresholds()
|
||||
.put(6, 20_000)
|
||||
.put(7, 20_000)
|
||||
|
@ -73,6 +66,7 @@ public class TransportationName implements
|
|||
private final boolean brunnel;
|
||||
private final boolean sizeForShield;
|
||||
private final boolean limitMerge;
|
||||
private final boolean z13Paths;
|
||||
private PreparedGeometry greatBritain = null;
|
||||
private AtomicBoolean loggedNoGb = new AtomicBoolean(false);
|
||||
|
||||
|
@ -92,6 +86,19 @@ public class TransportationName implements
|
|||
"transportation_name layer: limit merge so we don't combine different relations to help merge long highways",
|
||||
false
|
||||
);
|
||||
this.z13Paths = args.get(
|
||||
"transportation_z13_paths",
|
||||
"transportation(_name) layer: show paths on z13",
|
||||
false
|
||||
);
|
||||
MINZOOMS = Map.of(
|
||||
FieldValues.CLASS_TRACK, 14,
|
||||
FieldValues.CLASS_PATH, z13Paths ? 13 : 14,
|
||||
FieldValues.CLASS_MINOR, 13,
|
||||
FieldValues.CLASS_TRUNK, 8,
|
||||
FieldValues.CLASS_MOTORWAY, 6
|
||||
// default: 12
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -37,7 +37,7 @@ public class TransportationTest extends AbstractLayerTest {
|
|||
"name", "<null>",
|
||||
"_buffer", 4d,
|
||||
"_minpixelsize", 0d,
|
||||
"_minzoom", 13,
|
||||
"_minzoom", 14,
|
||||
"_maxzoom", 14
|
||||
), Map.of(
|
||||
"_layer", "transportation_name",
|
||||
|
@ -48,7 +48,7 @@ public class TransportationTest extends AbstractLayerTest {
|
|||
"name_int", "Lagoon Path",
|
||||
"name:latin", "Lagoon Path",
|
||||
"_minpixelsize", 0d,
|
||||
"_minzoom", 13,
|
||||
"_minzoom", 14,
|
||||
"_maxzoom", 14
|
||||
)), result);
|
||||
assertFeatures(13, List.of(Map.of(
|
||||
|
@ -239,13 +239,13 @@ public class TransportationTest extends AbstractLayerTest {
|
|||
"mtb_scale", "4",
|
||||
"surface", "unpaved",
|
||||
"bicycle", "yes",
|
||||
"_minzoom", 13
|
||||
"_minzoom", 14
|
||||
), Map.of(
|
||||
"_layer", "transportation_name",
|
||||
"class", "path",
|
||||
"subclass", "path",
|
||||
"name", "Path name",
|
||||
"_minzoom", 13
|
||||
"_minzoom", 14
|
||||
)), process(lineFeature(Map.of(
|
||||
"highway", "path",
|
||||
"mtb:scale", "4",
|
||||
|
|
Ładowanie…
Reference in New Issue