Skip to content

Commit dd482b0

Browse files
authored
show error if custom crs bug encountered (#160)
1 parent 811eda1 commit dd482b0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

gis4wrf/plugin/geo.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
)
1616
from qgis.gui import QgsMapCanvas
1717

18+
from PyQt5.QtWidgets import QMessageBox
19+
1820
import gis4wrf.core
1921
from gis4wrf.core import BoundingBox2D
2022
from gis4wrf.plugin.ui.helpers import dispose_after_delete
@@ -26,7 +28,13 @@ def get_qgis_crs(proj4: str) -> QgsCoordinateReferenceSystem:
2628
assert crs.isValid(), proj4
2729
if not crs.authid():
2830
srs_id = crs.saveAsUserCrs('WRF CRS ({})'.format(proj4))
29-
assert srs_id != -1, proj4
31+
if srs_id == -1:
32+
QMessageBox.critical(
33+
None, 'QGIS version too old',
34+
'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.',
35+
QMessageBox.Ok,
36+
QMessageBox.Ok)
37+
#assert srs_id != -1, proj4
3038
return crs
3139

3240
def rect_to_bbox(rect: QgsRectangle) -> BoundingBox2D:

0 commit comments

Comments
 (0)