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

Implement geo upload #47

Open
wants to merge 242 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
242 commits
Select commit Hold shift + click to select a range
c0aa459
include basic volumesEditRight mixin in geo
mtiessen1175 Nov 22, 2023
a71b958
add basic geoOverlay model and controller
mtiessen1175 Nov 22, 2023
0746ebe
Use old geo-overlay structure
mtiessen1175 Nov 23, 2023
444cbd1
fill geoOverlay model with functions
mtiessen1175 Nov 23, 2023
d676299
configure storage-disk for geo-overlays
mtiessen1175 Nov 23, 2023
d4bcc71
fix uiv Tab(s) import
mtiessen1175 Nov 23, 2023
a073726
rename geoOverlay to GeoOverlay
mtiessen1175 Nov 29, 2023
34c92bf
Add routes and controller structure for volume-geo-overlay
mtiessen1175 Nov 29, 2023
2b4ebcd
added some missing imports
mtiessen1175 Nov 29, 2023
947f673
add simple tabs for file upload
mtiessen1175 Nov 29, 2023
2638389
Merge branch 'browsing_vis' into geo_edit
mtiessen1175 Nov 29, 2023
95706ba
commit production ready files
mtiessen1175 Nov 29, 2023
d686aa2
create new geoTIFF component
mtiessen1175 Nov 30, 2023
ee70bfa
include production files
mtiessen1175 Nov 30, 2023
6a73c5e
edit text and names of overlay upload-tabs
mtiessen1175 Nov 30, 2023
fb78c78
Modified upload function.
mtiessen1175 Dec 4, 2023
89af5cf
Include geotiff.js for testing
mtiessen1175 Dec 4, 2023
df0ad5c
added transform-coordinates package to transform any CRS to WGS 84 fo…
mtiessen1175 Dec 4, 2023
0e772f3
Merge branch 'browsing_vis' into geo_upload
mtiessen1175 Dec 5, 2023
5761319
add production files
mtiessen1175 Dec 5, 2023
eb718c8
remove JS geotiff packages and code
mtiessen1175 Dec 11, 2023
dda9101
pass "raw" geotiff-data to backend
mtiessen1175 Dec 12, 2023
9df6bec
Add existing code for geo-overlay retrieval and deletion + test
mtiessen1175 Dec 12, 2023
351c681
delete the removal of geo-overlays-table
mtiessen1175 Dec 12, 2023
fdc0e79
add test for VolumeGeoOverlayController
mtiessen1175 Dec 12, 2023
7004442
Linting and fixing files
mtiessen1175 Dec 12, 2023
c2d9cfd
Test native php exif function
mtiessen1175 Dec 13, 2023
38f1aaf
test native php function for identifying geotiff-tagnames
mtiessen1175 Dec 14, 2023
52823b0
include php exif dependency
mtiessen1175 Dec 14, 2023
f777192
add php-exif code to controller
mtiessen1175 Dec 14, 2023
f077427
change php-exif dependency
mtiessen1175 Dec 18, 2023
6a6276b
remove custom-adapter code
mtiessen1175 Dec 18, 2023
55ef050
add error/success handlers to geoOverlay
mtiessen1175 Dec 18, 2023
6c52399
add validation rule to geoOverlayController
mtiessen1175 Dec 18, 2023
93b8902
Add logic for detecting the PCS (not finished)
mtiessen1175 Dec 19, 2023
127756b
Add coordinate raster- to model-space transformation (via pixelScale …
mtiessen1175 Dec 20, 2023
48b9440
add exception-handler for pixelScale logic
mtiessen1175 Dec 21, 2023
c7a260f
add code to transform model-space coordinates to WGS84
mtiessen1175 Dec 21, 2023
7b9aeab
add production files
mtiessen1175 Dec 21, 2023
50d18d5
fix code and add switch-case for projection-code handling
mtiessen1175 Dec 22, 2023
5986053
add code for user-defined CRS case in geotiff files
mtiessen1175 Dec 22, 2023
6f2dd3f
Add user-defined variables for the different cases
mtiessen1175 Dec 29, 2023
6f548fd
add variables to function header
mtiessen1175 Jan 4, 2024
c18e2a4
Add user-defined case 3
mtiessen1175 Jan 4, 2024
0df5bb9
Add validation exception for missing geoKey in user-defined case
mtiessen1175 Jan 5, 2024
0071506
add new error to list of errors and rename a geokey-variable
mtiessen1175 Jan 5, 2024
c874fbf
add route to delete geo-overlay
mtiessen1175 Jan 8, 2024
b2b75af
Change function documentation and add output for debugging
mtiessen1175 Jan 8, 2024
8f1f048
add production files
mtiessen1175 Jan 8, 2024
632905e
remove debugging output
mtiessen1175 Jan 8, 2024
14da1d4
include file variable in geotiff save function
mtiessen1175 Jan 9, 2024
00a4b54
Add function for tiling GeoOverlays upon upload (not finished)
mtiessen1175 Jan 9, 2024
9339404
add missing variable to function-call
mtiessen1175 Jan 9, 2024
d455679
small changes on code comments
mtiessen1175 Jan 9, 2024
23984da
change user-defined logic in ProjectedCSType geokey
mtiessen1175 Jan 9, 2024
ea24a0c
Drop user-defined PCS handling entirely and only allow upload when Pr…
mtiessen1175 Jan 10, 2024
33f97a2
Add two validationError cases (transform error, missing ProjectedCSTy…
mtiessen1175 Jan 12, 2024
6af3262
Added check for duplicate file upload
mtiessen1175 Jan 12, 2024
102ad90
Add css to prevent long file-names from overflowing
mtiessen1175 Jan 12, 2024
f701f84
cosmetic changes to some files
mtiessen1175 Jan 12, 2024
25c79a7
add production files
mtiessen1175 Jan 12, 2024
acfe531
Merge branch 'master' into geo_upload
mtiessen1175 Jan 12, 2024
1de793d
add production files
mtiessen1175 Jan 12, 2024
af0ddb3
Adapt tileSingleImage code for geoOverlays
mtiessen1175 Jan 16, 2024
2f884a4
add call to TileSingleOverlay handle() function
mtiessen1175 Jan 17, 2024
4d0f1ec
add upload size-constraint for geotiffs
mtiessen1175 Jan 17, 2024
fadf9e7
add script to publish config file of geo-module
mtiessen1175 Jan 17, 2024
7f327f3
try to retrieve tiff-file from geo-overlays storage and cast to gener…
mtiessen1175 Jan 17, 2024
98fd3bb
add artisan command geo:config to GeoServiceProvider.php
mtiessen1175 Jan 17, 2024
936a320
adapt handle() function (not working yet)
mtiessen1175 Jan 17, 2024
1cc7794
fix tempPath and comment out code for testing uploadStorage function
mtiessen1175 Jan 18, 2024
447ec05
call TileSingleOverlay with dispatch event
mtiessen1175 Jan 19, 2024
83c8eb8
add missing public variable
mtiessen1175 Jan 19, 2024
1005b17
add proj4php package dependency to geo-module
mtiessen1175 Jan 19, 2024
5eaf4e4
add GeoOverlayController test
mtiessen1175 Jan 19, 2024
edddd13
add route for showing geotiff
mtiessen1175 Jan 19, 2024
30984f6
temporarily comment testcase
mtiessen1175 Jan 19, 2024
31359c9
add test .tif files and write tests for VolumeGeoOverlayController
mtiessen1175 Jan 19, 2024
ca6e1a6
add authorize method and move validation logic to new form request file
mtiessen1175 Jan 22, 2024
410059d
rename and add some errors
mtiessen1175 Jan 22, 2024
bed71f9
add a bunch of new tests for VolumeGeoOverlayController
mtiessen1175 Jan 22, 2024
d70e241
comment out debug-console prints
mtiessen1175 Jan 22, 2024
65cd08c
restrict the nr. of decimal places in geotiff lat/long values
mtiessen1175 Jan 22, 2024
644e904
include tests with provided example geotiffs
mtiessen1175 Jan 22, 2024
0c921d5
include production files
mtiessen1175 Jan 22, 2024
103c79c
include temporary storage path for geo-overlays (therefore changed ex…
mtiessen1175 Jan 24, 2024
da07e1b
create test for TileSingleOverlay
mtiessen1175 Jan 24, 2024
5688e65
create new Test in TileSingleOverlayTest
mtiessen1175 Jan 24, 2024
4658616
fix tempPath variable in TileSingleOverlay
mtiessen1175 Jan 26, 2024
5fad5c2
add test for upload mechanism of TileSingleOverlay
mtiessen1175 Jan 26, 2024
384dfb3
Made TileSingleOverlay an extension of class TileSingleImage
mtiessen1175 Jan 26, 2024
08e60fb
small correction of fragment-variable in test
mtiessen1175 Jan 29, 2024
8725832
Created new GeoManager class to process geotiff metadata
mtiessen1175 Jan 29, 2024
26b28f4
small fix on type-casting a variable
mtiessen1175 Jan 29, 2024
13e1912
fix variable
mtiessen1175 Jan 30, 2024
2104455
add merge statement for geo-config file
mtiessen1175 Jan 30, 2024
9c1dac6
change path for storing geotiff original and tiled files.
mtiessen1175 Jan 30, 2024
39e9e3b
use camelCase for some variables to stick with convention
mtiessen1175 Jan 30, 2024
4b66d00
change function documentation of storeGeoTiff
mtiessen1175 Jan 30, 2024
ebdae3e
deleted unwanted files from public scripts directory.
mtiessen1175 Jan 31, 2024
fb302d6
fix file deletion when geo-overlay has been removed
mtiessen1175 Jan 31, 2024
561f9e6
change testcase to check for directory instead of file
mtiessen1175 Jan 31, 2024
714514d
add previously deleted main.js files
mtiessen1175 Jan 31, 2024
c7cb2b0
Change exception handler in GeoOverlayController and add a correspond…
mtiessen1175 Feb 1, 2024
5f5b729
Adapt the TileSingleOverlay class-constructor and tests
mtiessen1175 Feb 1, 2024
d345083
add basic table-layout for uploaded overlays to geoOverlay tab
mtiessen1175 Jul 18, 2024
5e8f57c
create overlayItem component for table rows and adjust style of layer…
mtiessen1175 Jul 19, 2024
8bf6c4e
add vuedraggable dependency
mtiessen1175 Jul 19, 2024
23eab2d
created new table component and added draggable functions to sort tab…
mtiessen1175 Jul 19, 2024
86e86ed
add production files
mtiessen1175 Jul 19, 2024
7a4820b
add browsing and context-layer variables to geo_overlays table
mtiessen1175 Jul 22, 2024
f4039ac
Added update method for geoTIFF-overlay. Changes of browsing/context …
mtiessen1175 Jul 22, 2024
9d916d5
Add test for update controller-method
mtiessen1175 Jul 22, 2024
1591460
update production files
mtiessen1175 Jul 22, 2024
5497cbc
Fix test-method in GeoOverlayTest
mtiessen1175 Jul 22, 2024
e99e9d7
modified the index-method in VolumeGeoOverlayController + test to que…
mtiessen1175 Jul 23, 2024
2441478
removed comments
mtiessen1175 Jul 23, 2024
22188bd
Add API-call to fetch browsing_layers. Added new grid layout on geoMa…
mtiessen1175 Jul 23, 2024
159dc83
Added mechanism to add overlays as layers to ol-map. Moved overlay-va…
mtiessen1175 Jul 24, 2024
af534ab
add production files
mtiessen1175 Jul 24, 2024
231ee92
Add attr column to geo_overlays table
mtiessen1175 Jul 25, 2024
0eeb3e1
Fixed small bug in transformModelSpace method. Added width and height…
mtiessen1175 Jul 25, 2024
099f452
Changed ol layer-source from static to tile-layer in overlays. Change…
mtiessen1175 Jul 25, 2024
51a8240
added production files
mtiessen1175 Jul 25, 2024
5caedea
Created new route to get a template-url for the geo-overlay tile-dire…
mtiessen1175 Jul 26, 2024
cf5ef8f
Fix the ZoomifySource url with new template-url pointing at overlay-t…
mtiessen1175 Jul 26, 2024
8158697
Hide overlay upload table when no overlays present
mtiessen1175 Jul 26, 2024
40df7da
add production files
mtiessen1175 Jul 26, 2024
84fa33e
added an id to each overlay-tile name
mtiessen1175 Jul 29, 2024
97922b0
add css and functions to stop overlay-table from overflow outside par…
mtiessen1175 Jul 29, 2024
caf589c
added watcher to overlay-table that updates the currently displayed o…
mtiessen1175 Jul 29, 2024
d85eb38
removed unnecessary css code
mtiessen1175 Jul 29, 2024
7c7ad9c
Added localStorage variable to save the ordering of overlays in the o…
mtiessen1175 Jul 29, 2024
2e3c89d
changed table-grid css to not cut off table at page bottom
mtiessen1175 Jul 29, 2024
0059a1b
remove debugging-code
mtiessen1175 Jul 29, 2024
777c053
handle browsingOverlays in map-modal (show in correct order when spe…
mtiessen1175 Jul 29, 2024
4a886ea
add production files
mtiessen1175 Jul 29, 2024
b54b44c
make small adjustment to adding (ordered) layers to ol-map
mtiessen1175 Jul 29, 2024
1c00d56
Added blueprint Migration-, Model-, Controller-files for WebMapOverlays
mtiessen1175 Jul 30, 2024
6c9b3fe
Created the web_map_overlays table structure and added basic implemen…
mtiessen1175 Jul 30, 2024
7b39c2c
Add basic web-map-service upload structure to volumeEdit view
mtiessen1175 Jul 30, 2024
d013f98
add layer-column to web_map_overlays table
mtiessen1175 Jul 31, 2024
ef4afd7
Restructured the geo-overlay upload panel to prepare for second table…
mtiessen1175 Jul 31, 2024
6e00ef4
Added the form-submit functionality and filled the webmap-controller …
mtiessen1175 Jul 31, 2024
96d4dbc
Adapt webmap overlay table (account for multiple layers, remove name …
mtiessen1175 Aug 1, 2024
05e87b4
Finished the webmap store method and added tests
mtiessen1175 Aug 1, 2024
1bdf0a2
Adapted the webmap upload view and container (removed input 'name')
mtiessen1175 Aug 1, 2024
ffdfc99
simplified the layer-type update method for overlays
mtiessen1175 Aug 2, 2024
3624eeb
hide help-block for wms url upload
mtiessen1175 Aug 2, 2024
8c843ca
rename component geotiffOverlayTable -> overlayTable
mtiessen1175 Aug 2, 2024
92af2d8
added webmapoverlays to Container. Renamed overlays variable, adapted…
mtiessen1175 Aug 2, 2024
0ded10b
Fixed unique url validation error (needed another check on the stripp…
mtiessen1175 Aug 2, 2024
5145edd
Change formRequest name from UpdateGeotiffOverlay -> UpdateOverlay
mtiessen1175 Aug 3, 2024
5fdecee
Added update method to WebMapOverlay
mtiessen1175 Aug 3, 2024
add1927
Generalized the overlay table, update and remove methods to be usable…
mtiessen1175 Aug 3, 2024
0a28356
add production files
mtiessen1175 Aug 3, 2024
a36873c
css highlight table row while dragging to make the action more visible.
mtiessen1175 Aug 5, 2024
eefcce4
Append overlay 'type' variable in the overlay-models and methods.
mtiessen1175 Aug 5, 2024
c4a23fd
Simplify the geo-upload methods to use overlay.type variable to disti…
mtiessen1175 Aug 5, 2024
91313ab
Included missing method trigger in webmap-overlay-form.
mtiessen1175 Aug 5, 2024
5c2089a
Added view of both overlay-tables when Geo-overlay-upload panel is cl…
mtiessen1175 Aug 5, 2024
deefdc5
small change on truncateString method
mtiessen1175 Aug 5, 2024
11bb80a
Added tests for update and destroy of webmap-overlays + adapted the u…
mtiessen1175 Aug 5, 2024
70c79ab
added production files
mtiessen1175 Aug 5, 2024
6ce459f
Generalize the geoMapModal to work with both types of overlays. Add w…
mtiessen1175 Aug 5, 2024
b2c3196
added production files
mtiessen1175 Aug 5, 2024
fdcbeae
Open geoMapModal initially with overlays in active-selection state.
mtiessen1175 Aug 5, 2024
aacf41c
Add Geotiff table header
mtiessen1175 Aug 5, 2024
ff3a658
Add sidebar-style layer display to map modal (hiding extra informatio…
mtiessen1175 Aug 8, 2024
6b98f40
Restructure the store method in WebMap Controller, making own class o…
mtiessen1175 Aug 8, 2024
3d0782d
add production files
mtiessen1175 Aug 8, 2024
8e54bc7
add title to table items (showing full name)
mtiessen1175 Aug 9, 2024
b69e73f
Fixed bug (provide geotiffOverlayUrl before it is used in createOverl…
mtiessen1175 Aug 9, 2024
a821f79
add production files
mtiessen1175 Aug 9, 2024
4df78e9
Change GeoManager code to account for ModelTransformationTag case sa …
mtiessen1175 Aug 20, 2024
cafb808
Added geotiff test-file using ModelTransform-Tag
mtiessen1175 Aug 21, 2024
bb6b2c6
Added another geotiff test and test-file (for testing missing transfo…
mtiessen1175 Aug 21, 2024
a8a92d0
fix bug (prevent overwriting of sorted-webmapOverlays array by defaul…
mtiessen1175 Aug 21, 2024
51b42e1
Made created()-hook asynchronous (which allows to wait for api-call t…
mtiessen1175 Aug 21, 2024
68c4dc9
add production files
mtiessen1175 Aug 21, 2024
df7350c
Bugfix (overlay-type needs to be hardcoded to account for case when a…
mtiessen1175 Aug 23, 2024
2fab705
Fix issue of rendering imageMap (child) before data was fetched in ge…
mtiessen1175 Aug 23, 2024
250a316
Add webmap-layers in reverse order so layers are stacked according to…
mtiessen1175 Aug 23, 2024
2923e88
Added variable to v-if clause of image-map to prevent errors. Simplif…
mtiessen1175 Aug 23, 2024
59e0ee7
add production files
mtiessen1175 Aug 23, 2024
5de268c
Added a manual description for the geo overlays panel.
mtiessen1175 Aug 27, 2024
fe0e159
Merged several geo_overlays migration files into one. Created additio…
mtiessen1175 Aug 27, 2024
cf49142
adapt GeoOverlay Model to account for new columns.
mtiessen1175 Aug 27, 2024
1559b18
Changed Controller methods and routes such that geoOverlay specific m…
mtiessen1175 Aug 27, 2024
bd69687
Adapted geoOverlay specific Api-calls in Frontend
mtiessen1175 Aug 27, 2024
7d67cb6
Further adapted GeoOverlay Model to account for new columns. Changed …
mtiessen1175 Aug 28, 2024
f31d13f
Adapted WebMapOverlayController methods.
mtiessen1175 Aug 28, 2024
493f72f
Adapted VolumeGeoOverlayController methods.
mtiessen1175 Aug 28, 2024
b5d46a6
Moved tests to correct testfiles and changed them to use the correct …
mtiessen1175 Aug 28, 2024
eb44da7
Renamed VolumeGeoOverlayController & Test
mtiessen1175 Aug 28, 2024
d7f003f
Add .tiff to supported types in geoTiff-form
mtiessen1175 Aug 28, 2024
6a80981
Fixed API route
mtiessen1175 Aug 28, 2024
44ce5eb
Merged the (formerly) two tables into one unified geoOverlay-table. L…
mtiessen1175 Aug 28, 2024
c7b1a34
fixed column type in datatable
mtiessen1175 Aug 28, 2024
214925c
Adapted code in geo-selection filter to work with merged geoOverlays.
mtiessen1175 Aug 28, 2024
417c716
add production files
mtiessen1175 Aug 28, 2024
e076b16
Added mutator to geoOverlays model
mtiessen1175 Aug 28, 2024
81b5982
Change geoOverlays to be shown in correct order on geoMapModal.
mtiessen1175 Aug 29, 2024
df1ee15
Added functionality to enable/disable overlays on geoMapModal.
mtiessen1175 Aug 30, 2024
33ab77a
added production files
mtiessen1175 Aug 30, 2024
c0c7414
Remove WMS-layer queryable check, as it seems not to be standardized …
mtiessen1175 Sep 11, 2024
40bafbe
Revert "delete the removal of geo-overlays-table"
mtiessen1175 Sep 11, 2024
52e7c69
duplicated the create_geo_overlays_table and merged the later changes…
mtiessen1175 Sep 11, 2024
1a7e774
Changed migration file name to fix "name is already in use" error
mtiessen1175 Sep 13, 2024
7481bfc
added annotations.js to public scripts
mtiessen1175 Sep 13, 2024
2fc5850
Revert "added annotations.js to public scripts"
mtiessen1175 Sep 13, 2024
ab7bc5e
Attempt to fix the GeoTIFF overlay display
mzur Sep 19, 2024
2ac3612
Adapted TileSingleOverlay to use the abstract TileSingleObject class.…
mtiessen1175 Sep 20, 2024
8b96214
Change toggle buttons from radio- to power-buttons (UI consistency)
mtiessen1175 Sep 20, 2024
beda6c2
Removed inline styles and pass overlayUrlTemplate variable as static …
mtiessen1175 Sep 23, 2024
98c3780
add production files.
mtiessen1175 Sep 23, 2024
b716637
Apply suggestions from code review
mtiessen1175 Sep 23, 2024
1a96bea
Save geoTIFF coordinates as float. Changed tests to use assertSame in…
mtiessen1175 Sep 23, 2024
47962e6
Merge branch 'master' into geo_upload
mtiessen1175 Sep 23, 2024
8aa75e4
added production files after updating npm packages
mtiessen1175 Sep 23, 2024
9d23357
Simplified tables and changed upload loading state to be handled in p…
mtiessen1175 Sep 23, 2024
0f7d1bb
Added MIME-type to geotiff when original file is saved.
mtiessen1175 Sep 23, 2024
f96aa3e
Rewrite the overlayUrlTemplate data resource.
mtiessen1175 Sep 24, 2024
bd8b47d
Remove API method/route and load overlayUrlTemplate as static data in…
mtiessen1175 Sep 25, 2024
9781856
Change projection of ZoomifySource to EPSG:4326 (shows up on map).
mtiessen1175 Oct 1, 2024
ac181bf
Tried to add custom tileGrid for tile-projection (not solving issue o…
mtiessen1175 Oct 3, 2024
a641fcf
Added working coordin
mtiessen1175 Oct 4, 2024
66f67e6
add vips functions for testing colour-space conversion
mtiessen1175 Oct 7, 2024
644d70d
Added color-band normalization for geoTIFF's
mtiessen1175 Oct 12, 2024
0c4efb7
Fixed image selection description.
mtiessen1175 Oct 15, 2024
952cd78
fix $emit and remove unnecessary mixin.
mtiessen1175 Oct 23, 2024
99181d2
Fix table appearance.
mtiessen1175 Oct 23, 2024
ddf61fe
remove unnecessary success-messages and api route.
mtiessen1175 Oct 23, 2024
b7a13ea
Fix not existing "loading" variable
mtiessen1175 Oct 27, 2024
6bd7301
re-write normalization formula
mtiessen1175 Oct 28, 2024
b1b0de9
Commented color-band-normalization for testing
mtiessen1175 Nov 4, 2024
296f2a9
reapply color-band normalization
mtiessen1175 Nov 4, 2024
bd3ee4e
Exclude NoData values from geoTIFF's for calculating correct min
mtiessen1175 Nov 12, 2024
23c2ae1
Improve color-normalization by using vips_linear() instead of concate…
mtiessen1175 Nov 12, 2024
7a48b90
Fixed "this.map is undefined" error on sidebar-toggle
mtiessen1175 Nov 12, 2024
8693f2d
Remove unnecessary variable
mtiessen1175 Nov 12, 2024
19d2251
Add color-band normalization note to user-manual.
mtiessen1175 Nov 13, 2024
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
4 changes: 4 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,9 @@
"psr-4": {
"Biigle\\Modules\\Geo\\": "src"
}
},
"require": {
"lychee-org/php-exif": "^1.0",
"proj4php/proj4php": "^2.0"
}
}
9,372 changes: 599 additions & 8,773 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"vue-template-compiler": "^2.6.11"
},
"dependencies": {
"@biigle/ol": "^9.2.4"
"@biigle/ol": "^9.2.4",
"vuedraggable": "^2.24.3"
}
}
37 changes: 37 additions & 0 deletions src/Console/Commands/Config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

namespace Biigle\Modules\Geo\Console\Commands;

use Biigle\Modules\Geo\GeoServiceProvider as ServiceProvider;
use Illuminate\Console\Command;

class Config extends Command
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'geo:config';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Publish the config file for this module';

/**
* Execute the command.
*
* @return void
*/
public function handle()
{
$this->call('vendor:publish', [
'--provider' => ServiceProvider::class,
'--tag' => ['config'],
'--force' => true,
]);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddGeoOverlaysTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
/*
| A geo overlay is an image that can be placed on a world map. This can be a
| bathymetric map of the area where a specific volume was recorded. Geo overlays
| can be uploaded by volume admins and are displayed on the volume geo view.
| Each overlay consists of an image and the geospatial information where the
| image should be displayed on the world map. While the input format can vary
| the geospatial information will always be converted to the latitude and
| longitude of the top left and bottom right corners of the image in WGS 84
| (EPSG:4326).
*/
Schema::create('geo_overlays', function (Blueprint $table) {
$table->increments('id');
// A short description of the overlay.
$table->string('name', 512);
$table->integer('volume_id')->unsigned()->index();
$table->foreign('volume_id')
->references('id')
->on('volumes')
->onDelete('cascade');
$table->string('type', 10)->nullable();
$table->boolean('browsing_layer')->default(0);
$table->boolean('context_layer')->default(0);
// the position of the overlay (can be set by the user) in case of mutliple uploaded overlays in the same volume
$table->integer('layer_index')->nullable();
// follwoing attributes are possible in attrs-column:
// if(type == 'geotiff'): 'top_left_lat', 'top_left_lng', 'bottom_right_lat', 'bottom_right_lng', 'width', 'height'
// if(type == 'webmap'): 'url', 'layers'
$table->json('attrs')->default('{}');
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('geo_overlays');
}
}
119 changes: 119 additions & 0 deletions src/GeoOverlay.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<?php

namespace Biigle\Modules\Geo;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\UploadedFile;
use Biigle\Volume;
use Illuminate\Database\Eloquent\Casts\AsArrayObject;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Storage;

class GeoOverlay extends Model
{
/**
* Don't maintain timestamps for this model.
*
* @var bool
*/
public $timestamps = false;

/**
* The attributes hidden in the model's JSON form.
*
* @var array
*/
protected $hidden = [
'volume_id',
];

protected $fillable = [
'browsing_layer',
'context_layer',
'layer_index',
'type',
'attrs->url',
'attrs->layers',
'attrs->top_left_lng',
'attrs->top_left_lat',
'attrs->bottom_right_lng',
'attrs->bottom_right_lat'
];

/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts = [
'attrs' => 'array',
'attrs->layers' => 'array'
];


/**
* Getter for the attrs json column
*/
protected function attrs(): Attribute {

return Attribute::make(
get: function (mixed $value): array {
$value = json_decode($value, true);
$float_array = ['top_left_lng', 'top_left_lat', 'bottom_right_lng', 'bottom_right_lat'];

foreach($value as $entry) {
if (in_array($entry, $float_array)) {
$value[$entry] = floatval($value[$entry]);
}
}

return $value;
});
}

/**
* The "booting" method of the model.
*
* @return void
*/
protected static function boot()
{
parent::boot();

// Delete the overlay image file when the model is deleted.
static::deleting(function ($overlay) {
Storage::disk(config('geo.tiles.overlay_storage_disk'))->deleteDirectory($overlay->id);
});
}

/**
* The volume, this overlay belongs to.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function volume()
{
return $this->belongsTo(Volume::class);
}

/**
* Get the local path to the overlay image file.
*
* @return string
*/
public function getPathAttribute()
{
return "{$this->id}/{$this->id}_original.tif";
}

/**
* Store the uploaded image file of the geo overlay.
*
* @param UploadedFile $file
*/
public function storeFile(UploadedFile $file)
{
Storage::disk(config('geo.tiles.overlay_storage_disk'))
->putFileAs($this->id, $file, "{$this->id}_original.tif");
}
}
15 changes: 14 additions & 1 deletion src/GeoServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,14 @@ public function boot(Modules $modules, Router $router)
'viewMixins' => [
'imagesIndex',
'manualTutorial',
'manualVolumes',
'volumesSidebar',
'volumesScripts',
'projectsShowTabs',
'volumesStyles'
'volumesStyles',
'volumesEditRight',
'volumesEditScripts',
'volumesEditStyles'
],
'apidoc' => [__DIR__.'/Http/Controllers/Api/'],
]);
Expand All @@ -56,10 +60,18 @@ public function boot(Modules $modules, Router $router)
*/
public function register()
{
$this->mergeConfigFrom(__DIR__.'/config/geo.php', 'geo');

$this->app->singleton('command.geo.publish', function ($app) {
return new \Biigle\Modules\Geo\Console\Commands\Publish();
});
$this->commands('command.geo.publish');


$this->app->singleton('command.geo.config', function ($app) {
return new \Biigle\Modules\Geo\Console\Commands\Config();
});
$this->commands('command.geo.config');
}

/**
Expand All @@ -71,6 +83,7 @@ public function provides()
{
return [
'command.geo.publish',
'command.geo.config',
];
}
}
Loading
Loading