gacarrillor / autofields Goto Github PK
View Code? Open in Web Editor NEWQGIS plugin to configure automatic vector field updates when creating or modifying features.
License: GNU General Public License v2.0
QGIS plugin to configure automatic vector field updates when creating or modifying features.
License: GNU General Public License v2.0
Migrate AutoFields to QGIS v3.0+.
Currently, trying to install AutoFields 0.5.1 from Zip to QGIS 3.0.2 leads to:
Traceback (most recent call last):
File "C:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 336, in startPlugin
plugins[packageName] = package.classFactory(iface)
AttributeError: module 'AutoFields' has no attribute 'classFactory'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 1, in
File "C:/OSGEO4~1/apps/qgis/./python\pyplugin_installer\installer.py", line 586, in installFromZipFile
if startPlugin(pluginName):
File "C:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 338, in startPlugin
_unloadPluginModules(packageName)
File "C:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 405, in _unloadPluginModules
mods = _plugin_modules[packageName]
KeyError: 'AutoFields'
Steps to reproduce
Traceback (most recent call last):
File "C:/Users/USER/.qgis2/python/plugins\AutoFields\EventManager.py", line 185, in providerExpressionBasedUpdate
self.expressionBasedUpdate( layer, dictProperties, feature.id() )
File "C:/Users/USER/.qgis2/python/plugins\AutoFields\EventManager.py", line 244, in expressionBasedUpdate
feature = layer.getFeatures( QgsFeatureRequest( featureId ) ).next()
StopIteration
AutoFields 0.5.1, QGIS 2.14.20-Essen on Windows 10
I was wondering if it would be possible to save the definitions to a separate file so that it would persist across QGIS installs. For example, I use QGIS on both a desktop and a Laptop, with the project and layer files synched through Dropbox. The only thing that doesn't follow cleanly is the AutoFields, which I have to update on both machines whenever I make a change to an AutoField. Saving them to a file and loading them on QGIS start would solve that issue. It would also be much easier to backup and restore. Choosing the file location would be great, but saving to the same folder as the project file would also work.
Hi German,
I have succesfully installed Autofields and the GUI is working perfectly well. However, when I try to use your code example in QGIS python console:
def getAutoFieldsManager():
if not utils.isPluginLoaded('AutoFields'):
if 'AutoFields' in utils.available_plugins:
utils.loadPlugin('AutoFields')
utils.startPlugin('AutoFields')
af = utils.plugins['AutoFields']
return af.autoFieldManager
else:
print "It seems AutoFields plugin is not installed. Could you please check it?"
return None
Then
utils.startPlugin('AutoFields')
returns "False". And when I call
afm = getAutoFieldsManager()
afm is "None".
Any ideas on what could be wrong with utils.startPlugin('AutoFields')
and "Autofields"?
Thanks a lot
Cheers
It seems that Python version is changed and maybe qgis import methods too therefore some updating is needed in AutoFields code
I was able to fix line #165 in AutoFields.py to Python 3.7 syntax
except ValueError as e:
but a new error which I am not able to fix popped up:
ModuleNotFoundError: No module named 'AutoFields-0'
Traceback (most recent call last):
File "C:/OSGEO41/apps/qgis-ltr/./python\qgis\utils.py", line 312, in loadPlugin1/apps/qgis-ltr/./python\qgis\utils.py", line 744, in _import
import(packageName)
File "C:/OSGEO4
mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'AutoFields-0'
Steps to reproduce
Traceback (most recent call last):
File "C:/Users/USER/.qgis2/python/plugins\AutoFields\ExportAutoFieldsDialog.py", line 122, in accept
"Selected AutoFields have been exported to {}.".format( self.txtExportFile.text() ) ) )
UnicodeEncodeError: 'ascii' codec can't encode character u'\xd6' in position 5: ordinal not in range(128)
AutoFields 0.5.0, QGIS 2.14.19-Essen on Windows 10
When creating an AutoField, it does not calculate the existing values. It only updates when you add/change values. It would be verry nice if there was an opportunity to fix it that way.
Hi,
Is it possible to update the plugin to QGIS 3.x ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.