viewerwindow

Main Window of the TuiView application. Contains the ViewerWidget, menus, toolbars and status bars.

class tuiview.viewerwindow.ViewerWindow(*args: Any, **kwargs: Any)[source]

Main window for viewer application. The ViewerWidget is contained in the ‘viewwidget’ attribute.

newQueryWindowSig

user has opened a new query window

alias of QueryDockWidget

readViewersState

read viewer state from a tile

alias of object

tileWindowsSig

user has requested that the windows are tiles

alias of int

writeViewersState

write viewer state to a file

alias of object

about()[source]

Show author and version info

activeToolChanged(obj)[source]

Called when the active tool changed. If we didn’t cause it then show our tools as disabled

activeToolChangedInternal()[source]

Disable all tools, done on viewer reset

addLayersFromJSONFile(fileobj, nlayers)[source]

Gets the widget to read layer definitions from fileobj and add them

addRaster()[source]

User has asked to open a file. Show file dialog and open file

addRasterInternal(fname, stretch=None, showError=True)[source]

Actually to the file opening. If stretch is None is is determined using our automatic scheme. if showError is True a message box will be displayed with any error if false an exception will be raised.

addVectorDB()[source]

Add a vector from a database - ask user for connection string

addVectorDir()[source]

Add a vector from a directory (filegdb/covereage)

addVectorFile()[source]

User wants to add a vector layer. OGR seems to have no way to determine extensions… From a file.

addVectorInternal(path, layername=None, sql=None, label=None)[source]

Open OGR dataset and layer and tell widget to add it to the list of layers

arrangeLayers()[source]

Toggle the LayerWindow

closeAll()[source]

Send a signal to geolinked viewers close all windows. For some reason, doing this right now causes a crash. Seems safest to wait until GUI is idle (using a single shot timer with a timeout of 0) then call closeAllOnTimer() to do the actual work.

closeAllOnTimer()[source]

See closeAll() below. Does the actual work when called by the single shot timer.

closeEvent(event)[source]

Window is being closed. Save the position and size. Check that any of the query windows don’t have unsaved data

defaultStretch()[source]

Show the default stretch dialog

disableTools(ignoreTool=None)[source]

Disable all tool actions apart from ignoreTool

dragEnterEvent(event)[source]

Called when user about to drop some data on the window accept it if it has urls (which are usually just files)

dropEvent(event)[source]

Called when the user attempts to drop some data onto the window We only respond to files being dropped

editStretch()[source]

Show the edit stretch dock window

endProgress()[source]

Called when a progress run has finished

static findDefaultStretchForDataset(gdaldataset)[source]

Attempts to find the default stretch that matches the given gdal dataset. Returns None on failure.

flicker()[source]

Tell the widget to flicker

followExtent(state)[source]

Called when user toggles the follow extent button. Tell the widget

layerWindowClosed(window)[source]

Reset state so we know we need to open another

loadViewersState()[source]

Get the geolinked viewers class to open previously saved state file

moveDown()[source]
moveFixedDist(xdist, ydist)[source]
moveLeft()[source]
moveRight()[source]
moveUp()[source]
newPercent(percent)[source]

New progress value

newProfile()[source]
newProgress(string)[source]

Called when we are about to start a new progress

newQueryWindow()[source]

Create a new QueryDockWidget and connect signals and increment our count of these windows

newVectorQueryWindow()[source]

Create a new VectorQueryDockWidget and connect signals and increment our count of these windows

newWindow()[source]

Triggered when user wants a new window. Send signal to GeolinkedViewers class (if there is one!)

pan(checked)[source]

Pan tool selected. Tell view widget to operate in pan mode.

profile(checked)[source]

Profile tool selected. Tell view widget to operate in polyline mode.

profileClosed(profileDock)[source]

Profile dock window has been closed. Disconnect from polylineCollected signal and decrement our count

properties()[source]

Show the properties dialog

query(checked)[source]

Query tool selected. Tell view widget to operate in query mode.

queryClosed(queryDock)[source]

Query dock window has been closed. Disconnect from locationSelected signal and decrement our count

queryOnlyDisplayed(state)[source]

Change the state of the querying behaviour

removeLayer()[source]

Remove the top most layer

resizeForWidgetSize(xsize, ysize)[source]

Resizes this window so that the widget is the given size Takes into account the border etc

restoreFromSettings()[source]

Restore any settings from last time n.b. need to rationalize with preferences window

saveCurrentView()[source]

Saves the current view as an image file

saveCurrentViewInternal(fname)[source]

Saves the current view as an image file as the file given

saveCurrentViewInternalGDAL(fname, driver, creationOptions)[source]

Like saveCurrentViewInternal but saves as a georeferenced image file using GDAL

saveViewersState()[source]

Get the geolinked viewers class to save the state as a file

setPreferences()[source]

Display the preferences dialog

setupActions()[source]

Creates all the actions for the Window

setupMenus()[source]

Creates the menus and adds the actions to them

setupStatusBar()[source]

Sets up the status bar

setupToolbars()[source]

Creates the toolbars and adds the actions to them

showStatusMessage(message)[source]

Helper method to show a message for a short period of time

tileWindows()[source]

Triggered when user wants to tile windows. Display dialog to allow number to be selected, then send signal to GeolinkedViewers class (if there is one!)

updateWindowTitle(layer)[source]

called in response to the topLayerChanged(PyQt_PyObject) signal from the layers to say the top displayed layer has changed

vectorQuery(checked)[source]

Vector Query tool selected Tell view widget to operate in query mode

vectorQueryClosed(queryDock)[source]

Query dock window has been closed. Disconnect from vectorLocationSelected signal and decrement our count

zoomFullExtent()[source]

Tell the widget to zoom back to the full extent

zoomIn(checked)[source]

Zoom in tool selected. Tell view widget to operate in zoom mode.

zoomNative()[source]

Tell the widget to zoom to native resolution

zoomOut(checked)[source]

Zoom in tool selected. Tell view widget to operate in zoom mode.

closeAllWindowsSig

close all tuiview windows

newWindowSig

new window created

class tuiview.viewerwindow.WildcardFileDialog(*args: Any, **kwargs: Any)[source]

Our version of the Qt Filedialog thathas an “Expand Wildcards” button.

expandWildcards()[source]

Expand Wildcard button has been clicked.

tuiview.viewerwindow.createFilter(driver)[source]

Given a GDAL driver, creates the Qt QFileDialog compatible filter for the file type

tuiview.viewerwindow.populateFilters(defaultDriver=None)[source]

Create a list of file filters for QFileDialog for all the GDAL supported files. If a default driver is specified it goes first on the list