have you figured out why qgis crashes (7:25)? The same happens to me over and over again, but simply restarting the program doesn´t solve the problem.
@geospatialschool5 жыл бұрын
Did you change anything in the code? In the video I changed the code slightly after the crash. Make sure your code matches the code in the video from after the crash. If it does, and you still get a crash then it could be something with the files you are using.
@johannesmay1855 жыл бұрын
@@geospatialschool Thanks for this hint. NOTE for everyone: change ras.layer into ras.raster ; Then it all gonna work trouble free.
@annasam44612 жыл бұрын
Hi, Thank you for the tutorial. Is there any way to combine two rasters (reclassified raster and a binary raster) to find the no of pixels of a binary raster in the each category of the reclassified raster ?
@connor3089 Жыл бұрын
Thanks for the video. For line 12 I get the error message File "", line 13, in AttributeError: 'str' object has no attribute 'extent'. Any idea what's going on there?
@geospatialschool Жыл бұрын
The variable that you're calling 'extent' on is of string type
@rubencrespo17203 жыл бұрын
Hi There, thank you for the video. I have a question. If I want to do a subtraction between two raster layers and I want to get only a certain extent of the area. Should I use the "extent" parameter? How do I set the desired bounding box? Thank you!
@jaimegarbanzo90832 жыл бұрын
awesome, I will add this calc.lastError() to know if something goes wrong
@Benjamin-ej8oz4 жыл бұрын
Would it be possible to do a video about PyQGIS documentation? - where do you go when you check the syntax of these commands, how to read, search and understand the documentation? I'm newish to python and when I look at the docs I feel like part of my brain must be missing
@geospatialschool4 жыл бұрын
Check out this course: opensourceoptions.com/courses/courses/pyqgis-learn-the-qgis-python-api/ The sample (free) lessons will go through documentation for some specific functions. Hopefully you'll find it helpful.
@Richard-sk3vh4 жыл бұрын
Hey man, I'm trying to run a batch QGIS3 NDVI calculator script on a bunch of ENVI 16 bit unsigned .bil data cubes, and the outputs are all 32bit and dark n grainy. Is there a way to set the output data type?
@geospatialschool4 жыл бұрын
Your outputs are 32 bit because NDVI is going to result in a floating point value, not an integer. You might be able to change the data type by converting NDVI to an integer value. Also, you can probably just adjust the symbology to get the outputs to look the way you want.
@Richard-sk3vh4 жыл бұрын
@@geospatialschool Okay, that sort of sheds some light on it. But I don't think I provided enough detail. If I run the NDVI equation in the QGIS calculator GUI it yields a decent resolution, image with stats; STATISTICS_MAXIMUM=0.58577406406403 STATISTICS_MEAN=-0.13778701532923 STATISTICS_MINIMUM=-0.59615385532379 STATISTICS_STDDEV=0.30573901223104 STATISTICS_VALID_PERCENT=100 But when I use Python, the output is dark and has lost resolution. The stats are: STATISTICS_MAXIMUM=0 STATISTICS_MEAN=-0.92910058966749 STATISTICS_MINIMUM=-1 STATISTICS_STDDEV=0.05557199898703 STATISTICS_VALID_PERCENT=100 AREA_OR_POINT=Area I can't see any way to adjust it to appear like the GUIs output The for loop code I'm using is: lddLrs = [l for l in QgsProject().instance().mapLayers().values() if isinstance(l, QgsRasterLayer)] I'm trying to figure out if there's some else I need to add? Bearing in mind I don't fully understand what I'm doing yet .
@geospatialschool4 жыл бұрын
@@Richard-sk3vh Maybe the statistics aren't being fully calculated. Even though they look different you could still have the same values in the two NDVI rasters. Check that out first. If the values are different then there's a problem with your calculation.
@umamartinez9384 жыл бұрын
Hi there, I got it to work once applied the change suggested below (ras.raster). Question: 1) I want to multiply bands 1-55 of an image by 400 and bands 56 to 242 by 800. Then 2) I want to rescale the Y value to range between 0 and 1. and then 3) I would like to convert the bands numbers to wavelengths, so that in viper tools wavelength and not band numbers show up. What is the simplest way to do this? I am new to python. I tried raster calculator but cannot figure out how to get the batch mode to work. thanks U
@geospatialschool4 жыл бұрын
That's a very detailed question and would take some time to prepare an answer. The basics are all there in this video. You just need to loop through all the bands and perform the desired operation(s).
@umamartinez9384 жыл бұрын
@@geospatialschool thanks I am working through the various videos and will tackle. Great videos!
@eddisonjose5 жыл бұрын
Hola!! puedes dejar aquí los códigos y las imagenes por favor? Gracias!
@geospatialschool5 жыл бұрын
English?
@eddisonjose5 жыл бұрын
@@geospatialschool Hi thanks!! Can you leave here the codes you have made and the data to practice?
@geospatialschool5 жыл бұрын
I will eventually have the code available in a website post. The data can be downloaded online. This video will show you how: kzbin.info/www/bejne/jJ2unHSPpLOiiKc
@CuriousKitchen5 жыл бұрын
Using GUI would have been much faster.
@geospatialschool4 жыл бұрын
For this simple operation, yes. But the point of the video is to show you that raster calculator operations can be automated so if you need to run the same calculation multiple times, or on multiple datasets, you can replicate it easily.
@loganashmore47544 жыл бұрын
I just incorporated this into a PyQgis model for 60 geotiff files which recalculated the rasters and hand the results to a conversion function. Easily a day+ of manual GUI labour sorted in 2 hours.