Git Product home page Git Product logo

autofields's Introduction

AutoFields

⚠️ NOTE: This plugin was created for QGIS 2.x.; QGIS 3.x offers equivalent functionality out of the box. (See how)


QGIS plugin to configure automatic attribute updates when creating or modifying vector features.

Automatic updates on vector fields

Unlike Virtual Fields, AutoFields:

  • Store calculated values directly in the data source;
  • Are independent of QGIS projects, i.e., you can switch between QGIS projects and AutoFields will still work;
  • Only work on editable vector layers.

See detailed documentation, examples, videos, FAQ, and known issues at: http://geotux.tuxfamily.org/index.php/en/geo-blogs/item/333-autofields-plugin-for-qgis

See the changelog at https://github.com/gacarrillor/AutoFields/blob/master/changelog.txt

Automatic updates on vector fields

DONATIONS

Special thanks for the following persons, who donated money to AutoFields, acknowledging and motivating its development and maintenance!

  • Klaus König
  • Hugues Boisvert

autofields's People

Contributors

gacarrillor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

autofields's Issues

Uncaught StopIteration

Steps to reproduce

  1. First - Create Autofield Timestamp
  2. Second - new point
  3. Third - save Layer and Error
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

It doesn't install in QGIS 3.10.4

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 loadPlugin
import(packageName)
File "C:/OSGEO4
1/apps/qgis-ltr/./python\qgis\utils.py", line 744, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'AutoFields-0'

Saving Fields Definitions to File

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.

Autofields Plugin does not start on QGIS python console

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

Uncaught UnicodeEncodeError: 'ascii' codec can't encode character u'\xd6' in position 5: ordinal not in range(128)

Steps to reproduce

  1. First - export to JSON
  2. Second - select Layer and output file
  3. Third - klick 'OK' for export
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

calculate values on existing features

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.

Migrate AutoFields to QGIS v3.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'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.