[Qgis-user] Cutting Virtual raster into tiles

Bernie Connors bernie.connors at unb.ca
Fri Nov 1 15:38:40 PDT 2024


Hello,

        I have created a virtual raster of DEM data covering approximately
72,000 km^2.  The DEM has a 1 metre pixel.  The source for the virtual
raster is about 95 geoTIFF files with irregular shapes.  I have a SHP file
with a 10 km grid of tiles, with a total of 853 polygons (see image
below).  I am trying to cut the virtual raster into 853 tiles based on the
SHP file.  Each tile will be 10 km x 10 km.  The tiles in the SHP file are
exactly 10,000 metres x 10,000 metres.  So I expect the DEM tiles to be
exactly 10,000 pixels x 10,000 pixels.  However, when I run the QGIS Easy
Raster Splitter plugin the output geoTIFF DEM tiles are 9,999 pixels x
10,000 pixels.  I have checked all 853 tiles and they are all 9,999 x
10,000 pixels.  Here are the first few lines reported by gdalinfo.

*Driver: GTiff/GeoTIFF*
*Files: nb_2015_16_18_dem_2460000_7480000.tif*
*Size is 9999, 10000*
*Coordinate System is:*


        Here is an image of the 1 metre gap between the 10 km tiles.  I set
the scale in QGIS to 1:1,000 for this image.

[image: image.png]

        These 1 pixel (1 metre) gaps appear as vertical gaps with a 10 km
spacing when several tiles are displayed together.

        Both the SHP file and the source DEM GeoTIFFs all use the same
projected coordinate system - EPSG 2953.  The  Easy Raster Splitter plugin
uses gdalwarp in the background.  I suspect gdalwarp is doing some kind of
reprojection when it calculates the intersection between the individual
tiles in the SHP and the source VRT.  But I am unsure.  Does anybody have a
suggestion?
[image: image.png]
Thanks,
Bernie.
-- 
Bernie Connors, P.Eng
B.Sc Geodesy & Geomatics Engineering
Fredericton, NB
bernie.connors at unb.ca
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20241101/485c8f62/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 350300 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20241101/485c8f62/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 2228 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20241101/485c8f62/attachment-0003.png>


More information about the QGIS-User mailing list