Skip to content

Commit

Permalink
show error if custom crs bug encountered (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
letmaik authored Dec 27, 2019
1 parent 811eda1 commit dd482b0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion gis4wrf/plugin/geo.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
)
from qgis.gui import QgsMapCanvas

from PyQt5.QtWidgets import QMessageBox

import gis4wrf.core
from gis4wrf.core import BoundingBox2D
from gis4wrf.plugin.ui.helpers import dispose_after_delete
Expand All @@ -26,7 +28,13 @@ def get_qgis_crs(proj4: str) -> QgsCoordinateReferenceSystem:
assert crs.isValid(), proj4
if not crs.authid():
srs_id = crs.saveAsUserCrs('WRF CRS ({})'.format(proj4))
assert srs_id != -1, proj4
if srs_id == -1:
QMessageBox.critical(
None, 'QGIS version too old',
'Your QGIS version is too old. See <a href="https://github.com/GIS4WRF/gis4wrf/issues/149#issuecomment-569264760">github.com/GIS4WRF/gis4wrf/issues/149</a> for details.',
QMessageBox.Ok,
QMessageBox.Ok)
#assert srs_id != -1, proj4
return crs

def rect_to_bbox(rect: QgsRectangle) -> BoundingBox2D:
Expand Down

0 comments on commit dd482b0

Please sign in to comment.