-
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
205 add geopackage handling in incore services #224
205 add geopackage handling in incore services #224
Conversation
here are the file for the test |
Tested 5 scenarios locally. Here is the result:
Test results make sense and code changes look good. Approving~ |
server/data-service/src/main/java/edu/illinois/ncsa/incore/service/data/utils/FileUtils.java
Show resolved
Hide resolved
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.
I'm not familiar with uploading geopackage to geoserver. Just curious, why is it different than posting tif or shp? specifically, any reason why it needs to rename the datastore?
also why does the layer name has to match the file name?
Maybe just a quick walk over would be greatly helpful.
...data-service/src/main/java/edu/illinois/ncsa/incore/service/data/utils/GeoserverRestApi.java
Show resolved
Hide resolved
It was because geopakcage is not just a simple file like shp or tiff. Geopakcage contains sqlite data in the file and it becomes the layer name when it gets uploaded to geoserver. We are making the geoserver's layer name as dataset id so the visualization of the map should be chained using this dataset id in frontend or pyincore-viz. However, if it is just database name that might be very genetic, we will not be able to connect the dataset and geoserver layer, unless the dataset entry keeps the geopackage database name, which is not happening currently. Shp and tiff are easily being posted with the dataset id as layer name, but geopcakge is not because the file wraps the geodatabase in it and it decides the layer name. By doing the method in this PR, I was able to create layer name as a dataset id. The previous method was renaming the database name inside it by duplicating it which could take very long if the data is big, but using the way of this PR, it doesn't require any additional time. |
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.
Code looks good. Approve.
This PR has the followings
Here's how to test
Scenario 1 (should make an error) - upload shapefile to geopackage dataset
{"format": "geopackage", "title": "test-delete", "description": "delete me", "dataType": "incore:addressPoints"}
Scenario 2 (should make an error) - upload geopackage file to shapefile dataset
{"format": "shapefile", "title": "test-delete", "description": "delete me", "dataType": "incore:addressPoints"}
Scenario 3 (should make an error) - upload geopakcage file that has no guid field
{"format": "geopackage", "title": "test-delete", "description": "delete me", "dataType": "incore:addressPoints"}
Scenario 4 (should make an error) - upload geopackage file that has multiple layers in a single file
Scenario 5 (working scenario) - upload geopackage file with guid and single layer