-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use @mapbox/gazetteer for benchmark coordinates
- Closes #8059
- Loading branch information
Showing
3 changed files
with
3,715 additions
and
3,266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,94 +1,23 @@ | ||
import { OverscaledTileID } from '../../src/source/tile_id'; | ||
import locations from '@mapbox/gazetteer/mapbox-streets/style-benchmark-locations.json'; | ||
import MercatorCoordinate from '../../src/geo/mercator_coordinate'; | ||
|
||
export default [ | ||
{ | ||
"description": "Roads – Houston, z12", | ||
"tileID": [new OverscaledTileID(12, 0, 12, 962, 1692)], | ||
"zoom": 12, | ||
"center": [-95.392263, 29.799396] | ||
}, | ||
{ | ||
"description": "Roads – Houston, z13", | ||
"tileID": [new OverscaledTileID(13, 0, 13, 1925, 3386)], | ||
"zoom": 13, | ||
"center": [-95.38116, 29.74916] | ||
}, | ||
{ | ||
"description": "High zoom labels (also: buildings, roads) – New York City, z16", | ||
"tileID": [new OverscaledTileID(16, 0, 16, 19299, 24629)], | ||
"zoom": 16, | ||
"center": [-73.984682, 40.757660] | ||
}, | ||
{ | ||
"description": "High zoom labels (also: buildings, roads) – New York City, z17, overzoomed", | ||
"tileID": [new OverscaledTileID(17, 0, 17, 19299, 24629)], | ||
"zoom": 17, | ||
"center": [-73.984682, 40.757660] | ||
}, | ||
{ | ||
"description": "High zoom cjk labels, when using local lang (also: buildings, roads) – Tokyo, z16", | ||
"tileID": [new OverscaledTileID(16, 0, 16, 58210, 25803)], | ||
"zoom": 16, | ||
"center": [139.759860, 35.69522] | ||
}, | ||
{ | ||
"description": "High zoom cjk labels, when using local lang (also: buildings, roads) – Tokyo, z17, overzoomed", | ||
"tileID": [new OverscaledTileID(17, 0, 17, 58210, 25803)], | ||
"zoom": 17, | ||
"center": [139.759860, 35.69522] | ||
}, | ||
{ | ||
"description": "Water – Finland, z10", | ||
"tileID": [new OverscaledTileID(10, 0, 10, 590, 288)], | ||
"zoom": 10, | ||
"center": [27.602348, 61.520945] | ||
}, | ||
{ | ||
"description": "Landuse and roads – Paris, z11", | ||
"tileID": [new OverscaledTileID(11, 0, 11, 1036, 705)], | ||
"zoom": 11, | ||
"center": [2.209530, 48.745030] | ||
}, | ||
{ | ||
"description": "Buildings – LA, z16", | ||
"tileID": [new OverscaledTileID(16, 0, 16, 11229, 26180)], | ||
"zoom": 6, | ||
"center": [-118.314417, 33.995654] | ||
}, | ||
{ | ||
"description": "High zoom (roads, paths, landuse, labels) – Paris, 15", | ||
"tileID": [new OverscaledTileID(15, 0, 15, 16594, 11271)], | ||
"zoom": 15, | ||
"center": [2.315725, 48.866517] | ||
}, | ||
{ | ||
"description": "High zoom (pedestrian polygon fills, roads, paths, landuse, labels) – Paris, z16", | ||
"tileID": [new OverscaledTileID(16, 0, 16, 33189, 22543)], | ||
"zoom": 16, | ||
"center": [2.315725, 48.866517] | ||
}, | ||
{ | ||
"description": "Hillshading – Switzerland, z9", | ||
"tileID": [new OverscaledTileID(9, 0, 9, 268, 181)], | ||
"zoom": 9, | ||
"center": [8.835221, 46.317157] | ||
}, | ||
{ | ||
"description": "Hillshading and contours – Switzerland, z12", | ||
"tileID": [new OverscaledTileID(12, 0, 12, 2148, 1452)], | ||
"zoom": 12, | ||
"center": [8.835221, 46.317157] | ||
}, | ||
{ | ||
"description": "Landcover – Germany z6", | ||
"tileID": [new OverscaledTileID(6, 0, 6, 33, 21)], | ||
"zoom": 6, | ||
"center": [8.429493, 51.056406] | ||
}, | ||
{ | ||
"description": "Landcover – Germany z8", | ||
"tileID": [new OverscaledTileID(8, 0, 8, 133, 86)], | ||
"zoom": 8, | ||
"center": [7.762074, 50.322133] | ||
} | ||
]; | ||
export default locations.features.map(feature => { | ||
const { coordinates } = feature.geometry; | ||
const { zoom, place_name } = feature.properties; | ||
const { x, y } = MercatorCoordinate.fromLngLat({ | ||
lng: coordinates[0], | ||
lat: coordinates[1] | ||
}); | ||
|
||
const scale = Math.pow(2, zoom); | ||
const tileX = Math.floor(x * scale); | ||
const tileY = Math.floor(y * scale); | ||
|
||
return { | ||
description: place_name, | ||
tileID: [new OverscaledTileID(zoom, 0, zoom, tileX, tileY)], | ||
zoom, | ||
center: coordinates | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.