Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ repos:
^\..+|
.+\.md|
electron/.*|
patches/.*|
src/data/.*|
src/vite-env.d.ts|
index.html|
Expand All @@ -41,6 +42,7 @@ repos:
^\..+|
.+\.md|
electron/.*|
patches/.*|
src/data/.*|
src/vite-env.d.ts|
index.html|
Expand Down
16,742 changes: 7,317 additions & 9,425 deletions package-lock.json

Large diffs are not rendered by default.

69 changes: 38 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,51 +15,58 @@
"dev": "vite",
"build": "tsc && vite build && electron-builder",
"preview": "vite preview",
"clean": "rm -rf node_modules dist-electron"
"clean": "rm -rf node_modules dist-electron",
"postinstall": "patch-package"
},
"overrides": {
"@electron/rebuild": {
"tar": "^7.5.4"
}
},
"dependencies": {
"@aws-sdk/client-dynamodb": "^3.933.0",
"@aws-sdk/client-s3": "^3.933.0",
"@aws-sdk/client-sagemaker": "^3.933.0",
"@aws-sdk/client-sqs": "^3.933.0",
"@aws-sdk/client-sts": "^3.933.0",
"@aws-sdk/credential-providers": "^3.933.0",
"@aws-sdk/util-dynamodb": "^3.933.0",
"@cloudscape-design/component-toolkit": "^1.0.0-beta.128",
"@cloudscape-design/components": "^3.0.1133",
"@cloudscape-design/global-styles": "^1.0.47",
"@aws-sdk/client-dynamodb": "^3.971.0",
"@aws-sdk/client-s3": "^3.971.0",
"@aws-sdk/client-sagemaker": "^3.971.0",
"@aws-sdk/client-sqs": "^3.971.0",
"@aws-sdk/client-sts": "^3.971.0",
"@aws-sdk/credential-providers": "^3.971.0",
"@aws-sdk/util-dynamodb": "^3.971.0",
"@cloudscape-design/component-toolkit": "^1.0.0-beta.131",
"@cloudscape-design/components": "^3.0.1178",
"@cloudscape-design/global-styles": "^1.0.49",
"config-ini-parser": "^1.6.1",
"electron-updater": "^6.6.2",
"resium": "^1.19.1",
"electron-updater": "^6.7.3",
"resium": "^1.19.2",
"uuid": "^13.0.0"
},
"devDependencies": {
"@playwright/test": "^1.56.1",
"@types/react": "^19.2.5",
"@playwright/test": "^1.57.0",
"@types/react": "^19.2.9",
"@types/react-dom": "^19.2.3",
"@types/uuid": "^11.0.0",
"@typescript-eslint/eslint-plugin": "^8.47.0",
"@vitejs/plugin-react": "^5.1.1",
"cesium": "^1.135.0",
"electron": "^39.2.1",
"electron-builder": "^26.0.12",
"eslint": "^9.39.1",
"@typescript-eslint/eslint-plugin": "^8.53.1",
"@vitejs/plugin-react": "^5.1.2",
"cesium": "^1.137.0",
"electron": "^40.0.0",
"electron-builder": "^26.5.0",
"eslint": "^9.39.2",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jest": "^29.1.0",
"eslint-plugin-prettier": "^5.5.4",
"eslint-plugin-jest": "^29.12.1",
"eslint-plugin-prettier": "^5.5.5",
"eslint-plugin-promise": "^7.2.1",
"eslint-plugin-simple-import-sort": "^12.1.1",
"jest": "^29.7.0",
"lint-staged": "^16.2.6",
"prettier": "^3.6.2",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"sass": "^1.94.0",
"ts-jest": "^29.4.5",
"jest": "^30.2.0",
"lint-staged": "^16.2.7",
"patch-package": "^8.0.0",
"prettier": "^3.8.0",
"react": "^19.2.3",
"react-dom": "^19.2.3",
"sass": "^1.97.2",
"ts-jest": "^29.4.6",
"typescript": "^5.9.3",
"vite": "^7.2.2",
"vite": "^7.3.1",
"vite-plugin-cesium": "^1.2.23",
"vite-plugin-electron": "^0.29.0",
"vite-plugin-electron-renderer": "^0.14.6"
Expand Down
13 changes: 13 additions & 0 deletions patches/@electron+rebuild+4.0.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/node_modules/@electron/rebuild/lib/clang-fetcher.js b/node_modules/@electron/rebuild/lib/clang-fetcher.js
index 4757695..a14f33d 100644
--- a/node_modules/@electron/rebuild/lib/clang-fetcher.js
+++ b/node_modules/@electron/rebuild/lib/clang-fetcher.js
@@ -2,7 +2,7 @@ import cp from 'node:child_process';
import debug from 'debug';
import fs from 'graceful-fs';
import path from 'node:path';
-import tar from 'tar';
+import * as tar from 'tar';
import zlib from 'node:zlib';
import { ELECTRON_GYP_DIR } from './constants.js';
import { fetch } from './fetcher.js';
161 changes: 105 additions & 56 deletions scripts/calculate_extents.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3

# Copyright 2025 Amazon.com, Inc. or its affiliates.
# Copyright 2025-2026 Amazon.com, Inc. or its affiliates.

"""
Calculate geographic extents of a raster dataset using GDAL.
Expand Down Expand Up @@ -63,74 +63,123 @@ def get_extents(dataset_path: str) -> dict:
# Get geotransform
geotransform = ds.GetGeoTransform()

# Calculate corner coordinates in the source coordinate system
# Using the geotransform: [x_origin, pixel_width, rotation, y_origin, rotation, pixel_height]
x_origin = geotransform[0]
pixel_width = geotransform[1]
y_origin = geotransform[3]
pixel_height = geotransform[5]

# Calculate the four corners in source coordinates
x_min = x_origin
x_max = x_origin + x_size * pixel_width
y_min = y_origin + y_size * pixel_height # Note: pixel_height is usually negative
y_max = y_origin

# Ensure we have the correct min/max values
if y_min > y_max:
y_min, y_max = y_max, y_min
if x_min > x_max:
x_min, x_max = x_max, x_min

# Transform the four corners to WGS84
corners = [
(x_min, y_max), # Top-left
(x_max, y_max), # Top-right
(x_max, y_min), # Bottom-right
(x_min, y_min) # Bottom-left
]

# Transform all corners to WGS84
geo_corners = []
for i, (x, y) in enumerate(corners):
if is_geographic:
# For geographic CRS, we need to check if the order is lat/lon or lon/lat
# Most modern geographic CRS use lon/lat order, but some older ones use lat/lon
# We'll try the standard lon/lat order first
# Check if geotransform is valid (not default/empty)
# Default geotransform is (0.0, 1.0, 0.0, 0.0, 0.0, 1.0) which indicates pixel coordinates
is_default_geotransform = (
geotransform[0] == 0.0 and geotransform[1] == 1.0 and
geotransform[2] == 0.0 and geotransform[3] == 0.0 and
geotransform[4] == 0.0 and geotransform[5] == 1.0
)

# Get GCPs if available
gcps = ds.GetGCPs()
gcp_projection = ds.GetGCPProjection()

# Use GCPs if geotransform is default and GCPs are available
if is_default_geotransform and gcps and len(gcps) > 0:
# Use GCPs to calculate extents
if gcp_projection:
gcp_srs = osr.SpatialReference()
gcp_srs.ImportFromWkt(gcp_projection)
else:
# If no GCP projection, assume WGS84
gcp_srs = osr.SpatialReference()
gcp_srs.ImportFromEPSG(4326)

# Create transformation from GCP CRS to WGS84
gcp_transform = osr.CoordinateTransformation(gcp_srs, tgt_srs)

# Extract geographic coordinates from GCPs
geo_corners = []
for gcp in gcps:
x, y = gcp.GCPX, gcp.GCPY
try:
# Try standard lon/lat order
lon, lat, _ = transform.TransformPoint(x, y)
# Check if the result makes sense (lat should be between -90 and 90)
# Transform GCP coordinates to WGS84
lon, lat, _ = gcp_transform.TransformPoint(x, y)
# Check if result makes sense
if -90 <= lat <= 90 and -180 <= lon <= 180:
geo_corners.append((lon, lat))
else:
# If not, try lat/lon order
lat, lon, _ = transform.TransformPoint(y, x)
# Try swapping coordinates if result doesn't make sense
lat, lon, _ = gcp_transform.TransformPoint(y, x)
geo_corners.append((lon, lat))
except:
# If transformation fails, try lat/lon order
# If transformation fails, try swapping coordinates
try:
lat, lon, _ = transform.TransformPoint(y, x)
lat, lon, _ = gcp_transform.TransformPoint(y, x)
geo_corners.append((lon, lat))
except:
# Last resort: use the original order
lon, lat, _ = transform.TransformPoint(x, y)
geo_corners.append((lon, lat))
else:
# For projected CRS, X is typically easting, Y is northing
# TransformPoint should handle the conversion correctly
try:
lat, lon, _ = transform.TransformPoint(x, y)
geo_corners.append((lon, lat))
except Exception as e:
# If transformation fails, try swapping coordinates
# Last resort: use coordinates as-is (assuming they're already WGS84)
geo_corners.append((x, y))
else:
# Use geotransform to calculate corner coordinates
# Using the geotransform: [x_origin, pixel_width, rotation, y_origin, rotation, pixel_height]
x_origin = geotransform[0]
pixel_width = geotransform[1]
y_origin = geotransform[3]
pixel_height = geotransform[5]

# Calculate the four corners in source coordinates
x_min = x_origin
x_max = x_origin + x_size * pixel_width
y_min = y_origin + y_size * pixel_height # Note: pixel_height is usually negative
y_max = y_origin

# Ensure we have the correct min/max values
if y_min > y_max:
y_min, y_max = y_max, y_min
if x_min > x_max:
x_min, x_max = x_max, x_min

# Transform the four corners to WGS84
corners = [
(x_min, y_max), # Top-left
(x_max, y_max), # Top-right
(x_max, y_min), # Bottom-right
(x_min, y_min) # Bottom-left
]

# Transform all corners to WGS84
geo_corners = []
for i, (x, y) in enumerate(corners):
if is_geographic:
# For geographic CRS, we need to check if the order is lat/lon or lon/lat
# Most modern geographic CRS use lon/lat order, but some older ones use lat/lon
# We'll try the standard lon/lat order first
try:
lon, lat, _ = transform.TransformPoint(y, x)
geo_corners.append((lon, lat))
# Try standard lon/lat order
lon, lat, _ = transform.TransformPoint(x, y)
# Check if the result makes sense (lat should be between -90 and 90)
if -90 <= lat <= 90 and -180 <= lon <= 180:
geo_corners.append((lon, lat))
else:
# If not, try lat/lon order
lat, lon, _ = transform.TransformPoint(y, x)
geo_corners.append((lon, lat))
except:
# Last resort: use the original order
# If transformation fails, try lat/lon order
try:
lat, lon, _ = transform.TransformPoint(y, x)
geo_corners.append((lon, lat))
except:
# Last resort: use the original order
lon, lat, _ = transform.TransformPoint(x, y)
geo_corners.append((lon, lat))
else:
# For projected CRS, X is typically easting, Y is northing
# TransformPoint should handle the conversion correctly
try:
lon, lat, _ = transform.TransformPoint(x, y)
geo_corners.append((lon, lat))
except Exception as e:
# If transformation fails, try swapping coordinates
try:
lon, lat, _ = transform.TransformPoint(y, x)
geo_corners.append((lon, lat))
except:
# Last resort: use the original order
lon, lat, _ = transform.TransformPoint(x, y)
geo_corners.append((lon, lat))

# Extract longitudes and latitudes
lons = [coord[0] for coord in geo_corners]
Expand Down
Loading