Skip to content

Commit 08660aa

Browse files
authored
RCM-ARD release (#158)
* Only load localstate if params are not included in url request * Clear all params other than organizations * Update localStorage.ts * Removed if statement to force filter reset if url params are provided * Update localStorage.ts * Update localStorage.ts * Update localStorage.ts * Update localStorage.ts * Update thumbnail-config.json to use different api endpoint which better supports binary formats * Initial commit for RCM-ARD * Fixing logic to enable the loading of COG from rcm-ard collection * debug for rcm-ard * typo * Improve readability of imageUrls variable and add application/geotiff * typo * c;ode cleanup to determine if thumnail png or COG geotiff should be loaded * set max to 98th percentile to improve shading for rcm-ard * Invalidate localstorage after 5 minutes instead of checking params in url * Adjust padding to account for left search panel * Use longitude offset based on zoom level * add debug code * set new time for session after session expiry * bug fixes to localstorage * Update geosearch.tsx * adjust longitude offset * Update geosearch.tsx * Update geosearch.tsx * use getBoundsZoom to calculate best zoom level * Update geosearch.tsx * fix bug related to console output * Update geosearch.tsx * Update geosearch.tsx * Update geosearch.tsx * Update geosearch.tsx * Update geosearch.tsx * Update geosearch.tsx * Update geosearch.tsx * Update geosearch.tsx * Update geosearch.tsx * Update geosearch.tsx * Update geosearch.tsx * Update geosearch.tsx * Update geosearch.tsx * Update geosearch.tsx * Update geosearch.tsx * Update geosearch.tsx * Update geosearch.tsx * Update geosearch.tsx * Update geosearch.tsx * Update geosearch.tsx * Update geosearch.tsx * Update geosearch.tsx * Update geosearch.tsx * Update geosearch.tsx * Update geosearch.tsx * Removes bbox when paging. Zoom to extent of canada before zoom/panning * Create reset to initial map function * debug map reset * Update geosearch.tsx * Update geosearch.tsx * Update geosearch.tsx * Update geosearch.tsx * Update geosearch.tsx * Update geosearch.tsx * Add tooltip for rcm-ard in en/fr * Set min zoom to 4 to improve stability of the app * refactor display of eo and thumbnails on search page * Change default text * minor fixes * change rcm-ard polarization to new format * For colour ramp use 98th percentile instead of max * Change to draw bbox if tiling fails
1 parent a3898b8 commit 08660aa

File tree

12 files changed

+412
-161
lines changed

12 files changed

+412
-161
lines changed

src/common/map.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const lccMapOptionsParam: MapOptions = {
1414
// Web Mercator map options
1515
const wmMapOptionsParam: MapOptions = {
1616
zoomFactor: 5,
17-
minZoom: 2,
17+
minZoom: 4,
1818
maxZooom: 19,
1919
maxBounds: new LatLngBounds({ lat: -89.999, lng: -180 }, { lat: 89.999, lng: 180 }),
2020
maxBoundsViscosity: 0.0,

src/components/search/data-collection-option.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,9 @@
66
{
77
"label": "datacollection.SENTINEL1",
88
"value": "sentinel-1"
9+
},
10+
{
11+
"label": "datacollection.RCM-ARD",
12+
"value": "rcm-ard"
913
}
1014
]

src/components/search/geosearch.tsx

Lines changed: 184 additions & 68 deletions
Large diffs are not rendered by default.

src/components/search/metadatapage.jsx

Lines changed: 57 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -170,43 +170,63 @@ const MetaDataPage = (props) => {
170170
setSimilarRecords(sims);
171171
setShowSimilarRecords(sims.slice(0, 5));
172172
}
173-
if(res.options){
174-
const imageUrls=res.options.filter(o=>o.url && o.url!==null && o.description && o.description.en && (o.description.en.toLowerCase().indexOf("data;tiff;")>=0||o.description.en.toLowerCase().indexOf("image/tiff")>=0
175-
||o.description.en.toLowerCase().indexOf("thumbnail;png")>=0
176-
||o.description.en.toLowerCase().indexOf("image/png")>=0
177-
||o.description.en.toLowerCase().indexOf("thumbnail;jpeg")>=0
178-
||o.description.en.toLowerCase().indexOf("image/jpeg")>=0));
173+
if(res.options){
174+
const imageUrls = res.options.filter(o =>
175+
o.url && o.url !== null &&
176+
o.description && o.description.en &&
177+
(
178+
o.description.en.toLowerCase().indexOf("data;tiff;") >= 0 ||
179+
o.description.en.toLowerCase().indexOf("image/tiff") >= 0 ||
180+
o.description.en.toLowerCase().indexOf("thumbnail;png") >= 0 ||
181+
o.description.en.toLowerCase().indexOf("image/png") >= 0 ||
182+
o.description.en.toLowerCase().indexOf("thumbnail;jpeg") >= 0 ||
183+
o.description.en.toLowerCase().indexOf("image/jpeg") >= 0 ||
184+
o.description.en.toLowerCase().indexOf("application/geotiff") >= 0
185+
)
186+
);
179187
let url;
180-
const isSentinel1=imageUrls.length>0 && res.sourceSystemName.toLowerCase().indexOf("eodms")>=0 && res.eoCollection==='sentinel-1' && thumbnailConfig['eodms_use_image'];
188+
const isSentinel1=imageUrls.length>0 && res.sourceSystemName.toLowerCase().indexOf("ccmeo-eodms")>=0 && res.eoCollection==='sentinel-1' && thumbnailConfig['eodms_use_image'];
189+
const isRCMARD=imageUrls.length>0 && res.sourceSystemName.toLowerCase().indexOf("ccmeo-eodms")>=0 && res.eoCollection==='rcm-ard';
190+
const isDatacube=imageUrls.length>0 && res.sourceSystemName.toLowerCase().indexOf("ccmeo-datacube")>=0;
181191
if (isSentinel1) setTileServiceUrl(null);
182-
const hasImage=imageUrls.length>0 && res.keywords.toLowerCase().indexOf("stac")>=0;
183-
if(imageUrls.length>0){
192+
const hasImage=imageUrls.length>0 && res.keywords.toLowerCase().indexOf("stac")>=0;
193+
if (isSentinel1 && imageUrls.length > 0) {
194+
// Set URL to load the thumbnail image
184195
let thumbnail_correction = thumbnailConfig['thumbnail_correction_proxy_dev'];
185196
let orbitDirection = res.eoFilters[0]?.orbitState;
186-
//console.log(orbitDirection);
187-
url=thumbnail_correction + imageUrls[0].url + "&side=" + orbitDirection;
188-
//handling if image is type tiff
189-
let imgUrlsTIFF=imageUrls.filter(o=>o.description.en.toLowerCase().indexOf("data;tiff;")>=0||o.description.en.toLowerCase().indexOf("image/tiff")>=0);
190-
if(imgUrlsTIFF.length>0){
191-
url=imgUrlsTIFF[0].url;
192-
}
197+
url = thumbnail_correction + imageUrls[0].url + "&side=" + orbitDirection;
193198
}
194-
195-
if(!isSentinel1 && hasImage){
199+
else if ((isRCMARD || isDatacube) && imageUrls.length > 0) {
200+
// Set URL to load the COG geotiff
201+
let imgUrlsTIFF = imageUrls.filter(o => (
202+
o.description.en.toLowerCase().indexOf("data;tiff;") >= 0 ||
203+
o.description.en.toLowerCase().indexOf("image/tiff") >= 0 ||
204+
o.description.en.toLowerCase().indexOf("application/geotiff") >= 0
205+
));
196206

207+
if (imgUrlsTIFF.length > 0) {
208+
url = imgUrlsTIFF[0].url;
209+
}
210+
}
211+
console.log(imageUrls);
212+
console.log(isRCMARD);
213+
console.log(isDatacube);
214+
console.log(hasImage);
215+
if((isRCMARD || isDatacube) && hasImage){
216+
console.log("trying to load tile");
197217
axios.get(`${EnvGlobals.COG_TILEJSON_URL}`, {params: {url}}).then((res)=>{
198-
//console.log(res);
218+
console.log(res);
199219
const centers=res.data.center;
200220
setCogCenter(new LatLng(centers[1], centers[0]));
201221
setCogZoom(centers[2]);
202222
const imageBounds = L.latLngBounds([[res.data.bounds[3], res.data.bounds[2]],[res.data.bounds[1], res.data.bounds[0]]]);
203223
setCogBounds(imageBounds);
204224
axios.get(`${EnvGlobals.COG_STATISTICS_URL}`, {params: {url, unscale: 'false', resampling:'nearest', max_size: '1024', categorical: 'false'}}).then((res2)=>{
205-
//console.log(res2);
225+
console.log(res2);
206226
const min=res2.data.b1.min;
207-
const max=res2.data.b1.max;
227+
const max=res2.data.b1.percentile_98;
208228
setTileServiceUrl(`${EnvGlobals.COG_TILESERVICE_URL}?url=${url}&resampling_method=nearest&bidx=1&rescale=${min}%2C${max}`);
209-
setLoading1(false);
229+
setLoading1(false);
210230
});
211231
}).catch(err=>{
212232
//console.log('tilejson', err);
@@ -437,12 +457,20 @@ const MetaDataPage = (props) => {
437457
const desc = option.description[language].split(";");
438458
return { name: option.name[language], type: desc[0], format: desc[1], language: t(`page.${desc[2].toLowerCase().replace(',', '')}`), url: option.url };
439459
});
440-
const imageUrls=formattedOption.filter(o=>o.url && o.url!==null && o.description && o.description.en && (o.description.en.toLowerCase().indexOf("data;tiff;")>=0
441-
||o.description.en.toLowerCase().indexOf("image/tiff")>=0
442-
||o.description.en.toLowerCase().indexOf("thumbnail;png")>=0
443-
||o.description.en.toLowerCase().indexOf("image/png")>=0
444-
||o.description.en.toLowerCase().indexOf("thumbnail;jpeg")>=0
445-
||o.description.en.toLowerCase().indexOf("image/jpeg")>=0));
460+
461+
const imageUrls = formattedOption.filter(o =>
462+
o.url && o.url !== null &&
463+
o.description && o.description.en &&
464+
(
465+
o.description.en.toLowerCase().indexOf("data;tiff;") >= 0 ||
466+
o.description.en.toLowerCase().indexOf("image/tiff") >= 0 ||
467+
o.description.en.toLowerCase().indexOf("thumbnail;png") >= 0 ||
468+
o.description.en.toLowerCase().indexOf("image/png") >= 0 ||
469+
o.description.en.toLowerCase().indexOf("thumbnail;jpeg") >= 0 ||
470+
o.description.en.toLowerCase().indexOf("image/jpeg") >= 0 ||
471+
o.description.en.toLowerCase().indexOf("application/geotiff") >= 0
472+
)
473+
);
446474
let url;
447475
const isSentinel1=imageUrls.length>0 && result.sourceSystemName==='ccmeo-eodms' && result.eoCollection==='sentinel-1' && thumbnailConfig['eodms_use_image'];
448476
const hasImage=imageUrls.length>0 && result.keywords.toLowerCase().indexOf("stac")>=0;
@@ -848,7 +876,7 @@ const MetaDataPage = (props) => {
848876
<ImageOverlay
849877
url={url}
850878
bounds={bounds}
851-
opacity={1}
879+
opacity={0.75}
852880
zIndex={10}
853881
/>
854882
</MapContainer>}
File renamed without changes.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[
2+
{
3+
"label": "polarization.DEFAULT",
4+
"value": ""
5+
},
6+
{
7+
"label": "polarization.CHCV",
8+
"value": "CH + CV"
9+
},
10+
{
11+
"label": "polarization.HHHV",
12+
"value": "HH + HV"
13+
}
14+
]
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[
2+
{
3+
"label": "polarization.DEFAULT",
4+
"value": ""
5+
},
6+
{
7+
"label": "polarization.VV",
8+
"value": "VV"
9+
},
10+
{
11+
"label": "polarization.VVVH",
12+
"value": "VV + VH"
13+
},
14+
{
15+
"label": "polarization.HH",
16+
"value": "HH"
17+
},
18+
{
19+
"label": "polarization.HHHV",
20+
"value": "HH + HV"
21+
},
22+
{
23+
"label": "polarization.HHHVVHVV",
24+
"value": "HH + HV + VH + VV"
25+
},
26+
{
27+
"label": "polarization.HHVV",
28+
"value": "HH + VV"
29+
},
30+
{
31+
"label": "polarization.HV",
32+
"value": "HV"
33+
},
34+
{
35+
"label": "polarization.VH",
36+
"value": "VH"
37+
}
38+
]

src/components/searchfilter/eo-filter.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@
66
}
77
.sentinel-1 {
88
padding-left: 10px;
9-
}
9+
}
10+
.rcm-ard {
11+
padding-left: 10px;
12+
}

src/components/searchfilter/eo-filter.tsx

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import { useState } from 'react';
22
import { useTranslation } from 'react-i18next';
33
import dataCollectionOptions from '../search/data-collection-option.json';
44
import orbitOptions from '../search/orbit-direction-option.json';
5-
import polarizationOptions from '../search/polarization-option.json';
5+
import polarizationOptionsSentinel from '../search/polarization-option-sentinel-1.json';
6+
import polarizationOptionsRCMARD from '../search/polarization-option-rcm-ard.json';
67
import DropdownSelection from './dropdown-selection';
78
import './eo-filter.scss';
89

@@ -47,7 +48,7 @@ export default function EoSearchFilter(props: EoSearchProps): JSX.Element {
4748
{ dataCollection === 'sentinel-1' && (<div className="sentinel-1">
4849
<DropdownSelection
4950
label="filter.label.eofilter.polarization"
50-
options={polarizationOptions}
51+
options={polarizationOptionsSentinel}
5152
labelClassName="dropdown-select-label"
5253
selectClassName="dropdown-select"
5354
optionClassName="dropdown-select-option"
@@ -56,7 +57,34 @@ export default function EoSearchFilter(props: EoSearchProps): JSX.Element {
5657
onSelect={handlePolarizationChange}
5758
tooltip
5859
tooltipTitle='filter.label.eofilter.polarization-tooltip'
60+
/>
61+
<DropdownSelection
62+
label="filter.label.eofilter.orbit"
63+
options={orbitOptions}
64+
labelClassName="dropdown-select-label"
65+
selectClassName="dropdown-select"
66+
optionClassName="dropdown-select-option"
67+
iconClassName="dropdown-select-icon"
68+
defaultValue={orbit}
69+
onSelect={handleOrbitChange}
70+
tooltip
71+
tooltipTitle='filter.label.eofilter.orbit-tooltip'
5972
/>
73+
</div>
74+
) }
75+
{ dataCollection === 'rcm-ard' && (<div className="rcm-ard">
76+
<DropdownSelection
77+
label="filter.label.eofilter.polarization"
78+
options={polarizationOptionsRCMARD}
79+
labelClassName="dropdown-select-label"
80+
selectClassName="dropdown-select"
81+
optionClassName="dropdown-select-option"
82+
iconClassName="dropdown-select-icon"
83+
defaultValue={polarization}
84+
onSelect={handlePolarizationChange}
85+
tooltip
86+
tooltipTitle='filter.label.eofilter.polarization-tooltip'
87+
/>
6088
<DropdownSelection
6189
label="filter.label.eofilter.orbit"
6290
options={orbitOptions}

src/locales/en-CA/translation.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@
117117
"data-collection-tooltip":"",
118118
"polarization-tooltip":"Determines with which polarisation the data was acquired. The first letter indicates the polarisation when sending the signal, the second letter when receiving the signal, e.g., HV = horizontal polarisation when sending the signal and vertical polarisation when receiving. <br/>Data can be acquired in single polarisation HH (SH) or VV (SV) or in dual polarisation HH&HV (DH) or VV&VH (DV), depending on the instrument mode. <br/>SM, IW and EW can be acquired in single or dual polarisation. WV can only be acquired in single polarisation.",
119119
"orbit-tooltip":"Determines whether the data was recorded during a descending orbit (flight direction: north - south) or an ascending orbit (flight direction: south - north).",
120-
"sentinel-1-tooltip":"<Strong>Sentinel-1</Strong> provides all-weather, day and night radar imagery for land and ocean services. <br/>EO Browser provides data acquired in Interferometric Wide Swath (IW) and Extra Wide Swath (EW) modes processed to Level-1 Ground Range Detected (GRD)."
120+
"sentinel-1-tooltip":"<Strong>Sentinel-1</Strong> provides all-weather, day and night radar imagery for land and ocean services. <br/>EO Browser provides data acquired in Interferometric Wide Swath (IW) and Extra Wide Swath (EW) modes processed to Level-1 Ground Range Detected (GRD).",
121+
"rcm-ard-tooltip":"<Strong>Radarsat Constellation Mission (RCM) - Analysis Ready Data (ARD) </Strong> includes a trio of Earth observation satellites, capable of scanning Earth day or night and in any weather conditions. The three-satellite configuration allows for daily revisits of Canada's vast territory and maritime approaches, as well as daily access to 90% of the world's surface and the Arctic up to four times a day."
121122
}
122123
}
123124
},
@@ -292,25 +293,27 @@
292293
"NU": "Nunavut",
293294
"NT": "Northwest Territories",
294295
"YT": "Yukon",
295-
"DEFAULT": "Please select one"
296+
"DEFAULT": "Show all"
296297
},
297298
"datacollection": {
298-
"DEFAULT": "Please select one",
299-
"SENTINEL1": "Sentinel-1"
299+
"DEFAULT": "Show all",
300+
"SENTINEL1": "Sentinel-1",
301+
"RCM-ARD": "Radarsat Constellation Mission (RCM) - Analysis Ready Data (ARD)"
300302
},
301303
"polarization": {
302-
"DEFAULT": "Please select one",
304+
"DEFAULT": "Show all",
303305
"VV": "VV",
304306
"VVVH": "VV+VH",
305307
"HH": "HH",
306308
"HHHV": "HH+HV",
307309
"HHHVVHVV":"HH+HV+VH+VV",
308310
"HHVV":"HH+VV",
309311
"HV": "HV",
310-
"VH": "VH"
312+
"VH": "VH",
313+
"CHCV": "CH+CV"
311314
},
312315
"orbit": {
313-
"DEFAULT": "Please select one",
316+
"DEFAULT": "Show all",
314317
"ASC": "Ascending",
315318
"DESC": "Descending"
316319
},

0 commit comments

Comments
 (0)