Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 1.0.7 #549

Merged
merged 5 commits into from
Dec 13, 2024
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
7 changes: 7 additions & 0 deletions CHANGELIST.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# QRiS Plugin

## [1.0.7] 2024 DEC 13

### Fixed
- Added Missing Valley Bottom Symbology #548
- Fix First Time Creating New Project Bug #545
- Adding WMS as Surface Throws Error #544

## [1.0.6] 2024 DEC 06

### Added
Expand Down
19 changes: 19 additions & 0 deletions Images/valley_bottom.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion __version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.0.6"
__version__ = "1.0.7"
2 changes: 1 addition & 1 deletion src/QRiS/qris_map_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def build_valley_bottom_layer(self, valley_bottom: ValleyBottom) -> QgsMapLayer:
return existing_layer

fc_path = f'{self.project.project_file}|layername=valley_bottom_features'
feature_layer = self.create_db_item_feature_layer(self.project.map_guid, group_layer, fc_path, valley_bottom, 'valley_bottom_id', 'valley_bottoms')
feature_layer = self.create_db_item_feature_layer(self.project.map_guid, group_layer, fc_path, valley_bottom, 'valley_bottom_id', 'valley_bottom')

# setup fields
self.set_hidden(feature_layer, 'fid', 'Valley Bottom Feature ID')
Expand Down
12 changes: 7 additions & 5 deletions src/gp/feature_class_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@

from osgeo import ogr
from osgeo import osr
from shapely.wkb import loads as wkbload, dumps as wkbdumps
from osgeo.gdal import Warp, WarpOptions
from qgis.PyQt.QtWidgets import QMessageBox
from qgis.core import QgsVectorLayer, QgsGeometry

from qgis.PyQt.QtWidgets import QMessageBox
from qgis.gui import QgsDataSourceSelectDialog
from qgis.core import QgsMapLayer, QgsWkbTypes
from qgis.core import QgsMapLayer, QgsWkbTypes, QgsVectorLayer, QgsGeometry
from qgis.utils import iface

from ..model.db_item import DBItem
Expand Down Expand Up @@ -171,6 +168,11 @@ def browse_raster(parent, description: str) -> str:
uri = frm_browse.uri()

if uri is not None and uri.isValid():
# check if the raster exists on disk
if uri.providerKey != 'gdal':
QMessageBox.warning(parent, 'Invalid Raster',
f'This raster format is not currently supported by QRiS. Please select a different raster.')
return None
# if uri extension is .vrt then it is a virtual raster and cannot be used
vrt_ext = os.path.splitext(uri.uri)[1].lower()
if vrt_ext == '.vrt':
Expand Down
2 changes: 1 addition & 1 deletion src/model/valley_bottom.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(self, id: int, name: str, description: str, metadata: dict = None):
super().__init__('valley_bottoms', id, name)
self.description = description
self.metadata = metadata
self.icon = 'polygon'
self.icon = 'valley_bottom'
self.fc_name = 'valley_bottom_features'
self.fc_id_column_name = 'valley_bottom_id'

Expand Down
8 changes: 7 additions & 1 deletion src/qris_toolbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,13 @@ def run(self):
settings = QtCore.QSettings(ORGANIZATION, APPNAME)
last_project_folder = settings.value(LAST_PROJECT_FOLDER)
if last_project_folder is not None and os.path.isdir(last_project_folder):
project_file = os.path.join(last_project_folder, f'{os.path.basename(last_project_folder)}.gpkg')
# find the project gpkg file in the last project folder only
project_file = None
for file in os.listdir(last_project_folder):
if file.endswith('.gpkg'):
project_file = os.path.join(last_project_folder, file)
break
# project_file = os.path.join(last_project_folder, f'{os.path.basename(last_project_folder)}.gpkg')
if os.path.isfile(project_file):
self.open_qris_project(project_file)

Expand Down
Loading