retile: retile

Description Usage Arguments Value Examples

View source: R/retile.R

Description

This takes a raster of the class SpatialGridDataFrame and converts it into jpg chips of the specified dimensions and overlap. Band color order can be specified with arguments

Usage

1
2
3
4
retile(imageName, flightName = "ca_hayfork_20160529_rgb", red = 1,
  green = 2, blue = 3, dim = 299, overlap = 60,
  outputFolder = "Chips", outputJPG = TRUE, returnData = FALSE,
  exportChipKey = FALSE)

Arguments

imageName

Name of Tif to be chipped.

flightName

name of flight to be chipped

red

Dimension number for red band

green

Dimension number for green band

blue

Dimension number for blue band

dim

Size of output jpg chip

overlap

number of pixels to overlap the chips

outputFolder

location that new chips are copied

outputJPG

Logical. Export jpg?

returnData

Logical. return jpgs? For future use when chips not saved.

exportChipKey

Logical, export the chipkey csv or not.

Value

Optionally exports a list of images that were created.

Chips jpg files into the outputFolder directory.

chipList csv file listing the filenames and coordinates for the exported jpgs.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
###List of Tiffs to Crop:-----------------------------------------------
files <- list.files("G:/GoogleImagery/Purchase2/Mosaics",recursive=TRUE,pattern="*.tif",full.names = TRUE)
files <- files[grep(pattern = "crescentcity2015",x = files)]

###Crop one tiff:--------------------------------------------
retile(imageName = files[1],dim=299,overlap=60,outputFolder="Chips")

###Crop a list of tiffs:-------------------------------------------
setwd("G:/GoogleImagery/Purchase2")
sapply(files,FUN=retile,outputFolder="Chips",flightName = "ca_crescentcity_20150715_rgb")


## End(Not run)

adamkc/DIMEChelper documentation built on Feb. 1, 2020, 12:24 p.m.