From 549887827f83bf9a37dbd1b721d28422969d5911 Mon Sep 17 00:00:00 2001 From: alebinson Date: Sun, 16 Mar 2025 16:52:15 +0200 Subject: [PATCH 1/2] fix: pp date label field rename and intersect crash --- .../raster/pp-extent-vector-layer.tsx | 19 ++++++++++++------- .../layer-details/raster/pp-map.utils.ts | 2 +- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/discrete-layer/components/layer-details/raster/pp-extent-vector-layer.tsx b/src/discrete-layer/components/layer-details/raster/pp-extent-vector-layer.tsx index 574fe245b..1cfb7caa3 100644 --- a/src/discrete-layer/components/layer-details/raster/pp-extent-vector-layer.tsx +++ b/src/discrete-layer/components/layer-details/raster/pp-extent-vector-layer.tsx @@ -159,14 +159,19 @@ export const PolygonPartsVectorLayer: React.FC = o const bbox = bboxPolygon(mapOl.getView().calculateExtent([size[0] + BUFFER,size[1] + BUFFER]) as BBox); const extentPolygon = polygon(bbox.geometry.coordinates); - //@ts-ignore - const featureClippedPolygon = intersect(feat, extentPolygon); - - if (featureClippedPolygon) { - const geometry = new GeoJSON().readGeometry(featureClippedPolygon.geometry); - greenStyle.setGeometry(geometry); - } + try{ // There is some cases when turf.intersect() throws exception, then no need to change geometry + // @ts-ignore + const featureClippedPolygon = intersect(feat, extentPolygon); + if (featureClippedPolygon) { + const geometry = new GeoJSON().readGeometry(featureClippedPolygon.geometry); + greenStyle.setGeometry(geometry); + } + } + catch(e){ + console.log('*** PP: turf.intersect() failed ***', 'feat -->',feat, 'extentPolygon -->',extentPolygon); + } + return feat ? res.toString()) .findIndex(val => val === get(feature.properties, 'resolutionDegree')?.toString()) - const ingestionDateUTC = dateFormatter(get(feature.properties, 'ingestionDateUtc'), false); + const ingestionDateUTC = dateFormatter(get(feature.properties, 'imagingTimeEndUTC'), false); const updatedInVersion = get(feature.properties, 'productVersion'); let text = defaultText ?? ''; From 8d027bc111da9408268f41bb4271e139a69d70ab Mon Sep 17 00:00:00 2001 From: alebinson Date: Sun, 16 Mar 2025 17:23:53 +0200 Subject: [PATCH 2/2] fix: git workflows to v4 --- .github/workflows/Main.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Main.yaml b/.github/workflows/Main.yaml index ad10ba2f1..7eb89ed50 100644 --- a/.github/workflows/Main.yaml +++ b/.github/workflows/Main.yaml @@ -11,13 +11,13 @@ jobs: node-version: [16.13.x] steps: - name: checkout - uses: actions/checkout@v2 - - uses: actions/cache@v2 + uses: actions/checkout@v4 + - uses: actions/cache@v4 with: path: '**/node_modules' key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - name: Install yarn