ConservationInternational / trends.earth

trends.earth - measure land change
http://trends.earth
GNU General Public License v2.0
109 stars 45 forks source link

AttributeError when running tool #251

Closed jasonjb82 closed 4 years ago

jasonjb82 commented 4 years ago

I am trying to calculate the Land Degradation Indicator for the state of Terengganu in Malaysia. I am using QGIS 3.10.0-A Coruna on a Windows 10 OS and received the following error:

qgis-bin_2020-04-01_14-43-29

Below is the log details

2020-04-01T14:43:20     WARNING    Traceback (most recent call last):
              File "C:/Users/Jason/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\LDMP\calculate_tc.py", line 198, in btn_calculate
              ret = super(DlgCalculateTCData, self).btn_calculate()
              File "C:/Users/Jason/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\LDMP\calculate.py", line 987, in btn_calculate
              wrap=self.area_tab.checkBox_custom_crs_wrap.isChecked())
              File "C:/Users/Jason/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\LDMP\calculate.py", line 185, in update_from_geojson
              self.l = transform_layer(l, self.crs_dst, datatype=self.datatype, wrap=wrap)
              File "C:/Users/Jason/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\LDMP\calculate.py", line 65, in transform_layer
              log('Transforming layer from "{}" to "{}". Wrap is {}. Datatype is {}.'.format(l.crs().toProj(), crs_dst.toProj(), wrap, datatype))
             AttributeError: 'QgsCoordinateReferenceSystem' object has no attribute 'toProj'
azvoleff commented 4 years ago

Thanks for reporting this - looks like "toProj" is only present in QGIS 3.10.3+. I'm assuming you are using a version less than that? Let me know if not.

I've now updated the minimum QGIS version in the metadata.txt file for the plugin, so it should no longer let you install in versions less than 3.10.3. If you upgrade to a newer version of QGIS this issue should be fixed.

jasonjb82 commented 4 years ago

Thanks, @azvoleff - I was using version 3.10.0 that gave me the error and now that I have upgraded to version 3.12.1, and it works fine.

azvoleff commented 4 years ago

Great, glad to hear!