-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add ASCII file to geonode. #232
Add ASCII file to geonode. #232
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.
LGTM.
Maybe we should merge this commit straight to geonode upstream, no? Because it's not related to QGIS Server
geonode/layers/forms.py
Outdated
@@ -134,7 +134,8 @@ def clean(self): | |||
if cleaned["xml_file"] is not None: | |||
xml_file = cleaned["xml_file"].name | |||
|
|||
if not cleaned["metadata_upload_form"] and base_ext.lower() not in (".shp", ".tif", ".tiff", ".geotif", ".geotiff"): | |||
if not cleaned["metadata_upload_form"] and base_ext.lower() not in ( | |||
".shp", ".tif", ".tiff", ".geotif", ".geotiff", ".asc"): | |||
raise forms.ValidationError( | |||
"Only Shapefiles and GeoTiffs are supported. You uploaded a %s file" % |
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.
You need ASC here too
@Gustry I also have the same thought actually. May be after I finished the download ascii file, I will make a PR to upstream. |
Codecov Report
@@ Coverage Diff @@
## master-qgis_server #232 +/- ##
======================================================
- Coverage 44.28% 44.23% -0.05%
======================================================
Files 254 254
Lines 18292 18323 +31
Branches 2409 2414 +5
======================================================
+ Hits 8100 8106 +6
- Misses 9719 9742 +23
- Partials 473 475 +2
Continue to review full report at Codecov.
|
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.
LGTM
We might also need to create proper link in Geoserver and QGIS Server to make it a downloadable.
nice work. yes it does need to be downloadable too |
687d6aa
to
35ec41e
Compare
The links are added now. I do not provide ASCII link for GeoTIFF and vice versa. I think I will make a PR to geonode upstream first. |
I made a PR to geonode GeoNode#3105 Since we made a big change in qgis_server app, I only submitted the geoserver one. |
geonode/qgis_server/views.py
Outdated
except ObjectDoesNotExist: | ||
msg = 'No QGIS Server Layer for existing layer %s' % layername | ||
logger.debug(msg) | ||
return Http404(msg) |
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 we use 'get_object_or404' ?
I just noticed your GIF. (IMHO, the user clicked on "download", so I expect a file) |
Also, I noticed the QGIS plugin supports only Does your code change the extension if it's 'aSc' ? |
@Gustry |
79020c2
to
c72ebdc
Compare
If you want to make it downloadable, you need to set the BUT, I'm just thinking that it's a not a so good idea to make downloadable an ASC file as we are losing the PRJ file. An ASC file without projection is bad. Maybe we should provide a ZIP file, like we are already doing for shapefile. IMHO, I would not like to have an ASC file, without the projection downloaded automatically. It's like missing an important part of the dataset. @gubuntu any thought about this? Is-it an issue? |
Yes I think a zip file incl prj is good and necessary. What about including the metadata xml in the zip as well (for all downloads)? |
No. It only handles asc. Should we handle other cases also? I think ASC is fine, but the other combination seems strange.
Yeah, I agree on the missing projection file. The tiff is also missing the prj file. Actually, we have already had I think I will expose the cc @gubuntu |
Sorry Ismail, I didn't understand. I'm not sure the plugin will work if we upload a .ASC. (just in case) The ZIP link will take care of whatever the format is (geotiff, asc, ...) so I think it's fine. Let's use only view. No ? |
I mean, the layer upload page, can handle different font case, e.g. Should we just make the extestion lower case, and you don't need to change anything in the otf code?
Yes. The zip can handle any format. Ok, I will keep the asc donwload link like now. |
c72ebdc
to
587c0e8
Compare
Enable ASCII file upload and create link for ASCII file.
Partial fix for #159
Current state:
This PR will make geonode able to upload asc file. We need to enable it first before we can download the asc file.