Hi Grant,
Do you mean insert a GeoTIFF in?
If that's the case, then you want the following Action..
Type: Python
Description: Add Raster to Canvas or whatever you want
Action Text:
qgis.utils.iface.addRasterLayer('[%filepath%][%filename%]','[%filename%]')
For the above to work, you will need two attributes in your Polygon, a
"filepath" and a "filename" attribute. In the fileparh is the Path to the
folder containing the GeoTiff and the filename is the name of the file you are
looking to load... so something like this...
[cid:[email protected]]
This should then load any GeoTIFF into your Canvas.
Kind Regards,
Richard
--
Richard McDonnell MSc GIS, FME Certified Professional
FRM Data Management
--
Oifig na nOibreacha Poibl?
Office of Public Works
Sr?id Jonathan Swift, Baile ?tha Troim, Co na M?, C15 NX36
Jonathan Swift Street, Trim, Co Meath, C15 NX36
--
M +353 87 688 5964 T +353 46 942 2409
https://gov.ie/opw
--
To send me files larger than 30MB, please use the link below
https://filetransfer.opw.ie/filedrop/[email protected]
Email Disclaimer:
https://www.gov.ie/en/organisation-information/439daf-email-disclaimer/
--
MSc GIS, FME Certified Professional
--
Oifig na nOibreacha Poibl?
Office of Public Works
Sr?id Jonathan Swift, Baile ?tha Troim, Co na M?, C15 NX36
Jonathan Swift Street, Trim, Co Meath, C15 NX36
--
M +353 87 688 5964 T +353 46 942 2409
https://https://gov.ie/opw<https://www.opw.ie>
--
Email Disclaimer:
https://www.gov.ie/en/organisation-information/439daf-email-disclaimer/<https://www.opw.ie/en/disclaimer/>
From: QGIS-User <[email protected]> On Behalf Of Grant Boxer
via QGIS-User
Sent: 19 May 2023 09:47
To: [email protected]
Subject: [Qgis-user] Click to open layer
I am sure there is a simple way to do this but I would like to click on a
polygon and get it to open a tiff file into my map canvas. Do I use an Action
and an "open" command?
Regards Grant Boxer
_______________________________________________
QGIS-User mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user