Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PB-1000 : add support for local GeoTIFF import #1066

Merged
merged 5 commits into from
Sep 19, 2024

Conversation

pakb
Copy link
Contributor

@pakb pakb commented Sep 13, 2024

online GeoTIFF requires some work done on service-proxy, as it currently answers with 413 Payload Too Large (obviously...)
I've tested with a Dropbox link (hence the use of the proxy).

Test link with a GeoTIFF already added from STAC

Test link

Copy link

cypress bot commented Sep 13, 2024

web-mapviewer    Run #3360

Run Properties:  status check passed Passed #3360  •  git commit dbcc4e7317: PB-1000 : add TIFF file as available format for file input
Project web-mapviewer
Branch Review feat-PB-1000-geotiff-support
Run status status check passed Passed #3360
Run duration 05m 06s
Commit git commit dbcc4e7317: PB-1000 : add TIFF file as available format for file input
Committer Pascal Barth
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 21
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 210
View all changes introduced in this branch ↗︎

@pakb pakb requested review from ltshb and ltkum September 16, 2024 05:29
@pakb pakb force-pushed the feat-PB-1000-geotiff-support branch from 5bfb6a0 to d4809e8 Compare September 16, 2024 05:32
Copy link
Contributor

@ltshb ltshb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have any tiff file to test or any data.geo.admin.ch url to test as well, as far as I know we should be able to use data from service-stac so I wonder what did not worked.

@pakb
Copy link
Contributor Author

pakb commented Sep 16, 2024

@pakb pakb requested a review from ltshb September 16, 2024 14:50
Copy link
Contributor

@ltshb ltshb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pakb The data.geo.admin.ch link that you provide was a link to the stac browser pointing to whole collections, not a link to a STAC asset file, that's why you could not import it. Using the following link https://data.geo.admin.ch/ch.swisstopo.swissimage-dop10/swissimage-dop10_2017_2517-1139/swissimage-dop10_2017_2517-1139_0.1_2056.tif I had an issue, the import tool say successfull but I had a crash in the console and the file was not loaded
image

image

src/utils/utils.js Outdated Show resolved Hide resolved
online GeoTIFF requires some work done on service-proxy, as it currently answers with 413 Payload Too Large (obviously...)
I've tested with a Dropbox link (hence the use of the proxy). I couldn't get our STAC API to give me a file (through a URL import), it blocks somewhere (maybe on purpose, so that we don't use our STAC API as a web hosting)
instead of relying only on the file extension, will be more robust, and take into account .tif, .tiff (both as a mix of uppercased) and files without extension that are TIFF underneath
@pakb pakb force-pushed the feat-PB-1000-geotiff-support branch from 7c74796 to 2ab3ca7 Compare September 19, 2024 09:18
@pakb pakb requested a review from ltshb September 19, 2024 09:21
@pakb pakb force-pushed the feat-PB-1000-geotiff-support branch from 2ab3ca7 to 8249eb8 Compare September 19, 2024 09:34
adding the new type in the layer parser
also fixing loading GeoTIFF through URL in the OL component.
removing big-endian signature check, as 99.9% of hardware on the web uses little-endian
removing the concept of GeoTIFF layer needing to load, they are either already loaded because local file, or will be loaded through the OpenLayers component (not by us, so no need to keep track of that in the menu)
@pakb pakb force-pushed the feat-PB-1000-geotiff-support branch from 5c60375 to 758d420 Compare September 19, 2024 09:50
and also react to changes in the source of the GeoTIFF (if the URL is changed on-the-fly)
@pakb pakb force-pushed the feat-PB-1000-geotiff-support branch from 758d420 to b988b95 Compare September 19, 2024 10:02
Copy link
Contributor

@ltshb ltshb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also need to add .tiff and .tif to acceptedFileTypes. Also updte hte no_file placeholder with GeoTiff (would be nice to add as well KMZ that I forgot 😉

src/modules/i18n/locales/de.json Outdated Show resolved Hide resolved
@pakb pakb requested a review from ltshb September 19, 2024 13:06
@pakb
Copy link
Contributor Author

pakb commented Sep 19, 2024

here a couple GeoTIFF out of bounds can be found https://download.osgeo.org/geotiff/samples/zi_imaging/

Copy link
Contributor

@ltshb ltshb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one KMZ missing in translation 😉
Thanks a lot

src/modules/i18n/locales/de.json Outdated Show resolved Hide resolved
@pakb pakb force-pushed the feat-PB-1000-geotiff-support branch from 2156d12 to 270eb78 Compare September 19, 2024 13:18
also adding GeoTIFF to all labels linked to the file import UI (and KMZ that was forgotten)
awaiting the handleFileContent in the drag&drop handler, so that error can be caught correctly (and shown to the user)
@pakb pakb force-pushed the feat-PB-1000-geotiff-support branch from 270eb78 to dbcc4e7 Compare September 19, 2024 13:20
@pakb pakb merged commit 874029c into develop Sep 19, 2024
6 checks passed
@pakb pakb deleted the feat-PB-1000-geotiff-support branch September 19, 2024 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants