FAKT - Automatisk Generert Dokumantasjon

Tilgjengelighet

/***********************************************************************
Tilgjengelighet
A QGIS plugin
My Tilgjengelighet assignment

begin : 2017-08-21 git sha : $Format:%H$ copyright : (C) 2017 by Kasper Skjeggestad email : kasper.skjeggestad@gmail.com

***********************************************************************/

/***********************************************************************
  • This program is free software; you can redistribute it and/or modify *
  • it under the terms of the GNU General Public License as published by *
  • the Free Software Foundation; either version 2 of the License, or *
  • (at your option) any later version. *

***********************************************************************/

class Tilgjengelighet.Tilgjengelighet(iface)[source]

Bases: object

QGIS Plugin Implementation.

OpenBrowser()[source]

Opens broeser to save file

addLayer(layerType)[source]

The folowing code has been taken out from OpenLayers Plugin writen by Sourcepole

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)[source]

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 – 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

assign_combobox_baderampe()[source]

Assigning a AttributeForm object to each option in Baderampe

assign_combobox_fiskeplass()[source]

Assigning a AttributeForm object to each option in Baderampe

assign_combobox_hc_parkering()[source]

Assigning a AttributeForm object to each option in hc parkering

assign_combobox_inngang()[source]

Assigning a AttributeForm object to each option in inngang

assign_combobox_parkeringsomraade()[source]

Assigning a AttributeForm object to each option in parkeringsområde

assign_combobox_vei()[source]

Assigning a AttributeForm object to each option in vei

canvasCrs()[source]

The folowing code has been taken out from OpenLayers Plugin writen by Sourcepole

change_search_name()[source]

Changes the name of search based on current tab and fyle and kommune

createGdalTmsLayer(layerType, name)[source]

The folowing code has been taken out from OpenLayers Plugin writen by Sourcepole

create_filter(opperator, valueReference, value)[source]

creates FE based on input, made to take less space in other method create_filtherencoding

Parameters:
  • opperator (str) – opperator for FE
  • valueReference (str) – name of attribute for FE
  • value (str) – value for FE
create_filtherencoding(attributeList)[source]

creates FE based on user choices

Parameters:attributeList (list<AttributeForms>) – list of all attriubtes for filterencoding
Returns:FilterEncoding
Return type:str
excelSave()[source]

obtaind from xytools, Saves features to excel format @author: Richard Duivenvoorde

fill_combobox(combobox, filename)[source]

Fikks combobox with lines from filename

Parameters:
  • combobox (QComboBox) – The combobox to be filled
  • filename (str, QString) – name of file with info to be filled in combobox
fill_fylker()[source]

Fill up the combobox fylker with fylker from komm.txt

fill_infoWidget(attributes)[source]

Filling infowidget with attributes name and no value. Also ajustes size of infowidget

Parameters:attributes (list<AttributeForms>) – List of gui attriibutes
filtrer()[source]

Makes FE and layer based on choises from user an current tab

fylke_valgt()[source]

Fill up kommune combobox with kommune in chosen fylke

get_previus_search_activeLayer()[source]

Open filtering window set to preweus choises

get_temppath(filename)[source]

Creating a temperarly path for a temperary file

Parameters:filename (str, QString) – String name for file
Returns:string of full path
Return type:str
hide_show_gui(attributeForms, condition, extra=None)[source]

Shows parts of GUI if conditions are meat, hids it if not

Parameters:
  • attributeForms (list<AttributeForm>) – A list of witch attributes to hide in GUI
  • condition (boolean) – The condition to show GUI parts
  • extra (list<QtWidgets>) – include if gui consists of more than attributes that needs to be showed/hidden
highlightSelected()[source]

Highlights the object viewed in infowidget

imageSave()[source]

saves a screenshot of canvas

infoWidget_next()[source]

shows next object in infoWidget

infoWidget_prev()[source]

shows previus object in infoWidget

initGui()[source]

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

kommune_valgt()[source]

Alter the name on seach after a kommune is chosen

lagre_lag()[source]

Saves layer as exported

obj_info()[source]

Fills infowidget with info of current object

openLayer_background_init()[source]

The folowing code has been taken out from OpenLayers Plugin writen by Sourcepole

open_export_layer_dialog()[source]

opens the excport gui

reset()[source]

Resets the gui back to default

resolve(basepath=None)[source]
run()[source]

Run method that performs all the real work

savePath(saveType, saveExtension)[source]

Find the save path

Parameters:
  • saveType (str) – The type of file to be saved
  • saveExtension (str) – File extention (e.g .xls .png)
Returns:

direktory path and file namle

Return type:

(str,str)

“Saves the search to search history so it can set choises in GUI bac to preveus desisions

selectedObjects(selFeatures)[source]

changing number of selected objects in infowidget and settning current selected object

Parameters:selFeatures – Selected features of layer
setMapCrs(coordRefSys)[source]

The folowing code has been taken out from OpenLayers Plugin writen by Sourcepole

setReferenceLayer(layer)[source]

The folowing code has been taken out from OpenLayers Plugin writen by Sourcepole

show_message(msg_text, msg_title=None, msg_info=None, msg_details=None, msg_type=None)[source]

Show the user a message :param msg_text: the tekst to show the user :type msg_text: str

Parameters:
  • msg_title (str) – the title of the message box
  • msg_info (str) – additional info for the user
  • msg_details (str) – details for the user
  • msg_type (QMessageBox.Icon) – the type of message
show_tabell()[source]

Shows or hide tableWidget

to_unicode(in_string)[source]

Transforme string to unicode

Parameters:in_string – String to transforme
Returns:unicode verson of string
Return type:unicode
tr(message)[source]

Get the translation for a string using Qt translation API.

We implement this ourselves since we do not inherit QObject.

Parameters:message (str, QString) – String for translation.
Returns:Translated version of message.
Return type:QString
unload()[source]

Removes the plugin menu item and icon from QGIS GUI.

AttributeForm

class AttributeForm.AttributeForm(attribute, comboBox=None, lineEdit=None, comboBoxText=None, label=None)[source]

Bases: object

Saves attributes and assosiated gui widgets

getAttribute()[source]

Returns the assosiated attriubte name

Returns:returns the associated attribute name
Return type:str
getComboBox()[source]

Returns the assosiated combobox widget

Returns:returns the associated comboBox
Return type:QComboBox
getComboBoxCurrentText()[source]

Returns the assosoated combobox text

Returns:returns the associated comboBox text, return None if no combobox is availeble
Return type:QString
getLabel()[source]

Returns the assisiated label widget if any :returns: returns the associated label :rtype: QLabel

getLineEdit()[source]

Returns the assosiated lineEdit widget if any

Returns:returns the associated lineEdit
Return type:QLineEdit
getLineEditText()[source]

Returns the lineEdit text

Returns:returns the lineEdit text, return None if no lineEdit is availeble
Return type:QString
is_number(s)[source]

Sett text in AttributeForm lineEdit

Parameters:s (str) – string to be change for being a number
Returns:tru if s is number, false if s in not a number
Return type:boolean
opperator()[source]
Returns:the opperator for attriubutt qury
Return type:QString, None
reset()[source]

Resets form to defult

setComboBox(comboBox)[source]

Assigning comboBox

Parameters:comboBox (QComboBox) – combobox assisiated to attribute
setLineEdit(lineEdit)[source]

Assigning lineEdit

Parameters:lineEdit (QLineEdit) – Linedit assisiated to attribute
setLineEditText(string)[source]

Sett text in AttributeForm lineEdit

Parameters:string (str) – String to set in lineEdit
valudeValid()[source]

checks if the attribute is valid and search ready

Returns:True if attrivute is valid, false if not
Return type:boolean
value()[source]

returns the value constraint, if alternative combobox is set, return that value, if lineedit, ruturn value freom line edit, else return from combobox

Returns:the value constraint
Return type:str
valueReference()[source]

Returns the objekt attribute

Returns:name of object attribute in database
Return type:str

SavedSearch

class SavedSearch.SavedSearch(search_name, layer, tabIndex_main, tabIndex_friluft, tabIndex_tettsted)[source]

Bases: object

Class made to save the choises made by user on a previus search

add_attribute(attribute, current_index, current_lineText)[source]

Add attribute with current index for combobx and current text for lineText Attributes are stored in dictionarys as key, while value is list of combobox indes and lintEdtid text

Parameters:
  • attribute (AttributeForm) – one attribute from filter interface
  • current_index (int) – index of combobx at search
  • current_lineText (str) – text of lineEdit at search
get_attributes()[source]

Returns dictionary of attributes

Returns:dictionary of attributes
Return type:list<AttributeForm>