Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

WV-3474 ESRI Place Labels replacement (#5692)

Patrick Mouldena7a04cd32d5d
diff --git a/config/default/common/config/metadata/layers/reference/Reference_Labels_15m.md b/config/default/common/config/metadata/layers/reference/Reference_Labels_15m.md
index 2c7251e0a..5e2c23ee1 100644
--- a/config/default/common/config/metadata/layers/reference/Reference_Labels_15m.md
+++ b/config/default/common/config/metadata/layers/reference/Reference_Labels_15m.md
@@ -1,3 +1,5 @@
-The Place Labels layer is a reference layer that displays labels for countries, states, major cities, minor cities, towns, airports, large water bodies and major national parks/protected areas.
+The Place Labels layer is a reference layer that displays labels for countries, states, major cities, minor cities, towns, airports, universities/schools, hospitals, water bodies, and national parks/protected areas.
-Place Labels information are gleaned from [OpenStreetMap](https://www.openstreetmap.org/copyright) and [Natural Earth](https://www.naturalearthdata.com/).
+Place Labels information are provided by Esri, TomTom, Garmin, FAO, NOAA, USGS, © OpenStreetMap contributors, and the GIS User Community via the [Hybrid Reference Layer (WGS84)](https://www.arcgis.com/home/item.html?id=a70340a048224752915ddbed9d2101a7).
+
+Alignment of boundaries is a presentation of the feature provided by our data vendors and does not imply endorsement by Esri or any governing authority.
diff --git a/config/default/common/config/metadata/layers/reference/Reference_Labels_15m_arctic.md b/config/default/common/config/metadata/layers/reference/Reference_Labels_15m_arctic.md
new file mode 100644
index 000000000..5eb87374e
--- /dev/null
+++ b/config/default/common/config/metadata/layers/reference/Reference_Labels_15m_arctic.md
@@ -0,0 +1,3 @@
+The Place Labels layer is a reference layer that displays labels for countries, states, major cities, minor cities, towns, airports, large water bodies and major national parks/protected areas.
+
+Place Labels information are gleaned from OpenStreetMap and Natural Earth.
\ No newline at end of file
diff --git a/config/default/common/config/wv.json/layerOrder.json b/config/default/common/config/wv.json/layerOrder.json
index f9e82cf06..974b8826b 100644
--- a/config/default/common/config/wv.json/layerOrder.json
+++ b/config/default/common/config/wv.json/layerOrder.json
@@ -1104,6 +1104,7 @@
"Coastlines_15m",
"Reference_Features_15m",
"Reference_Labels_15m",
+ "Reference_Labels_15m_arctic",
"Graticule_15m",
"HLS_MGRS_Granule_Grid",
"MODIS_Water_Mask",
diff --git a/config/default/common/config/wv.json/layers/reference/Reference_Labels_15m.json b/config/default/common/config/wv.json/layers/reference/Reference_Labels_15m.json
index 5c359da8f..748dcd9a0 100644
--- a/config/default/common/config/wv.json/layers/reference/Reference_Labels_15m.json
+++ b/config/default/common/config/wv.json/layers/reference/Reference_Labels_15m.json
@@ -2,22 +2,30 @@
"layers": {
"Reference_Labels_15m": {
"id": "Reference_Labels_15m",
+ "layerName": "World_Basemap_GCS_v2",
+ "title": "Place Labels",
+ "subtitle": "Sources: Esri, TomTom, Garmin, FAO, NOAA, USGS, © OpenStreetMap contributors, and the GIS User Community",
"description": "reference/Reference_Labels_15m",
- "tags": "osm reference, country, countries, state, province, cities, city, towns, town, lakes, lake, parks, park, airports, airport",
"group": "overlays",
+ "tags": "esri world basemap gcs v2, country, countries, state, province, cities, city, towns, town, lakes, lake, parks, park, airports, airport",
+ "format": "application/x-protobuf",
+ "type": "indexedVector",
+ "disableSnapshot": true,
"layergroup": "Reference",
- "noTransition": true,
"wrapX": true,
+ "noTransition": true,
+ "serviceName": "VectorTileServer",
+ "tiles": [
+ "tile/{z}/{y}/{x}.pbf"
+ ],
"projections": {
- "arctic": {
- "id": "Reference_Labels",
- "tags": "osm reference, country, countries, state, province, cities, city",
- "source": "GIBS:arctic",
- "matrixSet": "250m"
- },
"geographic": {
- "source": "GIBS:geographic"
+ "source": "ESRI"
}
+ },
+ "vectorStyle": {
+ "id": "Reference_Labels_15m",
+ "url": "https://nasa.maps.arcgis.com/sharing/rest/content/items/b611632010304f9a9358e1eec064cd25/resources/styles/root.json?f=pjson"
}
}
}
diff --git a/config/default/common/config/wv.json/layers/reference/Reference_Labels_15m_arctic.json b/config/default/common/config/wv.json/layers/reference/Reference_Labels_15m_arctic.json
new file mode 100644
index 000000000..a34f43cd6
--- /dev/null
+++ b/config/default/common/config/wv.json/layers/reference/Reference_Labels_15m_arctic.json
@@ -0,0 +1,25 @@
+{
+ "layers": {
+ "Reference_Labels_15m_arctic": {
+ "id": "Reference_Labels_15m_arctic",
+ "title": "Place Labels",
+ "subtitle": "© OpenStreetMap contributors, Natural Earth",
+ "description": "reference/Reference_Labels_15m_arctic",
+ "tags": "osm reference, country, countries, state, province, cities, city, towns, town, lakes, lake, parks, park, airports, airport",
+ "group": "overlays",
+ "layergroup": "Reference",
+ "noTransition": true,
+ "wrapX": true,
+ "type": "wmts",
+ "format": "image/png",
+ "projections": {
+ "arctic": {
+ "id": "Reference_Labels",
+ "tags": "osm reference, country, countries, state, province, cities, city",
+ "source": "GIBS:arctic",
+ "matrixSet": "250m"
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/config/default/release/config/wv.json/sources.json b/config/default/release/config/wv.json/sources.json
index 8b4694ce0..47254375e 100644
--- a/config/default/release/config/wv.json/sources.json
+++ b/config/default/release/config/wv.json/sources.json
@@ -210,6 +210,9 @@
},
"AERONET": {
"url": "https://aeronet.gsfc.nasa.gov/cgi-bin/print_web_data_v3"
+ },
+ "ESRI": {
+ "url": "https://basemaps.arcgis.com/arcgis/rest/services"
}
}
}
diff --git a/e2e/features/global-unit/coordinate-format-test.spec.js b/e2e/features/global-unit/coordinate-format-test.spec.js
index cc2d83951..29bf80bb5 100644
--- a/e2e/features/global-unit/coordinate-format-test.spec.js
+++ b/e2e/features/global-unit/coordinate-format-test.spec.js
@@ -2,7 +2,7 @@
const { test, expect } = require('@playwright/test')
const { closeModal } = require('../../test-utils/hooks/wvHooks')
-const url = 'http://localhost:3000/?v=-78.52435703125,37.8608744140625,-75.56244296875,39.7483255859375&l=Reference_Labels_15m,Reference_Features_15m(hidden),Coastlines_15m,VIIRS_NOAA20_CorrectedReflectance_TrueColor(hidden),VIIRS_SNPP_CorrectedReflectance_TrueColor(hidden),MODIS_Aqua_CorrectedReflectance_TrueColor(hidden),MODIS_Terra_CorrectedReflectance_TrueColor&lg=false&s=-77.0434,38.8046&t=2023-02-15-T19%3A53%3A41Z'
+const url = 'http://localhost:3000/?v=-78.52435703125,37.8608744140625,-75.56244296875,39.7483255859375&l=Reference_Features_15m(hidden),Coastlines_15m,VIIRS_NOAA20_CorrectedReflectance_TrueColor(hidden),VIIRS_SNPP_CorrectedReflectance_TrueColor(hidden),MODIS_Aqua_CorrectedReflectance_TrueColor(hidden),MODIS_Terra_CorrectedReflectance_TrueColor&lg=false&s=-77.0434,38.8046&t=2023-02-15-T19%3A53%3A41Z'
let page
let dmButton
let marker
diff --git a/package-lock.json b/package-lock.json
index 0d3fcfe36..ababb536d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -17464,6 +17464,8 @@
},
"node_modules/undici": {
"version": "6.21.1",
+ "resolved": "https://registry.npmjs.org/undici/-/undici-6.21.1.tgz",
+ "integrity": "sha512-q/1rj5D0/zayJB2FraXdaWxbhWiNKDvu8naDT2dl1yTlvJp4BLtOcp2a5BvgGNQpYYJzau7tf1WgKv3b+7mqpQ==",
"dev": true,
"license": "MIT",
"engines": {
diff --git a/tasks/build-options/getVisMetadata.js b/tasks/build-options/getVisMetadata.js
index f4a0be115..0946b6464 100644
--- a/tasks/build-options/getVisMetadata.js
+++ b/tasks/build-options/getVisMetadata.js
@@ -99,7 +99,8 @@ const skipLayers = [
'AERONET_ANGSTROM_440-870NM',
'DAILY_AERONET_AOD_500NM',
'DAILY_AERONET_ANGSTROM_440-870NM',
- 'NOAA_2025_ERI_WMTS'
+ 'NOAA_2025_ERI_WMTS',
+ 'Reference_Labels_15m_arctic'
]
// NOTE: Only using these properties at this time
diff --git a/web/images/layers/previews/arctic/Reference_Labels_15m.jpg b/web/images/layers/previews/arctic/Reference_Labels_15m_arctic.jpg
similarity index 100%
rename from web/images/layers/previews/arctic/Reference_Labels_15m.jpg
rename to web/images/layers/previews/arctic/Reference_Labels_15m_arctic.jpg
diff --git a/web/images/layers/previews/geographic/World_Basemap_GCS_v2.jpg b/web/images/layers/previews/geographic/World_Basemap_GCS_v2.jpg
new file mode 100644
index 000000000..7d9c05ee4
--- /dev/null
+++ b/web/images/layers/previews/geographic/World_Basemap_GCS_v2.jpg
@@ -0,0 +1,6 @@
+<?xml version='1.0' encoding="UTF-8" standalone="no" ?>
+<ServiceExceptionReport version="1.3.0" xmlns="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net/wms/1.3.0/exceptions_1_3_0.xsd">
+<ServiceException code="LayerNotDefined">
+msWMSLoadGetMapParams(): WMS server error. Invalid layer(s) given in the LAYERS parameter. A layer might be disabled for this request. Check wms/ows_enable_request settings.
+</ServiceException>
+</ServiceExceptionReport>
diff --git a/web/js/containers/map-interactions/ol-vector-interactions.js b/web/js/containers/map-interactions/ol-vector-interactions.js
index 93e6acb8e..f13516bc7 100644
--- a/web/js/containers/map-interactions/ol-vector-interactions.js
+++ b/web/js/containers/map-interactions/ol-vector-interactions.js
@@ -118,9 +118,11 @@ export class VectorInteractions extends React.Component {
if (hasFeatures && !isShowingClick && !measureIsActive) {
let isActiveLayer = false;
+ let isReferenceLayer = false;
map.forEachFeatureAtPixel(pixel, (feature, layer) => {
if (!layer) return;
const def = lodashGet(layer, 'wv.def');
+ if (def.layergroup === 'Reference') isReferenceLayer = true;
const layerExtent = layer.get('extent');
const pixelCoords = map.getCoordinateFromPixel(pixel);
const featureOutsideExtent = layerExtent && !olExtent.containsCoordinate(layerExtent, pixelCoords);
@@ -131,7 +133,7 @@ export class VectorInteractions extends React.Component {
isActiveLayer = true;
}
});
- if (isActiveLayer) {
+ if (isActiveLayer && !isReferenceLayer) {
changeCursor(true);
}
} else if (!hasFeatures && isShowingClick) {
diff --git a/web/js/map/layerbuilder.js b/web/js/map/layerbuilder.js
index e2d21b6da..bcd3b5550 100644
--- a/web/js/map/layerbuilder.js
+++ b/web/js/map/layerbuilder.js
@@ -7,7 +7,7 @@ import OlSourceXYZ from 'ol/source/XYZ';
import OlLayerGroup from 'ol/layer/Group';
import OlLayerTile from 'ol/layer/Tile';
import { get } from 'ol/proj';
-import OlTileGridTileGrid from 'ol/tilegrid/TileGrid';
+import { TileGrid as OlTileGridTileGrid, createXYZ } from 'ol/tilegrid';
import MVT from 'ol/format/MVT';
import GeoJSON from 'ol/format/GeoJSON';
import axios from 'axios';
@@ -25,6 +25,7 @@ import lodashMerge from 'lodash/merge';
import lodashEach from 'lodash/each';
import lodashGet from 'lodash/get';
import lodashCloneDeep from 'lodash/cloneDeep';
+import { applyBackground, applyStyle as olmsApplyStyle } from 'ol-mapbox-style';
import util from '../util/util';
import lookupFactory from '../ol/lookupimagetile';
import granuleLayerBuilder from './granule/granule-layer-builder';
@@ -1109,6 +1110,65 @@ export default function mapLayerBuilder(config, cache, store) {
return layer;
};
+ const createIndexedVectorLayer = async (def, options, day, state) => {
+ const { proj: { selected } } = state;
+ const { crs } = selected;
+ const { shifted } = options;
+ const {
+ layerName,
+ serviceName,
+ tiles,
+ id,
+ vectorStyle,
+ matrixSet,
+ matrixSetLimits,
+ } = def;
+
+ const projection = get(crs);
+ const tileGrid = createXYZ({
+ extent: projection.getExtent(),
+ tileSize: [512, 512],
+ maxResolution: 180 / 256,
+ maxZoom: 22,
+ });
+
+ const configSource = config.sources[def.source];
+ const configMatrixSet = configSource.matrixSets?.[matrixSet] || {
+ resolutions: tileGrid.getResolutions(),
+ tileSize: tileGrid.getTileSize(),
+ };
+ const { extent } = calcExtentsFromLimits(configMatrixSet, matrixSetLimits, day, selected);
+
+ const sourceOptions = {
+ url: `${configSource.url}/${layerName}/${serviceName}/${tiles[0]}`,
+ projection,
+ format: new MVT(),
+ tileGrid,
+ };
+ const source = new SourceVectorTile(sourceOptions);
+
+ const layer = new LayerVectorTile({
+ source,
+ extent: shifted ? RIGHT_WING_EXTENT : extent,
+ className: id,
+ declutter: true,
+ renderMode: 'hybrid',
+ });
+ await olmsApplyStyle(layer, vectorStyle.url, {
+ resolutions: tileGrid.getResolutions(),
+ transformRequest(url, type) {
+ if (type === 'Source') {
+ return new Request(
+ url.replace('/VectorTileServer', '/VectorTileServer/'),
+ );
+ }
+ },
+ });
+ await applyBackground(layer, vectorStyle.url);
+
+ return layer;
+ };
+
const createLayerCompositeWMTS = async (def, options, day, state) => {
const { proj } = state;
const { shifted, date } = options;
@@ -1223,6 +1283,9 @@ export default function mapLayerBuilder(config, cache, store) {
case 'xyz':
layer = await getLayer(createXYZLayer, def, options, attributes, wrapLayer);
break;
+ case 'indexedVector':
+ layer = await getLayer(createIndexedVectorLayer, def, options, attributes, wrapLayer);
+ break;
case 'composite:wmts':
layer = await getLayer(createLayerCompositeWMTS, def, options, attributes, wrapLayer);
break;
diff --git a/web/js/modules/layers/selectors.js b/web/js/modules/layers/selectors.js
index ab3e9b430..f5830af8b 100644
--- a/web/js/modules/layers/selectors.js
+++ b/web/js/modules/layers/selectors.js
@@ -791,11 +791,11 @@ function getZoomLevel(layer, zoom, proj, sources) {
// Account for offset between the map's top zoom level and the
// lowest-resolution TileMatrix in polar layers
const zoomOffset = proj === 'arctic' || proj === 'antarctic' ? 1 : 0;
- const { matrixSet } = layer.projections[proj];
+ const { matrixSet, source } = layer.projections[proj];
+ const resolutions = sources?.[source]?.matrixSets?.[matrixSet]?.resolutions;
- if (matrixSet !== undefined && layer.type !== 'vector') {
- const { source } = layer.projections[proj];
- const zoomLimit = sources[source].matrixSets[matrixSet].resolutions.length - 1 + zoomOffset;
+ if (matrixSet !== undefined && layer.type !== 'vector' && Array.isArray(resolutions)) {
+ const zoomLimit = resolutions.length - 1 + zoomOffset;
if (zoom > zoomLimit) {
const overZoomValue = Math.round((zoom - zoomLimit) * 100) / 100;
return overZoomValue;
@@ -834,10 +834,10 @@ export function getMaxZoomLevelLayerCollection(layers, zoom, proj, sources) {
let maxZoom;
lodashEach(layers, (layer) => {
- const { matrixSet } = layer.projections[proj];
- if (matrixSet !== undefined && layer.type !== 'vector') {
- const { source } = layer.projections[proj];
- const zoomLimit = sources[source].matrixSets[matrixSet].resolutions.length - 1 + zoomOffset;
+ const { matrixSet, source } = layer.projections[proj];
+ const resolutions = sources?.[source]?.matrixSets?.[matrixSet]?.resolutions;
+ if (matrixSet !== undefined && layer.type !== 'vector' && Array.isArray(resolutions)) {
+ const zoomLimit = resolutions.length - 1 + zoomOffset;
if (!maxZoom) {
maxZoom = zoomLimit;
}
diff --git a/web/js/modules/product-picker/format-config.js b/web/js/modules/product-picker/format-config.js
index be47637ed..25b794a30 100644
--- a/web/js/modules/product-picker/format-config.js
+++ b/web/js/modules/product-picker/format-config.js
@@ -82,6 +82,7 @@ function setCoverageFacetProp(layer, selectedDate) {
function setTypeProp(layer) {
const { type } = layer;
const rasterTypes = ['wms', 'wmts', 'xyz', 'composite:wmts'];
+ const vectorTypes = ['vector', 'indexedVector'];
if (rasterTypes.includes(type)) {
layer.type = 'Raster (Mosaicked)';
}
@@ -91,6 +92,9 @@ function setTypeProp(layer) {
if (layer.type === 'titiler') {
layer.type = 'Dynamically-rendered';
}
+ if (vectorTypes.includes(type)) {
+ layer.type = 'Vector';
+ }
layer.type = capitalizeFirstLetter(layer.type);
return layer;
}