I am using Qgis 2.12Lyon and try to run a viewshed analysis to show the intervisibility between several points in more than one shapefile.

I have a digital elevation model (.tif) which is projected in EPSG:32632, WGS 84 /UTM Zone 32N. The elevation model in combination with one of the point-shapefiles works in a viewshed analysis.

I need to analyse the view from points which are given in five different point-shapefiles. So I merged the five shapefiles with the datamanagement-tool and tried to run the viewshed plugin with the same DEM as before in combination with the new, merged shapefile.

This is the error occurring:

UnicodeEncodeError: 'ascii' codec can't encode character u'/xfc'in Position 1: ordinal not in range (128) 

Traceback (most recent call last):
File"C:Users/.qgis2/python/plugins/ViewshedAnalysis/viewshedanalysis.py" , line 93 , in load_cmbObsField def load_cmbObsField(self,cmb_index) : self.reload_dependent_combos (cmb_index, 'cmbObsField')
File"C:Users/.qgis2/python/plugins/ViewshedAnalysis/viewshedanalysis.py", line 121, in reload_dependent_combos cmb_obj.addItem(str(fld.name()), str(fld.name())) #for QGIS 2.0 we need column names not index (j)

UnicodeEncodeError: 'ascii' codec can't encode character u'/xfc'in Position 1: ordinal not in range (128) 

Python-Version: 2.7.5 (Default, May 15 2013, 22:44:16)[MSC v. 1500 64 bit (AMD64)]

Both inputfiles are encoded in UTF-8 and have the same coordinatesystem /projection (see above). The same problem occurs using Qgis 2.8Wien. There are no non-ascii characters included in the pathnames. I also tried to save the merged file in different places.

I wonder what happens with the data when merging shapefiles so that the plugin doesn't work anymore. Is there any way to solve the problem?

1 Answer 1


Check attribute names for special characters and remove them! use the table manager plugin to edit attribute names.

I stumbled across the same issues when parsing files and so on. Mostly the problem was a special character like ö, ü, ä, ß and so on.

Additionally check your shapefiles for attributes with special characters and eliminate them. Also check the file names for any special character like and so on and try to eliminate them.

  • Thank you so much! It really was about special characters in the attribute names.
    – Wensen
    Feb 11, 2016 at 8:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.