Learn R Programming

landsat (version 1.1.2)

lssub: Subset a geotiff image.

Description

Uses GDAL tools to reproject (optional) and subset a geotiff given the center point and the desired size.

Usage

lssub(filename, outname, centerx, centery, centerepsg, widthx, widthy)

Value

The new image is exported as a geotiff. Nothing is returned within R.

Arguments

filename

Filename (and path) to a geotiff image.

outname

Filename (and path) for subset image.

centerx

x coordinate of new center point.

centery

y coordinate of new center point.

centerepsg

Projection of the center point coordinates as 5-digit EPSG code. If missing, assume that point and geotiff have the same projection.

widthx

Desired width of subset image.

widthy

Desired height of subset image.

Author

Sarah Goslee

Details

The new image will be a subset of size (widthx, widthy) with center point (centerx, centery), with the same pixel size. If the center point coordinates are in a different projection than the original image, they will be reprojected.

Examples

Run this code
	if (FALSE) lssub("/data/gis/testimage.tif", "/data/gis/subimage.tif", centerx = 260485, 
	centery = 4527220, centerepsg = 26918, widthx = 50, widthy = 50)

Run the code above in your browser using DataLab