format_image: Download formated iNaturalist images

Description Usage Arguments See Also Examples

View source: R/format_image.R

Description

Download iNaturalist images for a recod and format them with metadata

Usage

1
format_image(imginfo, img_no = 1, size = "medium", img_format = NULL)

Arguments

imginfo

iNaturalist id of the record

img_no

image number for the image for the iNaturalist record

size

mage size. Values accepted are "small", "medium", "large", "original". Deafault(medium).

img_format

image formating parameters in the form of list. Each item of the list is a component to be added on the image. currently Border and Annotations are available. For Border the componants of the list are

  • keyword - "border"

  • color - color name

  • border dimentions - horizontal x verticle border in pixels.

For Annotations the componants of the list are

  • keyword - "annonate"

  • text - see bellow list of text components

  • font - Font to use. Specify NA for sans'

  • font style - Font style to use. Specify "italic" to italicize else NA'

  • color - color name

  • font size - Font size in pixel

  • placement - "southeast", "southwest", "northeast", "northwest"

Text annotation componants available from the iNaturalist records are as follows

  • obs_id : Observation id by iNaturalist

  • photoby : Name of photographer

  • scname : Scientific name

  • canem : Common name

  • photodate : Date of record

  • place : Location

See Also

Other image functions: downlaod_inat_images()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Not run: 
font <- "Times"
fontsize <- 18
fontstyle <- NA
fontcolor <- "white"
myfmt <- NULL
myfmt[[1]] <- c("border","black","20x50")
myfmt[[2]] <- c("border","grey", "2x2")
myfmt[[3]] <- c("annotate",c('"\u00A9"', 'photoby','"   "'),font,fontstyle,
                fontcolor, fontsize,"southeast")
myfmt[[4]] <- c("annotate",c('" "','scname'),font,"italic",
                fontcolor,fontsize,"northwest")
myfmt[[5]] <- c("annotate",c('"\\n "', 'cname'),font,fontstyle,
                fontcolor, fontsize,"northwest")
myfmt[[6]] <- c("annotate",c('" "','place','"\\n "', 'photodate'),font,fontstyle,
                fontcolor, fontsize,"southwest")
myfmt[[7]] <- c("annotate",c('"iNat Id \\n "','obs_id','" "'),font,fontstyle,
                fontcolor, fontsize,"northeast")
format_image(imginfo,img_no,size="medium",img_format=myfmt)

## End(Not run)

vijaybarve/iNaturalist documentation built on Oct. 20, 2020, 12:04 p.m.