From aaca2a9588f837d73419493631aa4c7ad65fc7ae Mon Sep 17 00:00:00 2001 From: Lu Li Date: Fri, 19 May 2023 16:27:47 +0800 Subject: [PATCH] Enable manual input when no CRS found in XML For some case, the EPSG is not defined in Oasis Montaj. For example, there is no Antarctic Polar Stereographic projection available in Oasis Montaj. In that case, we should make manual input EPSG works in this case. --- GRD_Loader.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/GRD_Loader.py b/GRD_Loader.py index 45c4705..0154c39 100644 --- a/GRD_Loader.py +++ b/GRD_Loader.py @@ -219,8 +219,12 @@ def run(self): if(os.path.exists(file_path+'.xml')): epsg=extract_proj_str(file_path+'.xml') if(epsg== None): - epsg=4326 - self.iface.messageBar().pushMessage("No CRS found in XML, default to 4326", level=Qgis.Warning, duration=15) + if not self.dlg.lineEdit_2.text(): + epsg=4326 + self.iface.messageBar().pushMessage("No CRS found in XML, default to 4326", level=Qgis.Warning, duration=15) + else: + epsg = int(self.dlg.lineEdit_2.text()) + self.iface.messageBar().pushMessage("CRS Read from manual input as "+str(epsg)+"", level=Qgis.Warning, duration=15) else: self.iface.messageBar().pushMessage("CRS Read from XML as "+epsg+", manual input ignored", level=Qgis.Info, duration=15) else: