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

Saga in QGIS Processing do not support "no ascii filename" in certain algs #22279

Closed
qgib opened this issue Feb 12, 2016 · 8 comments
Closed
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms

Comments

@qgib
Copy link
Contributor

qgib commented Feb 12, 2016

Author Name: Jean Hemmi (@jhemmi)
Original Redmine Issue: 14286
Affected QGIS version: 2.12.2
Redmine category:processing/saga
Assignee: Victor Olaya


From a QGIS plugin, I call through Processing different Saga algs : "clipgridwithpolygon", "contourlinesfromgrid"

The alg "clipgridwithpolygon" accept unicode filename with non ascii char.
The alg contourlinesfromgrid does not.
The code runs fine with "non ascii filename" but when a non ascci appears:

STACK TRACE

"C:/Users/xx/.qgis2/python/plugins\\PhysiocapAnalyseur\\Physiocap_intra_interpolation.py", line 273, in physiocap_creer_raster_iso
​      
File "C:/Users/xx/.qgis2/python/plugins\\processing\\tools\\general.py", line 71, in runalg
alg = Processing.runAlgorithm(algOrName, None, *args, **kwargs)
File "C:/Users/xx/.qgis2/python/plugins\\processing\\core\\Processing.py", line 337, in runAlgorithm
print 'Unable to execute algorithm\
' + msg
UnicodeEncodeError: 'ascii' codec can't encode character u'\\xe9' in position 90: ordinal not in range(128)

The portion of code

from __future__ import unicode_literals
import procesing
....
raster_dans_poly = processing.runalg("saga:clipgridwithpolygon",
                nom_raster_temp,
                nom_vignette,
                nom_raster)

nom_raster = raster_dans_poly[ 'OUTPUT']​
​iso_dans_poly_brut = processing.runalg("saga:contourlinesfromgrid",
                    nom_raster,
                    isoMin, isoMax, isoInterlignes,
                    None)​  # here is line 273 but nom_raster is the problem


My Question : is this a limitation on the SAGA side or in Processing ?
Is it possible to raise Processing or SAGA exception ?

Problem experienced on Win8 64 Bits Qgis 2.12.3 Processing 2.12.2 Saga 2.1.2


@qgib
Copy link
Contributor Author

qgib commented Feb 12, 2016

Author Name: Giovanni Manghi (@gioman)


have you tried run the same tool using the SAGA command line?


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Feb 14, 2016

Author Name: Jean Hemmi (@jhemmi)


Giovanni,

Using Processing directly (not from plugin), i confirm that with "inverseDistance" alg has the same probleme :
when the name of output file contains non ascii producing
'ascii' codec can't encode character u'\xe9'

From the SAGA command line, non ascii char are supported.
Even if some traces are strange... the right interpolation named with not ascci char is OK

@100%
100%Save grid: C:\Users\xx\Desktop\DATA_PHY\data\testÚlÞv\shapefile\INTER_PARCE
LLAIRE\jeanÙlev1...

100%okay

C:\Program Files\QGIS Lyon\apps\saga>saga_cmd grid_gridding 1 -SHAPES:C:\Users\xxx\Desktop\DATA_PHY\data\testélèv\shapefile\INTER_PARCELLAIRE\testélèv_POINTS_UN
_CONTOUR_L93.shp -FIELD:DIAM -USER_GRID:C:\Users\xxx\Desktop\DATA_PHY\data\testé
lèv\shapefile\INTER_PARCELLAIRE\jeanëlev1

@

@qgib
Copy link
Contributor Author

qgib commented Feb 18, 2016

Author Name: Alexander Bruy (@alexbruy)


Fixed in changeset "61a92e2face35a60487cdb298a4b731ec88951ab".


  • status_id was changed from Feedback to Closed

@qgib
Copy link
Contributor Author

qgib commented Apr 5, 2016

Author Name: Jean Hemmi (@jhemmi)


I've test the fix under Win7 64 Bits, QGIS 2.14.1, Processing 2.1.12 & Saga 2.1.2 : it does not change this problem :

I send two screen shots:

  • the first give the processing log (the grid command)
  • the second the python error log

In the layer & canva, you can see the saga alg result (when file name is "jh"), but when the context is changes to "jéöh" , Processing raises a python error.
SAGA starts works creating the prj file but sdat it not created...

My Question : is this a limitation on the SAGA side or in Processing ?
Is it possible to catch Processing or SAGA exception ?

Thanks


  • 9794 was configured as 2016-04-05_QGIS_2.14.1-Essen_-_processing_log.png
  • status_id was changed from Closed to Reopened
  • 9795 was configured as 2016-04-05_QGIS_2.14.1-Essen_-_python_error.png

@qgib
Copy link
Contributor Author

qgib commented Apr 9, 2016

Author Name: Giovanni Manghi (@gioman)


Jean Hemmi wrote:

I've test the fix under Win7 64 Bits, QGIS 2.14.1, Processing 2.1.12 & Saga 2.1.2 : it does not change this problem :

are you sure you are using a version of Processing that includes the fix?


  • status_id was changed from Reopened to Feedback
  • os_version was changed from Qgis 2.12.x Processing 2.12.2 to
  • operating_system was changed from Windows 8 64 bits to
  • fixed_version_id removed Version 2.14

@qgib
Copy link
Contributor Author

qgib commented Apr 9, 2016

Author Name: Alexander Bruy (@alexbruy)


Seems you tested same installation as previous.

Where you get this Processing 2.1.12? I can not find such version in plugins repository. Also note, that Processing in master has different version number.

@qgib
Copy link
Contributor Author

qgib commented Apr 10, 2016

Author Name: Jean Hemmi (@jhemmi)


Ooups, it was a typo error.
Processing tested was 2.12.2 after re-installed from plugins repository.

I have not verified whether the fix was inside.
I'll have my "test machine" tomorrow and tell you.

@qgib
Copy link
Contributor Author

qgib commented Apr 10, 2016

Author Name: Giovanni Manghi (@gioman)


Jean Hemmi wrote:

Ooups, it was a typo error.
Processing tested was 2.12.2 after re-installed from plugins repository.

this way you'll get an older, non patched version of Processing.
You have to remove any "processing" folder from .qgis2/python/plugins and then install QGIS 2.14

Please test this way, and reopen if necessary.


  • resolution was changed from to fixed/implemented
  • status_id was changed from Feedback to Closed

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms labels May 25, 2019
@qgib qgib closed this as completed May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms
Projects
None yet
Development

No branches or pull requests

1 participant