geodatafarm package


GeoDataFarm - A QGIS plugin This is a plugin that aims to determine the yield impact of different factors


This program is free software; you can redistribute it and/or modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE.


class geodatafarm.GeoDataFarm.GeoDataFarm(iface)

Bases: object

QGIS Plugin Implementation.

Constructor.

Parameters

iface (QgsInterface, An interface instance that will be passed to this class) – which provides the hook by which you can manipulate the QGIS application at run time.

add_action(icon_path, text, callback, enabled_flag=True, add_to_menu=True, add_to_toolbar=True, status_tip=None, whats_this=None, parent=None)

Add a toolbar icon to the toolbar.

Parameters
  • icon_path (str) – Path to the icon for this action. Can be a resource path (e.g. ‘:/plugins/foo/bar.png’) or a normal file system path.

  • text (str) – Text that should be shown in menu items for this action.

  • callback (function) – Function to be called when the action is triggered.

  • enabled_flag (bool) – A flag indicating if the action should be enabled by default. Defaults to True.

  • add_to_menu (bool) – Flag indicating whether the action should also be added to the menu. Defaults to True.

  • add_to_toolbar (bool) – Flag indicating whether the action should also be added to the toolbar. Defaults to True.

  • status_tip (str) – Optional text to show in a popup when mouse pointer hovers over the action.

  • parent (QWidget) – Parent widget for the new action. Defaults None.

  • whats_this (str) – Optional text to show in the status bar when the mouse pointer hovers over the action.

Returns

The action that was created. Note that the action is also added to self.actions list.

Return type

QAction

add_crop()

Adds a crop to the database

add_selected_tables()

Adds a layer for each “parameter” of all selected tables

clicked_create_farm()

Connects the docked widget with the CreateFarm script and starts the create_farm widget

connect_to_farm()

Connects the docked widget with the CreateFarm script and starts the connect to farm widget

create_guide()

Opens the create guide file widget

fix_rows()
get_database_connection()

Connects to the database and create the db object

import_irrigation()

Opens the irrigation handler widget

initGui()

Create the menu entries and toolbar icons inside the QGIS GUI.

multi_edit()

Opens the multi edit widget

onClosePlugin()

Cleanup necessary items here when plugin dock_widget is closed

reload_layer()

Reloads a layer be create a CreateLayer object and call the function repaint_layer

reload_range()

Reload the range of the lowest and highest value of the layer

remove_crop_name()
run()

Run method that loads and starts the plugin

run_analyse()

Gathers the parameters and start the analyse dialog

run_interpolate_harvest()
set_buttons()

Since most functions are dependent on that a database connections exist the buttons are set when a connection is set. If new connections are added here do not forget to add them in create_new_farms function that resets the database connection

tbl_mgmt()

Open the table manager widget

unload()

Removes the plugin menu item and icon from QGIS GUI.

geodatafarm.GeoDataFarm.try_install_package(package)