I'm having trouble merging shapefiles in QGIS. I'm using plugin ftools 0.6.1 and I get this:
Any workarounds someone may know of?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
There is a considerable difference between the core plugin, fTools, in version 1.7.4 and latest (1.8 RC, or 1.9 master branch). I'm guessing the new version is not quite ready for release, as its __init__.py file has not been updated beyond the same 0.6.1 version.
However, I was able to do a quick fix to get this function of the plugin to work in 1.7.4. Open the noted file that exhibits the error in a good text editor (BBEdit or TextWrangler on Mac). Here is where it is located...
On Win: [drive letter]:\OSGeo4W\apps\qgis\python\plugins\fTools\tools\doMergeShapes.py On Mac: /Applications/QGIS.app/Contents/Resources/python/plugins/fTools/tools/doMergeShapes.py
You will generally need to make the file write-able and authenticate when saving on Mac, as the core files are usually owned by a different user.
The error references line 124:
if self.inEncoding == None:
AttributeError: 'Dialog' object has no attribute 'inEncoding'
This means that self.inEncoding has not yet been defined as an instance attribute, but is being tested against None. Merely adding an assignment for self.inEncoding in the Dialog's __init__ method allows the plugin to work. Add a new line below line 22, so that line 22 and 23 look like this:
self.outFileName = None self.inEncoding = None # added this line
This allows the plugin to work, but the 1.8 RC version has 23 changes over the 1.7.4 version in this file alone. So, it could be the new version also fixes some other issues.