Geoscience Reference
In-Depth Information
(a)
North sea
Flanders
Brussels
(b)
Forest map
forest
no forest
North sea
Flanders
Brussels
0
25
50 km
Fig. 8.7
Clip image using
gdalwarp
.
a
Forest map,
b
Forest map clipped for Flanders
In the following example we clip two administrative regions from the European
forest map 2006. Regions in Europe have been identified by the European Union as
NUTS (nomenclature of territorial units for statistics) codes. The vector Shapefile
NUTSV9_LEAC.shp
contains these NUTS codes, fromwhich we select the regions
Brussels (identified as code BE1) and Flanders (identified as code BE2). We can use
the
-cwhere
option for the selection. The attribute of interest that contains the
NUTS identifiers is
N1CD
. The two tiles needed to cover the entire Flanders region
have been downloaded (see also Appendix A.2.4). These files must be provided as
input to the
gdalwarp
utility. The result for clipping Flanders is shown in Fig.
8.7
.
gdalwarp -cutline NUTSV9_LEAC.shp -cl NUTSV9_LEAC
ₒ
-crop_to_cutline -cwhere"N1CD='BE1'"
ₒ
CM-FTYP_2006_3500035000.tif CM-FTYP_2006_4500035000.tif
ₒ
brussels.tif -dstnodata 255
gdalwarp -cutline NUTSV9_LEAC.shp -cl NUTSV9_LEAC
ₒ
-crop_to_cutline -cwhere "N1CD='BE2'"-dstnodata 255
ₒ
CM-FTYP_2006_3500035000.tif CM-FTYP_2006_4500035000.tif
ₒ
flanders.tif
Search WWH ::
Custom Search