-
Notifications
You must be signed in to change notification settings - Fork 1
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
Implement geo upload #47
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I upload a GeoTIFF, I get JS errors (see below). The upload seems to succeed, though.
When I upload the DEM_Rest_2014 file (you sent me?), I can't find it at the same location than QGIS tells me. Also, the tile files produced by Vips are binary (i.e. only #000 and #FFF colors).
Do you have a WMS for me to test?
14:31:59.876 [Vue warn]: $listeners is readonly.
found in
---> <Portal>
<Tab>
<Tabs>
<Root> volumes.js:3924:15
14:32:01.063 [Vue warn]: $attrs is readonly.
found in
---> <Portal>
<Tab>
<Tabs>
<Root> 2 volumes.js:3924:15
14:32:01.094 Uncaught (in promise) TypeError: callback.call is not a function
finally http://localhost:8000/assets/scripts/main.js?1729685278:133407
promise callback*./node_modules/vue-resource/dist/vue-resource.esm.js/p$1.then http://localhost:8000/assets/scripts/main.js?1729685278:133394
finally http://localhost:8000/assets/scripts/main.js?1729685278:133406
uploadGeoTiff http://localhost:8000/vendor/geo/scripts/volumes.js?1729686705:15985
invokeWithErrorHandling http://localhost:8000/assets/scripts/main.js?1729685278:136516
invoker http://localhost:8000/assets/scripts/main.js?1729685278:136841
_wrapper http://localhost:8000/assets/scripts/main.js?1729685278:142244
add$1 http://localhost:8000/assets/scripts/main.js?1729685278:142248
updateListeners http://localhost:8000/assets/scripts/main.js?1729685278:136873
updateDOMListeners http://localhost:8000/assets/scripts/main.js?1729685278:142278
invokeCreateHooks http://localhost:8000/assets/scripts/main.js?1729685278:140759
createElm http://localhost:8000/assets/scripts/main.js?1729685278:140646
createChildren http://localhost:8000/assets/scripts/main.js?1729685278:140743
createElm http://localhost:8000/assets/scripts/main.js?1729685278:140644
createChildren http://localhost:8000/assets/scripts/main.js?1729685278:140743
createElm http://localhost:8000/assets/scripts/main.js?1729685278:140644
createChildren http://localhost:8000/assets/scripts/main.js?1729685278:140743
createElm http://localhost:8000/assets/scripts/main.js?1729685278:140644
patch http://localhost:8000/assets/scripts/main.js?1729685278:141167
_update http://localhost:8000/assets/scripts/main.js?1729685278:138608
updateComponent http://localhost:8000/assets/scripts/main.js?1729685278:138729
get http://localhost:8000/assets/scripts/main.js?1729685278:139143
Watcher http://localhost:8000/assets/scripts/main.js?1729685278:139132
mountComponent http://localhost:8000/assets/scripts/main.js?1729685278:138736
$mount http://localhost:8000/assets/scripts/main.js?1729685278:143742
$mount http://localhost:8000/assets/scripts/main.js?1729685278:146656
init http://localhost:8000/assets/scripts/main.js?1729685278:137788
createComponent http://localhost:8000/assets/scripts/main.js?1729685278:140668
createElm http://localhost:8000/assets/scripts/main.js?1729685278:140615
createChildren http://localhost:8000/assets/scripts/main.js?1729685278:140743
createElm http://localhost:8000/assets/scripts/main.js?1729685278:140644
patch http://localhost:8000/assets/scripts/main.js?1729685278:141167
_update http://localhost:8000/assets/scripts/main.js?1729685278:138608
updateComponent http://localhost:8000/assets/scripts/main.js?1729685278:138729
get http://localhost:8000/assets/scripts/main.js?1729685278:139143
Watcher http://localhost:8000/assets/scripts/main.js?1729685278:139132
mountComponent http://localhost:8000/assets/scripts/main.js?1729685278:138736
main.js:133407:14
getGeoTiffOverlayUrlTemplate: { | ||
method: 'GET', | ||
url: 'api/v1/volumes{/id}/geo-overlays/geotiff/url', | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getGeoTiffOverlayUrlTemplate: { | |
method: 'GET', | |
url: 'api/v1/volumes{/id}/geo-overlays/geotiff/url', | |
}, |
let data = new FormData(); | ||
data.append('geotiff', event.target.files[0]); | ||
data.append('volumeId', this.volumeId); | ||
this.upload(data) | ||
.then(this.handleSuccess, this.handleError) | ||
.finally(this.finishLoading); | ||
.finally(this.$emit('upload', false)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.finally(this.$emit('upload', false)); | |
.finally(() => this.$emit('upload', false)); |
let data = new FormData(); | ||
data.append('url', event.target[0].value); | ||
data.append('volumeId', this.volumeId); | ||
geoApi.saveWebMap({id: this.volumeId}, data) | ||
.then(this.handleSuccess, this.handleError) | ||
.finally(this.finishLoading) | ||
.finally(this.$emit('upload', false)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.finally(this.$emit('upload', false)) | |
.finally(() => this.$emit('upload', false)) |
@@ -11,13 +11,13 @@ export default { | |||
}, | |||
mixins: [ | |||
LoaderMixin, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't need the mixin any more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't need the LoaderMixin any more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The panel would look better if you disable the margin-bottom of the <ul>
or <table>
at the bottom. Otherwise there is a strange gap.
<template> | ||
<div class="table-responsive"> | ||
<table v-if="overlays.length !== 0" class="table table-sm" v-cloak> | ||
<caption><b><slot name="title"></slot></b></caption> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for a caption, really. The panel in the volume edit view already has a title.
<div class="alert alert-success" v-if="success" v-cloak> | ||
The geoTIFF-file was successfully uploaded. | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO the highlighted element in the table below is enough of a success indication. No need for an additional message.
<div class="alert alert-success" v-if="success" v-cloak> | ||
The web-map-service was successfully embedded. | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same than above.
</span> | ||
</td> | ||
<td> | ||
<button type="button" class="close" :title="title" v-on:click="remove" v-once><span aria-hidden="true">×</span></button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please center this in the column?
I get it as well, I'll have a look where it comes from.
This is most certainly due to the transformation error in the proj4php package, as discussed here.
Yes, I created a normalization of the color-band (as geoTIFF's often contain more color-information that can be set/adjusted manually by the user). So the discussed solution for now was to normalize the color-band to 0 - 255 in case it differs from that range (see code). |
Did you find the overlay? Where do I have to look? 😃
I saw that but I expected this to produce something else than the black/white image. There is no 0-255 range in the tiled image, just 0 and 255. |
Ahh, yeah it is a fairly small example-TIFF! The coordinates in EPSG:3857 are: -325165.2, 7779955.1 (Loch Davan close to Dinnet, Scotland)
I see, so I should check what goes wrong in the normalization. |
The formula used for image normalization should be working. It seems that the derived min- and max-values from libvips are not providing the correct min/max colour-band values as I expected them to be (i.e. they are different to what I see in the QGIS colour settings). Moreover, I tested with two different geoTIFF's and surprisingly the min/max of the two geoTIFF's were identical (min: |
You should try it with the Vips CLI too. If this does not show the expected values you can ask in the Vips repo. The maintainer is extremely responsive and helpful if you provide a good description of the problem and an example file. |
I tried with the CLI and get the correct |
(please use @mzur, otherwise I don't get notified of activity here) If this can be fixed by creating the geoTIFF in any other way then we could add an explanation to the manual and just expect geoTIFFs with the correct format. Then there is no need for special handling of edge cases (for now). |
I tested the WMS now and it works fine. I noticed an error on the geo map of a volume (not the map in the filter modal). When I open the label trees tab there, it says |
…nated single arithmetic operations.
I've implemented the color normalization such that NoData values of -99999 will get excluded in order to calculate the true min (see conversation on libvips discussion). I therefore would add an excerpt to the manual stating that color-band normalization should either be done beforehand or the NoData values of the geoTIFF should be set to -99999 in order to be handled correctly by BIIGLE. |
Sounds good 👍 |
That's fixed now.
Regarding the latter, I tried to find where the warning is coming from by debugging the code, but I couldn't figure out what causes it. It is still unclear to me...
I looked into the whole upload process of the geoTIFF files, comprised of: and commenting lines step by step to see where the warning stems from, but it's still not obvious to me. Do you have any idea or instinct what could cause such warning? |
references #44
Implement the structure for the upload mechanism in the volume-edit view. Allow the upload of both - browsing layers and context layers - i.e. upload of geoTIFF and (iFDO) metadata, linkage of WMS.
associated PR's: