-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Fixes #4025] Regression with uploading a shapefile with no ascii characters #4026
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4026 +/- ##
==========================================
- Coverage 54.19% 54.17% -0.02%
==========================================
Files 235 235
Lines 15186 15224 +38
Branches 2263 2270 +7
==========================================
+ Hits 8230 8248 +18
- Misses 6224 6241 +17
- Partials 732 735 +3 |
Hi @afabiani thanks for helping with this. I believe this is happening because the no ASCII character are replaced with an "_"? |
I'll try, but I'm afraid this is caused by the GeoServer Importer. In the meantime, can you try to switch to geoserver.rest UPLOADER and test it again? I'll do tests also on my side as soon as possible. |
You are correct, it is caused by the importer (I have tested it without using GeoNode). I tried to use the REST for providing you better information, and it is also broken, got this error:
|
@capooti I've just committed on this PR (branch ISSUE_4025) few updates which should solve the issue, at least when using the REST importer. GeoServer Importer requires changes on GeoServer side, unfortunately. Please give it a try when you can. |
009a3bb
to
fbe526c
Compare
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.
thanks @afabiani
I tested this with the REST importer, and the shapefile is correctly uploaded to GeoServer.
I see a few anomalies in GeoNode, though:
- layer attributes seem missing
- when I identify a feature there are only fields which have ascii characters, the other fields are discarded
It is anyway an improvement :)
@capooti roger; going to take a look Not sure I can do something for "identify feature". This is a request which goes directly to GeoServer. I will try to understand what's going on with attributes, though. |
yes I agree with you @afabiani |
@capooti I did more tests on this and I have found that the problem is in the following method https://github.com/GeoNode/geonode/blob/master/geonode/utils.py#L1011 basically the encoding fails but the exception is hidden and no renaming is done. However, trying to expose the exception, I cannot currently find a way to decode the field names. At least none of the charsets available on the upload form actually works with the sample files you provided. Any hint on this? |
I haven't time to look into this in the next two days, but thanks for having a look at it for now! |
@capooti with this last commit I was finally able to correctly convert the shapefile columns before ingesting it, accordingly to the specified CHARSET. In particular with your shapefiles I was successful with "Windows CP1258" |
184909e
to
2af5eaf
Compare
@capooti by the way, it works with GeoServer Importer too now. |
@afabiani with both rest and importer I am getting this error:
do I need to change any settings? thanks |
@capooti you must select the correct charset from the upload form In your case Windows CP 1259 |
@capooti try live instance here |
I didn't realize I need to select the charset. By doing that is working indeed! thanks @afabiani |
…cii characters (GeoNode#4026) * [Fixes GeoNode#4025] Regression with uploading a shapefile with no ascii characters * [Fixes GeoNode#4025] Regression with uploading a shapefile with no ascii characters * - Rename columns of non-UTF-8 shapefiles attributes before ingesting - Fix test cases
No description provided.