1

I have merged about 20 OS tiles in to a single raster and I am trying to clip the merged tiles using a single polygon which itself was created from a small number of ward boundaries, merged using the edit - merge selected features. The polygon boundaries fall entirely within the raster.

When I try to use the raster - extraction - clipper command I get the error message "cannot compute bounding box of cutline"

I have seen previous questions on the subject and the answers point to using different projections but I am using the same CRS. Another solution was to reproject to raster but that has now been running for several hours and has still not completed.

I'm thinking that I'm missing something obvious here but can not for the life of me work out what it is. The only thing that came to mind is that the OS tiles come with their own georeference files. By merging them have I lost that. The merged raster appears in the correct position though.

How can I clip the raster to match the wards?

8
  • Can you add the extent of your layers, reported by properties, Metadata tab?
    – AndreJ
    Commented Feb 8, 2015 at 12:53
  • Layer extent of raster 0.0000000000000000,5000.0000000000000000 : 475000.0000000000000000,340000.0000000000000000
    – Geoman
    Commented Feb 8, 2015 at 16:21
  • Layer extent of raster 0.0000000000000000,5000.0000000000000000 : 475000.0000000000000000,340000.0000000000000000. Layer extent of mask xMin,yMin 448890.70,321614.80 : xMax,yMax 471555.60,337182.50. So as I found out when I zoom to layer, the raster extent seem huge. How do I alter this in QGIS? Please excuse my stupidity, whilst I was a GIS postgrad some years ago, that was using ArcGIS and I am new to QGIS.
    – Geoman
    Commented Feb 8, 2015 at 16:29
  • OSGB 1936 /British National Grid
    – Geoman
    Commented Feb 8, 2015 at 17:07
  • Are you working with geotiff and shapefiles, or vrt or any in-memory layers? Does it work if you drag the clipping box manually? Is your vector layer a single polygon? Dissolving the vector layer might help.
    – AndreJ
    Commented Feb 8, 2015 at 18:16

1 Answer 1

2

I suggest to use a vrt to merge the OS tiles, then clip that using the command line utility.

On Windows:

for %%N in (OS-SK\*.tif) DO gdal_translate -of vrt -expand rgba %%N OS-SK\%%~nN.vrt
gdalbuildvrt -allow_projection_difference indexSK.vrt OS-SK\*.vrt
gdalwarp -cutline os-sk-clip.shp -crop_to_cutline indexSK.vrt clipped.tif

The result is 9066x6227 pixels, built in a reasonable amount of time out of the 100 tiles of the 100km tile SK. The 5km StreetView tiles may take a bit longer.

3
  • I have tried the menu option to create the VRT but the clip still gives the same error message.
    – Geoman
    Commented Feb 23, 2015 at 10:03
  • If you build the vrt from just two rasters, it works?
    – AndreJ
    Commented Feb 23, 2015 at 12:05
  • Hi and thanks for all the answers. I just didn't have time to continue trying to resolve the problem so switched to vectormap (vector format) with OS locator to add street names. Much easier to work with in the time I have plus gives me the flexibility to use these layers in spatial queries if the need arises.
    – Geoman
    Commented Mar 9, 2015 at 11:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.