root676 / QNEAT3

QNEAT3 - Qgis Network Analysis Toolbox 3
GNU General Public License v3.0
63 stars 12 forks source link

Error in Iso Area algorithm(s) when Project CRS != Layer(s) CRS #29

Closed ghtmtt closed 1 year ago

ghtmtt commented 4 years ago

Hi,

I've 2 layers (road network and starting points) both in EPSG:6707 (projected CRS). All the analysis of QNeat work perfectly. Then I loaded the OpenStreetMap XYZ Tile and changed the project CRS to EPSG:3857.

QNeat algorithms stopped working. E.g. the following traceback is from Iso-Area as Contours (from Layer). Knowing that it is always better not to mix CRS I just wanted to report this behavior ;)

p.s. AWESOME plugin!

Traceback (most recent call last):
File "/home/matteo/.local/share/QGIS/QGIS3/profiles/matteo/python/plugins/QNEAT3/algs/IsoAreaAsContoursFromLayer.py", line 255, in processAlgorithm
contour_featurelist = net.calcIsoContours(max_dist, interval, output_path)
File "/home/matteo/.local/share/QGIS/QGIS3/profiles/matteo/python/plugins/QNEAT3/Qneat3Framework.py", line 411, in calcIsoContours
band_in = ds_in.GetRasterBand(1)
AttributeError: 'NoneType' object has no attribute 'GetRasterBand'

Execution failed after 1.74 seconds
root676 commented 4 years ago

Hi Matteo! Thanks for reporting the error!

ghtmtt commented 4 years ago

Hi Clemens :) Please tell me if you want a small project. I did prepare it because the error is straightforward, but just ask ;)

root676 commented 4 years ago

:) Oh that would be very helpful! This should help identifying the faulty code sections.

josephholler commented 4 years ago

Line 224 of IsoAreaAsContoursFromLayer.py sets the analysis CRS using the Project CRS. This could be changed to use the network layer CRS. In addition, it'd be nice to check consistency between the CRSs of all input layers (and the Project CRS for "from point" algorithms) and either reproject them to the network layer CRS or provide a warning.

ghtmtt commented 4 years ago

wow, thanks @josephholler for the fix. I'll test the related PR and let you know ASAP!

root676 commented 4 years ago

@josephholler nice bugfix there! Thank you!

ghtmtt commented 4 years ago

seems fixing the issue, thanks @josephholler

josephholler commented 4 years ago

That's great! Thanks to @kufreu for working on this as well.

root676 commented 1 year ago

Implemented in 1.0.5