Skip to content
Open
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ AusMap is a QGIS plugin for visualising publicly available Australian geographic

### Requirements

- QGIS version 3.18 or higher
- QGIS version 3.18 or higher, including QGIS 4.x
- Internet access for fetching online map layer web services

### Installation through QGIS
Expand Down
6 changes: 3 additions & 3 deletions ausmap.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import os.path
import webbrowser

from PyQt5.QtCore import QFileInfo
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QAction, QMenu
from qgis.PyQt.QtCore import QFileInfo
from qgis.PyQt.QtGui import QIcon
from qgis.PyQt.QtWidgets import QAction, QMenu
from qgis.core import QgsProject, QgsSettings

from .config import Config
Expand Down
10 changes: 7 additions & 3 deletions ausmap_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from datetime import datetime, timezone
from urllib.request import urlopen

from PyQt5.QtCore import QFile, QIODevice, QObject
from qgis.PyQt.QtCore import QFile, QIODevice, QObject
from qgis.core import Qgis, QgsMessageLog

from .qlr_file import QlrFile
Expand Down Expand Up @@ -81,12 +81,12 @@ def _get_qlr_file(self):
"An unexpected error occurred while"
f"fetching QLR file: {str(error)}"
),
level=Qgis.Critical,
level=Qgis.MessageLevel.Critical,
)

def _read_cached_qlr(self):
f = QFile(self.cached_ausmap_qlr_file)
f.open(QIODevice.ReadOnly)
f.open(self._read_only_mode())
content = f.readAll()
return QlrFile(content)

Expand All @@ -99,3 +99,7 @@ def _write_local_qlr(self, content):
os.remove(self.cached_ausmap_qlr_file)
with codecs.open(self.cached_ausmap_qlr_file, "w", "utf-8") as f:
f.write(content)

@staticmethod
def _read_only_mode():
return getattr(QIODevice, "ReadOnly", QIODevice.OpenModeFlag.ReadOnly)
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from PyQt5 import QtCore
from qgis.PyQt import QtCore

from .ausmap_config import AusMapConfig
from .local_config import LocalConfig
Expand Down
8 changes: 6 additions & 2 deletions local_config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

from PyQt5.QtCore import QFile, QIODevice
from qgis.PyQt.QtCore import QFile, QIODevice

from .qlr_file import QlrFile

Expand Down Expand Up @@ -30,7 +30,7 @@ def load(self):
def _load_qlr_file(self):
"""Read and load the QLR file from the local path."""
f = QFile(self.local_qlr_file_path)
f.open(QIODevice.ReadOnly)
f.open(self._read_only_mode())
return QlrFile(f.readAll())

def _parse_local_categories(self):
Expand All @@ -56,3 +56,7 @@ def get_categories(self):

def get_maplayer_node(self, layer_id):
return self.qlr_file.get_maplayer_node(layer_id)

@staticmethod
def _read_only_mode():
return getattr(QIODevice, "ReadOnly", QIODevice.OpenModeFlag.ReadOnly)
4 changes: 3 additions & 1 deletion metadata.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[general]
name=AusMap
qgisMinimumVersion=3.18
qgisMaximumVersion=4.99
description=AusMap is a plugin for visualising publicly available Australian geographic data.
about=AusMap gives quick access to a variety of feature sets and map layers provided by Geoscience Australia, the Google Maps Platform and OpenStreetMap. Selecting a desired layer from the AusMap menu will add it to the map canvas with styling and labelling applied. The layers are provided via WCS, WFS, WMS, WMTS and XYZ services, which all require an active internet connection.
version=2.0
version=2.1

author=WMS Engineering
email=tools@wmseng.com.au
Expand All @@ -15,6 +16,7 @@ changelog=- Updated links to Geoscience Australia web services
- Fixed locator filter
- User manual included
- Fixed issue with AusMap settings dialog overwriting QGIS > Preferences on Mac
- Added QGIS 4 / Qt6 compatibility updates

homepage=https://wmseng.com.au/
repository=https://github.com/WMS-Engineering/AusMap
Expand Down
2 changes: 1 addition & 1 deletion qlr_file.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import urllib.parse as urlparse

from PyQt5 import QtXml
from qgis.PyQt import QtXml


class QlrFile:
Expand Down
2 changes: 1 addition & 1 deletion resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# WARNING! All changes made in this file will be lost!

from PyQt5 import QtCore
from qgis.PyQt import QtCore

qt_resource_data = b"\
\x00\x00\x01\xdb\
Expand Down
4 changes: 2 additions & 2 deletions settings/options_tab.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os

from PyQt5 import uic
from PyQt5.QtGui import QIcon
from qgis.PyQt import uic
from qgis.PyQt.QtGui import QIcon
from qgis.core import QgsSettings
from qgis.gui import (
QgsFileWidget,
Expand Down