HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

gdalwarp — Image reprojection and warping utility. More information: <https://gdal.org/en/stable/programs/gdalw

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandandcliimageutilitygdalwarpwarpingreprojection

Problem

How to use the gdalwarp command: Image reprojection and warping utility. More information: <https://gdal.org/en/stable/programs/gdalwarp.html>.

Solution

gdalwarp — Image reprojection and warping utility. More information: <https://gdal.org/en/stable/programs/gdalwarp.html>.

Reproject a raster dataset:
gdalwarp -t_srs {{EPSG:4326}} {{path/to/input.tif}} {{path/to/output.tif}}


Crop a raster dataset by using specific coordinates:
gdalwarp -te {{min_x}} {{min_y}} {{max_x}} {{max_y}} -te_srs {{EPSG:4326}} {{path/to/input.tif}} {{path/to/output.tif}}


Crop a raster dataset using a vector layer:
gdalwarp -cutline {{path/to/area_to_cut.geojson}} -crop_to_cutline {{path/to/input.tif}} {{path/to/output.tif}}

Code Snippets

Reproject a raster dataset

gdalwarp -t_srs {{EPSG:4326}} {{path/to/input.tif}} {{path/to/output.tif}}

Crop a raster dataset by using specific coordinates

gdalwarp -te {{min_x}} {{min_y}} {{max_x}} {{max_y}} -te_srs {{EPSG:4326}} {{path/to/input.tif}} {{path/to/output.tif}}

Crop a raster dataset using a vector layer

gdalwarp -cutline {{path/to/area_to_cut.geojson}} -crop_to_cutline {{path/to/input.tif}} {{path/to/output.tif}}

Context

tldr-pages: common/gdalwarp

Revisions (0)

No revisions yet.