[Qgis-user] merging parts from various raster files

sibylle.stoeckli at gmx.ch sibylle.stoeckli at gmx.ch
Tue Apr 30 11:04:12 PDT 2024


Dear Richard

Dear Frank

 

Thanks a lot for your help. Really great tool I learned.

 

Selection of one biogeoregion in the attribute table of the biogeoregion
shape file.

Selection of the raster file modelled with the input data for this
biogeoregion. Reminder, my ecosystem service model is just able to provide
output for the entire country, but each biogeoregion should be modelled with
it’s respective input data. In this way, from the model with the input data
form biogeoregion 1 I just need the output from biogeoregion 1 etc.

 

*	Raster-extraction-extract raster to layer mask

*	Mask layer: selected features only.

 

Output: for each rasterfile I got the necessary biogeregion and the other
biogeoregions are cut

 

I just need to merge the rasterfiles at the end.

 

Kind regards

Sibylle

 

 

*	 

 



 

 

 

From: Richard McDonnell <richard.mcdonnell at opw.ie> 
Sent: Tuesday, April 30, 2024 3:46 PM
To: sibylle.stoeckli at gmx.ch; 'Frank Broniewski' <broniewski at a-a.lu>
Cc: qgis-user at lists.osgeo.org
Subject: RE: [Qgis-user] merging parts from various raster files

 

Hi Sibylle,

To extract the Bioregions, I suggest you utilise the option Selected
features only which is a tick box below, where you select Mask layer. All
you need to do is select, on the map canvas, the bioregion you want to
extract.

 

QGIS is capable of loading Tiff’s I use them exclusively in any Raster work
I do. The virtual raster <https://gdal.org/drivers/raster/vrt.html>  is just
an easy way for you to merge/mosaic the raster’s (10-12 Raster’s) together
into a single raster.

Kind Regards,

 

Richard

 

 

 



——
Richard McDonnell MSc GIS, FME Certified Professional
Flood Risk Management - 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/richard.mcdonnell@opw.ie

Email Disclaimer:
https://www.gov.ie/en/organisation-information/439daf-email-disclaimer/ 

From: QGIS-User <qgis-user-bounces at lists.osgeo.org
<mailto:qgis-user-bounces at lists.osgeo.org> > On Behalf Of Sibylle Stöckli
via QGIS-User
Sent: 30 April 2024 14:10
To: 'Frank Broniewski' <broniewski at a-a.lu <mailto:broniewski at a-a.lu> >;
qgis-user at lists.osgeo.org <mailto:qgis-user at lists.osgeo.org> ;
broniewski at a-a.lu <mailto:broniewski at a-a.lu> 
Subject: Re: [Qgis-user] merging parts from various raster files

 

Hello Frank and Richard

,


I have 10-12 raster files (figure 1, .tif files), they all look the same and
cover the entire country with no definition of the biogeregions.

Second there is the shape file defining the biogeoregions (figure 2,
different colors).

 

*	Probably I first need to extract the different biogeoregions out
from each raster file or define the linkage between the raster files the the
biogeoregions in the shape file. However, raster – crop raster based on
layer mask extracts the entire mask (entire country) not the different
biogeoregions.
*	Furter I may delete all the data in the raster files not needed:
e.g. in raster 1  just data on biogeo 1, but not the other biogeoregions, in
raster 2, data on biogeo 2, but not the other biogeregions. By doing so
there will be no overlap, as each raster file consists only one biogregions.
*	I am not sure about the virtual raster, because it is not possible
to import .tif files.
*	Then I may just use the “merge” function – merging each bioregions.

 

Background: postprocessing of a model output. It was not possible to run the
model only for biogeoregion 1 (with input data from biogeoregion 1) ,
bioregion 2 (with input data from bioregion 2) etc. It was necessary to
model the entire country with input data from bioregion 1 etc.

 

Kind regards

Sibylle

 

 

Figure 1



Figure 2



From: Frank Broniewski <broniewski at a-a.lu <mailto:broniewski at a-a.lu> > 
Sent: Tuesday, April 30, 2024 1:48 PM
To: qgis-user at lists.osgeo.org <mailto:qgis-user at lists.osgeo.org> ;
sibylle.stoeckli at gmx.ch <mailto:sibylle.stoeckli at gmx.ch> 
Subject: AW: [Qgis-user] merging parts from various raster files

 

Hello Sybille,

 

I am not sure if I understand your problem correctly. I assume, you have a
mosaic of raster files (that overlap) and you want to create a single raster
file for statistical analysis. In my opinion, the easiest way to achieve
that is to create a virtual raster (VRT) and either use that for stats or
create a new raster file from the VRT. You can find the tool in the
processing toolbox. With the tool you can even define the resolution, if
mixed, and how the VRT should be resampled.

 

HTH

Frank

 

https://docs.qgis.org/3.34/en/docs/user_manual/processing_algs/gdal/rastermi
scellaneous.html#build-virtual-raster

  _____  

Von: QGIS-User <qgis-user-bounces at lists.osgeo.org
<mailto:qgis-user-bounces at lists.osgeo.org> > im Auftrag von Sibylle Stöckli
via QGIS-User <qgis-user at lists.osgeo.org <mailto:qgis-user at lists.osgeo.org>
>
Gesendet: Dienstag, 30. April 2024 11:34
An: qgis-user at lists.osgeo.org <mailto:qgis-user at lists.osgeo.org>
<qgis-user at lists.osgeo.org <mailto:qgis-user at lists.osgeo.org> >
Betreff: [Qgis-user] merging parts from various raster files 

 

Dear community

I am working with QGIS 3.34 (Prizren) and would like to merge region 1 from
raster (.tif) file 1 and region 2 from raster file 2, and...
For sure I will need to use raster-miscellaneous-merge.

My question is related to the pre-processing of the input raster files.
- The 12 raster files all have the same coordinate system.
- The raster files are fully overlapping (the entire country).
- The region is not defined per se in the raster file, but in an additional
shape file (biogeo.shp).
- For sure I can carry out some zonal statistics using raster and shape
file, but to merge the regions I need all the pixels form a regions as input
file for the merging process. This process is more than just selecting
regions or cropping. Do you have any suggestions?

Kind regards
Sibylle

_______________________________________________
QGIS-User mailing list
QGIS-User at lists.osgeo.org <mailto:QGIS-User at lists.osgeo.org> 
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20240430/ef70b011/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 15423 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20240430/ef70b011/attachment-0002.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.jpg
Type: image/jpeg
Size: 21952 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20240430/ef70b011/attachment-0003.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 246811 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20240430/ef70b011/attachment-0001.png>


More information about the QGIS-User mailing list