Skip to content

Commit

Permalink
chore: merging latest staging (#2739)
Browse files Browse the repository at this point in the history
* cog export functionality
  • Loading branch information
santilland authored Jan 28, 2025
1 parent e96ae36 commit 3e3faf1
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
2 changes: 2 additions & 0 deletions app/src/components/IndicatorData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export default {
'AQA', 'AQB', 'AQC', 'AQ3', 'REP4_1', 'REP4_4', 'REP4_6',
'MOBI1', 'MOBI1_1', 'PRCTS', 'SMCTS', 'VITS', 'E12c', 'E12d', 'E13c', 'ADO', 'ADO_1', 'ADO_2', 'ADO_3',
'Lakes_SWT', 'CROPOMHU1', 'CROPOMHU2', 'CROPOMAT1', 'CROPOMAT2', 'CROPOMHUMR1', 'CROPOMHUMR2', 'CROPOMHUSC1', 'CROPOMHUSC2', 'CROPOMRO1', 'CROPOMRO2',
'Water_Discharge_timeseries',
// Year overlap comparison
'E13e', 'E13f', 'E13g', 'E13h', 'E13i', 'E13l', 'E13m', 'Modis_SNPP_2023',
'E10a2', 'E10a6', 'N3a2', 'N3a2_chl_esa', 'N3a2_chl_jaxa', 'N3a2_TSM_esa', 'N3a2_TSM_jaxa', 'REP4_2', 'REP1', 'REP1_1', 'REP1_2',
Expand Down Expand Up @@ -1387,6 +1388,7 @@ export default {
});
const conf = {
data,
fill: false,
label: indicator.yAxis,
backgroundColor: colors,
borderColor: colors,
Expand Down
27 changes: 25 additions & 2 deletions app/src/components/OLExportButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ import { getUid } from 'ol/util';
import { toLonLat } from 'ol/proj';
import LayerGroup from 'ol/layer/Group';
import TileLayer from 'ol/layer/Tile';
import WebGLTileLayer from 'ol/layer/WebGLTile';
import { TileWMS, WMTS, XYZ } from 'ol/source';
import GeoTIFFSource from 'ol/source/GeoTIFF';
import VectorSource from 'ol/source/Vector';
import { GeoJSON, MVT, WKB } from 'ol/format';
import VectorLayer from 'ol/layer/Vector';
Expand Down Expand Up @@ -184,7 +186,7 @@ Text describing the current step of the tour and why it is interesting what the
layerArray.map((l) => {
if (l instanceof LayerGroup) {
layers.push(this.extractLayerConfig(l.getLayersArray()));
} else if (l instanceof TileLayer || l instanceof VectorLayer) {
} else if (l instanceof TileLayer || l instanceof VectorLayer || l instanceof WebGLTileLayer) {
const layerConfig = {
type: 'Tile',
properties: {
Expand All @@ -194,6 +196,9 @@ Text describing the current step of the tour and why it is interesting what the
if (l instanceof VectorLayer) {
layerConfig.type = 'Vector';
}
if (l instanceof WebGLTileLayer) {
layerConfig.type = 'WebGLTile';
}
// Evaluate what other information we need to extract for different source types
const olsource = l.getSource();
// only export visible layers
Expand All @@ -212,16 +217,34 @@ Text describing the current step of the tour and why it is interesting what the
if (olsource instanceof WMTS) {
foundType = 'WMTS';
}
if (olsource instanceof GeoTIFFSource) {
foundType = 'GeoTIFF';
}
// Extract source config
const source = {
type: foundType,
};
if (['XYZ', 'TileWMS', 'WMTS'].includes(foundType)) {
if (['XYZ', 'TileWMS', 'WMTS', 'GeoTIFF'].includes(foundType)) {
if ('url' in olsource) {
source.url = olsource.url;
} else if ('urls' in olsource) {
source.urls = olsource.urls;
}
if (foundType === 'GeoTIFF') {
// TODO: probably there should be a better way to access the style
if ('style_' in l) {
layerConfig.style = l.style_;
}
// TODO: getting sources should probably also be done more reliantly, not private
// variable and making sure other configs are considered e.g. normalization
const urls = [];
l.getSources().forEach((s) => {
urls.push({ url: s.sourceInfo_[0].url });
});
source.normalize = false;
source.sources = urls;
source.interpolate = false;
}
} else if (foundType === 'Vector') {
source.url = olsource.getUrl();
if (typeof source.url === 'undefined') {
Expand Down
6 changes: 3 additions & 3 deletions app/src/config/layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,23 @@ export const baseLayers = Object.freeze({
// },
geolandbasemap: {
name: 'Geoland Basemap',
url: '//maps1.wien.gv.at/basemap/geolandbasemap/normal/google3857/{z}/{y}/{x}.png',
url: 'https://mapsneu.wien.gv.at/basemap/geolandbasemap/normal/google3857/{z}/{y}/{x}.png',
attribution: '{ Datenquelle: <a href="https://basemap.at" target="_blank" property="dct:title">basemap.at</a> }',
visible: false,
maxNativeZoom: 18,
protocol: 'xyz',
},
bmapgelaende: {
name: 'Geoland Basemap Gelände',
url: '//maps1.wien.gv.at/basemap/bmapgelaende/grau/google3857/{z}/{y}/{x}.jpeg',
url: 'https://mapsneu.wien.gv.at/basemap/bmapgelaende/grau/google3857/{z}/{y}/{x}.jpeg',
attribution: '{ Datenquelle: <a href="https://basemap.at" target="_blank" property="dct:title">basemap.at</a> }',
visible: false,
maxNativeZoom: 18,
protocol: 'xyz',
},
bmaporthofoto30cm: {
name: 'Geoland Basemap Orthofoto',
url: '//maps1.wien.gv.at/basemap/bmaporthofoto30cm/normal/google3857/{z}/{y}/{x}.jpeg',
url: 'https://mapsneu.wien.gv.at/basemap/bmaporthofoto30cm/normal/google3857/{z}/{y}/{x}.jpeg',
attribution: '{ Datenquelle: <a href="https://basemap.at" target="_blank" property="dct:title">basemap.at</a> }',
visible: false,
maxNativeZoom: 18,
Expand Down

0 comments on commit 3e3faf1

Please sign in to comment.