Skip to content

Commit 6662a23

Browse files
authored
COG optimizations (#250)
* Disable interpolation * Load optimized COGs faster
1 parent 10b9566 commit 6662a23

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/composables/useSettings.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ export const get_global_pmtiles_url = (year: number) => {
166166
}
167167

168168
export const AREA_OVERVIEW_COG =
169-
'https://s3.us-west-2.amazonaws.com/us-west-2.opendata.source.coop/m-mohr/ftw-confidence-layers/prue_v1_field_area_500m_fieldsonly.tif'
169+
'https://s3.us-west-2.amazonaws.com/us-west-2.opendata.source.coop/m-mohr/ftw-confidence-layers/prue_v1_field_area_500m_fieldsonly_uint8_3857.tif'
170170
export const CONFIDENCE_OVERVIEW_COG =
171-
'https://s3.us-west-2.amazonaws.com/us-west-2.opendata.source.coop/m-mohr/ftw-confidence-layers/prue_v1_confidence_global.tif'
171+
'https://s3.us-west-2.amazonaws.com/us-west-2.opendata.source.coop/m-mohr/ftw-confidence-layers/prue_v1_confidence_global_uint8_3857.tif'
172172

173173
export default function useSettings() {
174174
return {

src/layers/Global-Overview-Layers.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,16 @@ export const createGlobalOverviewLayer = (settings: Settings) => {
3838
source: new GeoTIFF({
3939
sources: [
4040
{
41-
// todo: try https://tiles.rdnt.io/tiles/{z}/{x}/{y}@2x?url=
4241
url: settings.aggregate === 'confidence' ? CONFIDENCE_OVERVIEW_COG : AREA_OVERVIEW_COG,
42+
nodata: 255,
4343
min: 0,
44-
max: settings.aggregate === 'confidence' ? 1 : 2500,
44+
max: 200,
4545
},
4646
],
47+
interpolate: false,
48+
sourceOptions: {
49+
blockSize: 512 * 1024, // 512KB: capture all IFDs in 1-2 requests instead of 100+
50+
},
4751
}),
4852
minZoom: 0,
4953
maxZoom: GLOBAL_DATA_MAP_FIELD_START_ZOOM_LEVEL,

0 commit comments

Comments
 (0)