Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bounding_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def setStyle(self, mode: str) -> None:
self.setWidth(style.PENWIDTH)
self.setColor(style.COLOR)
self.setFillColor(style.RUBBERBANDCOLOR)
self.setLineStyle(Qt.DashLine)
self.setLineStyle(Qt.PenStyle.DashLine)

def clearBoundingBox(self) -> None:
""" Resets the rubberband to an empty polygon"""
Expand Down
7 changes: 0 additions & 7 deletions compile.bat

This file was deleted.

6 changes: 3 additions & 3 deletions draw_polygon.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ def canvasReleaseEvent(self, event):

mapToPixel = iface.mapCanvas().getCoordinateTransform() # QgsMapToPixel instance

if event.button() == Qt.LeftButton:
if event.button() == Qt.MouseButton.LeftButton:
if not self.rubberBand:
self.rubberBand = QgsRubberBand(mapCanvas=iface.mapCanvas(), geometryType=Qgis.GeometryType.Polygon)
self.rubberBand.setLineStyle(Qt.DashLine)
self.rubberBand.setLineStyle(Qt.PenStyle.DashLine)
self.rubberBand.setWidth(PENWIDTH)
self.rubberBand.setColor(COLOR)
self.rubberBand.setFillColor(RUBBERBANDCOLOR)
self.rubberBand.addPoint(mapToPixel.toMapCoordinates(thisPoint))

elif event.button() == Qt.RightButton:
elif event.button() == Qt.MouseButton.RightButton:
if self.rubberBand and self.rubberBand.numberOfVertices() > 3:
# Finish rubberband sketch
self.rubberBand.removeLastPoint()
Expand Down
4 changes: 2 additions & 2 deletions helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@


def logInfoMessage(msg):
QgsMessageLog.logMessage(message=msg, tag=LOGHEADER, level=Qgis.Info)
QgsMessageLog.logMessage(message=msg, tag=LOGHEADER, level=Qgis.MessageLevel.Info)


def logWarnMessage(msg):
QgsMessageLog.logMessage(message=msg, tag=LOGHEADER, level=Qgis.Warning)
QgsMessageLog.logMessage(message=msg, tag=LOGHEADER, level=Qgis.MessageLevel.Warning)


def openLog():
Expand Down
3 changes: 2 additions & 1 deletion metadata.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[general]
name=Simple WCS 2
qgisMinimumVersion=3.30
qgisMinimumVersion=3.40
qgisMaximumVersion=4.99
description=Provides basic support for OGC WCS 2.X and tiff format
about=Receive tiff files from OGC Web Coverage Services (v2.X) based on your map view. Designed to access certain german official geodata, e.g. digital aerial photographs.
What it supports: WCS 2.X Core, CRS-Extension, Protocol-Binding KVP, Geo-TIFF
Expand Down
164 changes: 0 additions & 164 deletions resources.py

This file was deleted.

5 changes: 0 additions & 5 deletions resources.qrc

This file was deleted.

3 changes: 1 addition & 2 deletions simplewcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@


from .simplewcs_dialog import SimpleWCSDialog
from .resources import *


class SimpleWCS:
Expand Down Expand Up @@ -55,7 +54,7 @@ def tr(self, message) -> str:
def initGui(self) -> None:
"""Create the toolbar icon inside the QGIS GUI.
"""
icon_path = ':/plugins/simplewcs/icon.png'
icon_path = os.path.join(self.plugin_dir, 'icon.png')
self.startAction = QAction(QIcon(icon_path), self.tr('Simple WCS 2'), iface.mainWindow())
iface.addPluginToRasterMenu(self.tr('Simple WCS 2'), self.startAction)
iface.addToolBarIcon(self.startAction)
Expand Down
17 changes: 8 additions & 9 deletions simplewcs_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
from qgis.PyQt.QtWidgets import (QDialog,
QProgressBar,)

from .resources import * # magically sets up icon etc...
from .capabilities import Capabilities
from .coverage import DescribeCoverage
from .bounding_box import BoundingBox
Expand Down Expand Up @@ -248,7 +247,7 @@ def onSketchFinished(self, geom: QgsGeometry) -> None:
if not geom.isGeosValid():
errorMessage = "Drawn polygon has no valid geometry"
self.writeToPluginMessageBar(errorMessage,
level=Qgis.Warning)
level=Qgis.MessageLevel.Warning)
return
if not self.subsetBoundingBox:
self.subsetBoundingBox = BoundingBox('request_extent')
Expand Down Expand Up @@ -291,7 +290,7 @@ def requestAndReadCapabilities(self) -> bool:
except CapabilitiesException as e:
errorMessage = e.args[0]
self.writeToPluginMessageBar(errorMessage,
level=Qgis.Warning)
level=Qgis.MessageLevel.Warning)
logWarnMessage(errorMessage)
self.capabilities = None
return False
Expand Down Expand Up @@ -335,7 +334,7 @@ def adjustGetCoverageAndInformationTabsToService(self) -> None:
wcsVersion = self.getWcsVersion()
if not wcsVersion:
self.writeToPluginMessageBar(f'Service does not support one of the following Versions: {", ".join(self.acceptedWcsVersions)}',
level=Qgis.Warning)
level=Qgis.MessageLevel.Warning)
logWarnMessage(
f'Service does not support one of the following Versions: {", ".join(self.acceptedWcsVersions)}')
return
Expand All @@ -361,7 +360,7 @@ def requestAndReadDescribeCoverage(self, wcsVersion: str) -> bool:
except (DescribeCoverageException, NotImplementedError) as e:
errorMessage = e.args[0]
self.writeToPluginMessageBar(errorMessage,
level=Qgis.Warning)
level=Qgis.MessageLevel.Warning)
logWarnMessage(errorMessage)
self.capabilities = None
self.describeCov = None
Expand Down Expand Up @@ -605,7 +604,7 @@ def getCovTask(self):
url,
covId,
on_finished=self.addRLayer,
flags=QgsTask.CanCancel
flags=QgsTask.Flag.CanCancel
)
QgsApplication.taskManager().addTask(self.task)

Expand Down Expand Up @@ -771,11 +770,11 @@ def getCovProgressBar(self) -> None:
"""Creates a progress bar for the getCoverage task and adds it to the qgis gui."""
self.progress = QProgressBar()
self.progress.setRange(0, 0)
self.progress.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
self.progress.setAlignment(Qt.AlignmentFlag.AlignLeft | Qt.AlignmentFlag.AlignVCenter)

progressMessageBar = iface.messageBar().createMessage("GetCoverage Request")
progressMessageBar.layout().addWidget(self.progress)
iface.messageBar().pushWidget(progressMessageBar, Qgis.Info)
iface.messageBar().pushWidget(progressMessageBar, Qgis.MessageLevel.Info)

def checkUrlSyntax(self, url: str) -> str:
if '?' in url:
Expand Down Expand Up @@ -822,7 +821,7 @@ def addRLayer(self, exception, result=None) -> None:
self.enableBtnGetCoverage()
iface.messageBar().clearWidgets()

def writeToPluginMessageBar(self, msg: str, level=Qgis.Warning, duration=0) -> None:
def writeToPluginMessageBar(self, msg: str, level=Qgis.MessageLevel.Warning, duration=0) -> None:
self.messageBar.pushMessage(msg, level=level, duration=duration)


Expand Down