Skip to contents

Read EXIF data from folder of images.

Usage

read_sf_exif(
  path = NULL,
  filetype = NULL,
  bbox = NULL,
  sort = "lon",
  tags = NULL,
  ...
)

write_exif(
  path = NULL,
  filetype = NULL,
  title = NULL,
  author = NULL,
  date = NULL,
  keywords = NULL,
  args = NULL,
  overwrite = TRUE
)

write_exif_keywords(
  path,
  filetype = NULL,
  key_list,
  key_col = "name",
  keywords = NULL,
  join = NULL,
  overwrite = TRUE
)

Arguments

path

A path to folder of one or more files with EXIF location metadata.

filetype

The file extension or file type; defaults to NULL.

bbox

Optional bounding box to crop returned file (excluding images with location data outside the bounding box). If bbox is provided the returned data will match the crs of the bbox.

sort

Column name for variable to sort by. Currently supports "lon" (default), "lat", or "filename"

tags

Optional list of EXIF tags to read from files. Must include GPS tags to create an sf object.

...

Additional EXIF tags to pass to exiftoolr::exif_read

title

Title to add to file metadata with exiftoolr, Default: NULL.

author

Author to add to file metadata with exiftoolr, Default: NULL.

date

Date to add to file metadata with exiftoolr (not currently working), Default: NULL.

keywords

Keyword(s) added to file metadata with with exiftoolr, Default: NULL.

args

Alternate arguments passed to exiftoolr::exif_call(). If args is not NULL, title, author, date, and keywords are ignored; defaults to NULL.

overwrite

If TRUE, overwrite any existing EXIF metadata present in the provided fields; defaults to TRUE

key_list

List of sf objects with features with keywords, e.g. boundaries

key_col

Column name in key_list with the values to use for keywords.

join

geometry predicate function; defaults to NULL, set to sf::st_intersects if key_list contains only POLYGON or MULTIPOLYGON objects or sf::st_nearest_feature if key_list contains other types.

Writing EXIF metadata

NA

See also

Other read_write: make_filename(), read_sf_ext()

Examples

read_sf_exif(
  path = system.file("extdata/photos", package = "overedge"),
  filetype = "jpeg"
)
#> Simple feature collection with 3 features and 26 fields
#> Attribute-geometry relationship: 26 constant, 0 aggregate, 0 identity
#> Geometry type: POINT
#> Dimension:     XY
#> Bounding box:  xmin: -76.62567 ymin: 39.31007 xmax: -76.60921 ymax: 39.32559
#> Geodetic CRS:  WGS 84
#>                                                                        path
#> 1 /Users/elipousson/Projects/overedge/inst/extdata/photos/sample_img_2.jpeg
#> 2 /Users/elipousson/Projects/overedge/inst/extdata/photos/sample_img_3.jpeg
#> 3 /Users/elipousson/Projects/overedge/inst/extdata/photos/sample_img_1.jpeg
#>                                                                                                                                 title
#> 1                                 Alligators (1987, restored 2006; John Ellsberry, muralist), 600 W. 28th Street, Baltimore, MD 21211
#> 2 Untitled (1969; Stan Edmister, sculptor), Maryland Institute College of Art (MICA), 1501 W. Mount Royal Avenue, Baltimore, MD 21217
#> 3                             Overjoyed/"Welcome to Waverly" mural (2020; Gaia, artist),  3011 Greenmount Avenue, Baltimore, MD 21218
#>                                description
#> 1 Photograph by Eli Pousson, 2021 July 19.
#> 2 Photograph by Eli Pousson, 2021 July 21.
#> 3 Photograph by Eli Pousson, 2021 June 21.
#>                                                                                                                                     keywords
#> 1                                              Maryland, public art, Remington, 28th Street, John Ellsberry, mural, Baltimore, Sisson Street
#> 2 Maryland, public art, sculpture, MICA, Maryland Institute College of Art, Malster Avenue, Baltimore, Bolton Hill, Stan Edmister, modernism
#> 3                                                    Maryland, public art, Greenmount Avenue, Gaia, Waverly, mural, Baltimore, Old York Road
#>           file_name         create_date  date_time_original
#> 1 sample_img_2.jpeg 2021:07:19 18:45:25 2021:07:19 18:45:25
#> 2 sample_img_3.jpeg 2021:07:21 08:31:07 2021:07:21 08:31:07
#> 3 sample_img_1.jpeg 2021:06:21 12:56:42 2021:06:21 12:56:42
#>   offset_time_original img_width img_height    exif_orientation file_size
#> 1               -04:00       320        240 Horizontal (normal)     41864
#> 2               -04:00       320        240 Horizontal (normal)     34723
#> 3               -04:00       320        240 Horizontal (normal)     44797
#>   file_type lat_ref lon_ref altitude_ref speed_ref speed img_direction_ref
#> 1      JPEG       N       W            0         K     0                 T
#> 2      JPEG       N       W            0         K     0                 T
#> 3      JPEG       N       W            0         K     0                 T
#>   img_direction gpsh_positioning_error altitude      lat       lon
#> 1      75.12485                     30     46.6 39.31901 -76.62567
#> 2     158.06190                     10     30.1 39.31007 -76.62284
#> 3     355.56680                     10     69.0 39.32559 -76.60921
#>                             position orientation                   geometry
#> 1 39.3190083333333 -76.6256722222222   landscape POINT (-76.62567 39.31901)
#> 2        39.310075 -76.6228416666667   landscape POINT (-76.62284 39.31007)
#> 3 39.3255916666667 -76.6092083333333   landscape POINT (-76.60921 39.32559)