cars: test tertiary and residential vehicle layer in a local window
This commit is contained in:
1 parent
81791baa09
commit
c15351115f
1 file changed
+11
-2
Vendored
+11
-2
@@ -3028,6 +3028,7 @@ var CAR_MOTORWAY_RX = '^(motorway|motorway_link|trunk|trunk_link)$';
|
|||||||
// explode a single Overpass cell to several megabytes until the mirrors
|
// explode a single Overpass cell to several megabytes until the mirrors
|
||||||
// timed out and the whole layer came back empty.
|
// timed out and the whole layer came back empty.
|
||||||
var CAR_SECONDARY_RX = '^(primary|primary_link|secondary|secondary_link)$';
|
var CAR_SECONDARY_RX = '^(primary|primary_link|secondary|secondary_link)$';
|
||||||
|
var CAR_MINOR_RX = '^(tertiary|tertiary_link|unclassified|residential|living_street)$';
|
||||||
// Side-road coverage follows the CONFIG location and matches the traffic
|
// Side-road coverage follows the CONFIG location and matches the traffic
|
||||||
// disc (rangeKm = 200 km ~ 1.8 deg latitude / 2.5 deg longitude at 48 deg N),
|
// disc (rangeKm = 200 km ~ 1.8 deg latitude / 2.5 deg longitude at 48 deg N),
|
||||||
// in cells small enough that no single query explodes.
|
// in cells small enough that no single query explodes.
|
||||||
@@ -3046,7 +3047,15 @@ var CAR_QUERIES = carCells('geo/mw11', CAR_MOTORWAY_RX, 46.8, 9.4, 50.1, 13.4, 1
|
|||||||
// Side roads around the configured location, in cells small enough that
|
// Side roads around the configured location, in cells small enough that
|
||||||
// no single query explodes (a 0.55 deg cell here cost 6.5 MB and the
|
// no single query explodes (a 0.55 deg cell here cost 6.5 MB and the
|
||||||
// mirrors answered 504).
|
// mirrors answered 504).
|
||||||
carCells('geo/sec10', CAR_SECONDARY_RX, SEC_S, SEC_W, SEC_N, SEC_E, SEC_LAT_STEP, SEC_LON_STEP)
|
carCells('geo/sec10', CAR_SECONDARY_RX, SEC_S, SEC_W, SEC_N, SEC_E, SEC_LAT_STEP, SEC_LON_STEP),
|
||||||
|
// Test layer: tertiary/residential only in a small local window, with
|
||||||
|
// small cells so the public Overpass mirrors do not explode.
|
||||||
|
carCells('geo/minor10', CAR_MINOR_RX,
|
||||||
|
Math.max(45.8, Math.round((_baseLat - 0.6) * 100) / 100),
|
||||||
|
Math.max(7.5, Math.round((_baseLon - 0.8) * 100) / 100),
|
||||||
|
Math.min(51.5, Math.round((_baseLat + 0.6) * 100) / 100),
|
||||||
|
Math.min(18.5, Math.round((_baseLon + 0.8) * 100) / 100),
|
||||||
|
0.12, 0.14)
|
||||||
);
|
);
|
||||||
// Drop what can never be seen (the world disc is ~278 km across, so cells
|
// Drop what can never be seen (the world disc is ~278 km across, so cells
|
||||||
// far outside it cost quota and add no light), then fill it RING BY RING
|
// far outside it cost quota and add no light), then fill it RING BY RING
|
||||||
@@ -3433,7 +3442,7 @@ function fetchMotorways() {
|
|||||||
if (el.type !== 'way' || !el.geometry || el.geometry.length < 2) return;
|
if (el.type !== 'way' || !el.geometry || el.geometry.length < 2) return;
|
||||||
var hw = (el.tags && el.tags.highway) || '';
|
var hw = (el.tags && el.tags.highway) || '';
|
||||||
var key = /^(motorway|trunk)/.test(hw) ? 'motorway'
|
var key = /^(motorway|trunk)/.test(hw) ? 'motorway'
|
||||||
: (/^(primary|secondary)/.test(hw) ? 'secondary' : null);
|
: (/^(primary|secondary|tertiary|tertiary_link|unclassified|residential|living_street)/.test(hw) ? 'secondary' : null);
|
||||||
if (!key) return;
|
if (!key) return;
|
||||||
|
|
||||||
var pts = el.geometry.map(function (g) {
|
var pts = el.geometry.map(function (g) {
|
||||||
|
|||||||
Reference in new issue
Block a user