-
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?
Changes from 17 commits
c0aa459
a71b958
0746ebe
444cbd1
d676299
d4bcc71
a073726
34c92bf
2b4ebcd
947f673
2638389
95706ba
d686aa2
ee70bfa
6a73c5e
fb78c78
89af5cf
df0ad5c
0e772f3
5761319
eb718c8
dda9101
9df6bec
351c681
fdc0e79
7004442
c2d9cfd
38f1aaf
52823b0
f777192
f077427
6a6276b
55ef050
6c52399
93b8902
127756b
48b9440
c7a260f
7b9aeab
50d18d5
5986053
6f2dd3f
6f548fd
c18e2a4
0df5bb9
0071506
c874fbf
b2b75af
8f1f048
632905e
14da1d4
00a4b54
9339404
d455679
23984da
ea24a0c
33f97a2
6af3262
102ad90
f701f84
25c79a7
acfe531
1de793d
af0ddb3
2f884a4
4d0f1ec
fadf9e7
7f327f3
98fd3bb
936a320
1cc7794
447ec05
83c8eb8
1005b17
5eaf4e4
edddd13
30984f6
31359c9
ca6e1a6
410059d
bed71f9
d70e241
65cd08c
644e904
0c921d5
103c79c
da07e1b
5688e65
4658616
5fad5c2
384dfb3
08e60fb
8725832
26b28f4
13e1912
2104455
9c1dac6
39e9e3b
4b66d00
ebdae3e
fb302d6
561f9e6
714514d
c7cb2b0
5f5b729
d345083
5e8f57c
8bf6c4e
23eab2d
86e86ed
7a4820b
f4039ac
9d916d5
1591460
5497cbc
e99e9d7
2441478
22188bd
159dc83
af534ab
231ee92
0eeb3e1
099f452
51a8240
5caedea
cf5ef8f
8158697
40df7da
84fa33e
97922b0
caf589c
d85eb38
7c7ad9c
2e3c89d
0059a1b
777c053
4a886ea
b54b44c
1c00d56
6c9b3fe
7b39c2c
d013f98
ef4afd7
6e00ef4
96d4dbc
05e87b4
1bdf0a2
ffdfc99
3624eeb
8c843ca
92af2d8
0ded10b
5145edd
5fdecee
add1927
0a28356
a36873c
eefcce4
c4a23fd
91313ab
5c2089a
deefdc5
11bb80a
70c79ab
6ce459f
b2c3196
fdcbeae
aacf41c
ff3a658
6b98f40
3d0782d
8e54bc7
b69e73f
a821f79
4df78e9
cafb808
bb6b2c6
a8a92d0
51b42e1
68c4dc9
df7350c
2fab705
250a316
2923e88
59e0ee7
5de268c
fe0e159
cf49142
1559b18
bd69687
7d67cb6
f31d13f
493f72f
b5d46a6
eb44da7
d7f003f
6a80981
44ce5eb
c7b1a34
214925c
417c716
e076b16
81b5982
df1ee15
33ab77a
c0c7414
40bafbe
52e7c69
1a7e774
7481bfc
2fc5850
ab7bc5e
2ac3612
8b96214
beda6c2
98c3780
b716637
1a96bea
47962e6
8aa75e4
9d23357
0f7d1bb
f96aa3e
bd8b47d
9781856
ac181bf
a641fcf
66f67e6
644d70d
0c4efb7
952cd78
99181d2
ddf61fe
b7a13ea
6bd7301
b1b0de9
296f2a9
bd3ee4e
23c2ae1
7a48b90
8693f2d
19d2251
64ec0a0
56d76f9
c745a5f
3b5c206
b40a81f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,10 +66,11 @@ public function handle() | |
public function generateTiles($file, $path) | ||
{ | ||
$vipsImage = $this->getVipsImage($path); | ||
$min = $vipsImage->min(); | ||
// exclude the NoData values (-99999) of the geoTIFF file when searching the min | ||
$min = $vipsImage->equal(-99999)->ifthenelse(0, $vipsImage)->min(); | ||
$max = $vipsImage->max(); | ||
|
||
if($min < 0 || $max > 255) { | ||
if($min < 0 || $min > 255 || $max < 0 || $max > 255) { | ||
$this->imageNormalization($vipsImage, $min, $max)->dzsave($this->tempPath, [ | ||
'layout' => 'zoomify', | ||
'container' => 'fs', | ||
|
@@ -78,7 +79,6 @@ public function generateTiles($file, $path) | |
} else { | ||
parent::generateTiles($file, $path); | ||
} | ||
|
||
} | ||
|
||
/** | ||
|
@@ -104,7 +104,7 @@ protected function getVipsImage($path) | |
*/ | ||
protected function imageNormalization($vipsImage, $min, $max) | ||
{ | ||
// band intensity normalization x' = (x - $min * (255 / ($max - $min)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, the position is also not 100% correct but I guess this is the error we talked about and which can't be fixed. |
||
// band intensity normalization x' = (x - $min) / ($max - $min) * 255 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Explain why this is needed. |
||
return $vipsImage->subtract($min)->multiply(255 / ($max - $min)); | ||
} | ||
} |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"/assets/scripts/main.js": "/assets/scripts/main.js?id=96753d36cf46d8eacaa6796d9ee4f4a9", | ||
"/assets/scripts/volumes.js": "/assets/scripts/volumes.js?id=571511be8d04bfaea0258ae4ca1a8555", | ||
"/assets/styles/main.css": "/assets/styles/main.css?id=bf09d95dc04208c3ee738dafbf8e123c" | ||
"/assets/scripts/main.js": "/assets/scripts/main.js?id=5d75e90309015b8aad9b612f52a6979f", | ||
"/assets/scripts/volumes.js": "/assets/scripts/volumes.js?id=e3f2145a883f32b9f12c33a39538a345", | ||
"/assets/styles/main.css": "/assets/styles/main.css?id=b692ef8518741236ded072068dddeb05" | ||
} |
mzur marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
<script> | ||
import geoApi from '../api/geoOverlays'; | ||
import {LoaderMixin} from '../import'; | ||
|
||
export default { | ||
data() { | ||
|
@@ -9,9 +8,6 @@ export default { | |
success: false, | ||
}; | ||
}, | ||
mixins: [ | ||
LoaderMixin, | ||
], | ||
props: { | ||
volumeId: { | ||
type: Number, | ||
|
@@ -46,7 +42,7 @@ export default { | |
data.append('volumeId', this.volumeId); | ||
geoApi.saveWebMap({id: this.volumeId}, data) | ||
.then(this.handleSuccess, this.handleError) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I currently get a 500 server error if the WMS URL is invalid.
|
||
.finally(this.$emit('upload', false)) | ||
.finally(() => this.$emit('upload', false)) | ||
}, | ||
}, | ||
}; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
export let VolumeFilters = biigle.$require('volumes.stores.filters'); | ||
export let LoaderMixin = biigle.$require('core.mixins.loader'); | ||
export let FilterList = biigle.$require('volumes.components.filterListComponent'); | ||
export let EditorMixin = biigle.$require('core.mixins.editor'); | ||
export let handleErrorResponse = biigle.$require('messages').handleErrorResponse; | ||
export let FilterList = biigle.$require('volumes.components.filterListComponent'); | ||
export let handleErrorResponse = biigle.$require('messages').handleErrorResponse; | ||
export let LoaderMixin = biigle.$require('core.mixins.loader'); | ||
export let Tab = biigle.$require('uiv.tab'); | ||
export let Tabs = biigle.$require('uiv.tabs'); | ||
export let VolumeFilters = biigle.$require('volumes.stores.filters'); |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -13,8 +13,17 @@ | |||||
</p> | ||||||
<h3>GeoTIFF</h3> | ||||||
<p> | ||||||
The first option to upload an overlay is to provide a geoTIFF-file (in .tif format). The upload allows only GeoTIFF's that have projected coordinate reference systems (CRS) and use the common <a href="https://epsg.org/home.html" target="_blank">EPSG Geodetic Parameter Dataset</a> codes (e.g. EPSG:4326 for WGS84 CRS). It does, however, not support user-defined projected CRS. | ||||||
The first option to upload an overlay is to provide a geoTIFF-file (in .tif(f) format). The upload allows only GeoTIFF's that have projected coordinate reference systems (CRS) and use the common <a href="https://epsg.org/home.html" target="_blank">EPSG Geodetic Parameter Dataset</a> codes (e.g. EPSG:4326 for WGS84 CRS). It does, however, not support user-defined projected CRS. <br> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
Note: When uploaded, the geoTIFF will be tiled into JPGEG files for web-opimization. Therefore, some information that is contained in the original .tiff will be lost. You should take one of the precautionary steps below to ensure the uploaded .tiff is displayed as expected in BIIGLE: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
</p> | ||||||
<ol> | ||||||
<li> | ||||||
Make sure that the color-band of the geoTIFF is normalized to the range of 0 to 255. | ||||||
</li> | ||||||
<li> | ||||||
If the color-band differs (e.g. negative range), the normalization can also be handled by BIIGLE if the NoData values of the geoTIFF are set to -99999. | ||||||
</li> | ||||||
</ol> | ||||||
<h3>Web Map Service (WMS)</h3> | ||||||
<p> | ||||||
The second option to embed an overlay is by providing the URL to a WMS source. If only the base URL of the WMS is provided (e.g. <code>https://maps.org/geoserver/namespace/wms</code>), the first layer of the WMS will be chosen as the overlay. By providing a URL with query parameters (e.g. <code>https://maps.org/geoserver/namespace/wms?service=WMS&version=1.1.0&request=GetMap&layers=LAYER1,LAYER5</code>), it is also possible to specify WHICH layer(s) of the WMS shall be used. The uploaded overlay will contain ALL the layers specified in the layers-parameter of the URL. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
mzur marked this conversation as resolved.
Show resolved
Hide resolved
mzur marked this conversation as resolved.
Show resolved
Hide resolved
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These tests are quite slow because they process actual files. Maybe this can also be mocked (e.g. implement a method "read exif" that returns static data in the test without opening an actual file)? |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This produces undesired console output from processing actual files. Maybe this can be mocked? |
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.
Maybe elaborate here why this step is required (explain the "why" not the "what").