Тёмный

QGIS User 0022 - Custom Tool to load rasters 

Klas Karlsson
Подписаться 34 тыс.
Просмотров 3,5 тыс.
50% 1

Опубликовано:

 

3 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 25   
@GGRS90
@GGRS90 4 года назад
The action tool seems to be very useful when used well. Thank you for sharing a good tutorial. :)
@ucarmustafa
@ucarmustafa 4 года назад
This is very useful thank you! However I wonder something else: How can I find your QGIS wallpaper :) 0:19
@KlasKarlsson
@KlasKarlsson 4 года назад
Link in the description.
@AhmedAzabEgypt
@AhmedAzabEgypt 4 года назад
Great tip! thank you
@leohendrikx7877
@leohendrikx7877 4 года назад
Thanks this is very usefull!
@whowhat8613
@whowhat8613 3 года назад
Thank you. Do you have any reference for how can I lookup data from splunk for my QGIS polygons with unique IDs. For example by using python or some other methods if available, kindly share. Thanks
@tarasdvoretskij2123
@tarasdvoretskij2123 4 года назад
Thank you for your lessons. How to reverse the problem? Split one large file (orthophotoplan) into several smaller tiles.
@KlasKarlsson
@KlasKarlsson 4 года назад
GDAL Retile. There's a tool in QGIS or you can use the commandline. Can be tricky to get all settings right so colors and bit-depth works, but try a smaller sub-set first.
@matthewmontgomery3693
@matthewmontgomery3693 4 года назад
It would be good to add iface.setActiveLayer(...) to the end of the python script to return focus to the index layer so you don't have to reselect it manually after every raster load.
@KlasKarlsson
@KlasKarlsson 4 года назад
Excelent point! You could capture the active layer to a variable first and then use that variable to "reset" it to the active layer: indexlayer = iface.activeLayer() iface.addRasterLayer(rasterurl, "[%location%]") iface.setActiveLayer(indexlayer)
@alechamizo
@alechamizo 4 года назад
Very interesting Klas! Just a dude. It's possible include in the python code "something" to the new rasters layers load below vector index layer? Like this, index vector layer always will be in top of the TOC. Thanks!
@KlasKarlsson
@KlasKarlsson 4 года назад
I'm sure it's possible, but you will need to dive a bit deeper into the QGIS Python API...
@sylvainpoulain5466
@sylvainpoulain5466 4 года назад
@@KlasKarlsson There was a plugin with same functionalities years ago so definitively possible. Unfortunately, could not remeber the name as nowaday building a vrt or single geotiff is faster
@KlasKarlsson
@KlasKarlsson 4 года назад
@@sylvainpoulain5466 In many cases vrt are really fast, but for some cases they are not an option (not even mentioning geotiffs). Trying to make a vrt with thousands (or even hundreds) of hi-res rasters will at best be slow, as will trying to open it. If you have a lot of rasterfiles and you can't put them into a real database, then I've found this method works really well.
@sylvainpoulain5466
@sylvainpoulain5466 4 года назад
@@KlasKarlsson Yes I understand, but the method you have is what I used 13 - 10 years ago in gvSIG and Qgis and that's why I mentionned single big raster files. I prefer compute a whole big raster with proper pyamids than having multiple ones. But I approve your method to do it in PyQgis and better understading how it works ! Plugin I mentionned above : Image Boundary in combination to Show and Hide Image osgeo-org.1560.x6.nabble.com/New-Plugin-Show-Hide-Image-td4100979.html Also in you action, i think you can get name of current layer then at the end of script active this layer in ToC. not tested but I think it could work ! It allows you to not reactivate layer containing tile index @Alejandro Chamizo de Castro : QuickMapServices plugin load layer at the end of ToC. May be getting inspiration from this plugin. Otherwise it's described in documentation : docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/loadlayer.html#qgsproject-instance => # the position is a number starting from 0, with -1 an alias for the end layerTree.insertChildNode(-1, QgsLayerTreeLayer(rlayer)) Edit : method of QMS plugin could be find here => github.com/nextgis/quickmapservices/blob/master/src/qgis_map_helpers.py#L152
@rugbyshorts
@rugbyshorts 4 года назад
Hi Klas, is there a solution yet to export satellite imagery in the print composer? I've done months of work but now I can't export the imagery as it goes blank. Also do you have a patreon account ?
@abhishekbaguldesign
@abhishekbaguldesign 4 года назад
I have a tiff file created from my UAV, anyone has an idea about extracting the features like the buildings? I have classified dense clouds for the features, but it will be great if we could classify it based on the orthomosaic file.
@linayasser1234
@linayasser1234 4 года назад
thank you Klass! can you just please do the same work on windows especially the part when you add the layerpath to your script
@linayasser1234
@linayasser1234 4 года назад
and great job by the way! in addition to that is there anyway to avoid showing labels for example when you want to add polygons of landuse above contours! i want to hide contours labels in that case and show them only when there is no polygons on!
@KlasKarlsson
@KlasKarlsson 4 года назад
Sorry, I don't use Windows. I actually don't even own a Windows computer. I think you can use a OS-agnostic python function to create the correct path that should work even on Windows: rasterurl = os.path.join(layerpath, "[%location%]") Just replace the rasterurl row in the video with this code.
@KlasKarlsson
@KlasKarlsson 4 года назад
@@linayasser1234 Maybe use "blocking" in the label settings for the polygon layer? In upcoming 3.12 there will be more labeling options available.
@linayasser1234
@linayasser1234 4 года назад
@@KlasKarlsson thank you so much! i ll try it
@fowadahmed6174
@fowadahmed6174 4 года назад
May i ask what are the source of these historical areal images from 60's?
@KlasKarlsson
@KlasKarlsson 4 года назад
Swedish National Landsurvey Open Data CC-0 (Public Domain) www.lantmateriet.se/sv/Kartor-och-geografisk-information/oppna-data/
@fowadahmed6174
@fowadahmed6174 4 года назад
@@KlasKarlsson Thank you Much appreciated :)
Далее
QGIS User 0049 - Nicer Layouts
39:45
Просмотров 6 тыс.
QGIS User 0051 -  Open Polygon Style
11:23
Просмотров 2,6 тыс.
Сколько стоит ПП?
00:57
Просмотров 173 тыс.
🛑самое главное в жизни!
00:11
Просмотров 256 тыс.
QGIS User 0035 - Halftone style
31:44
Просмотров 2,9 тыс.
QGIS User 0039 - Landsat 9
18:06
Просмотров 24 тыс.
QGIS User 0050 - Charts and Diagrams
44:08
Просмотров 3,7 тыс.
QGIS User 0041 - BackEnd (WebODM)
38:45
Просмотров 6 тыс.
QGIS User 0042 - BackendService PostGIS
29:27
Просмотров 3,9 тыс.
QGIS User 0036 - QGIS and Blender
34:07
Просмотров 102 тыс.
QGIS User 0044 - QGIS files
26:32
Просмотров 5 тыс.
What Japan Did on the Moon Is Game-Changing
15:09
Просмотров 602 тыс.
QGIS User 0038 - Normalizing data in QGIS
19:13
Просмотров 6 тыс.
Сколько стоит ПП?
00:57
Просмотров 173 тыс.