GeoTagged Photos To Points (Data Management)
Summary
Creates points from the x-, y-, and z-coordinate information stored in geotagged photos. Optionally adds photo files to features in the output feature class as geodatabase attachments.
Illustration
Usage
This tool reads the longitude, latitude, and altitude coordinate information from JPEG and TIFF photo files with valid Exif (exchangeable image file format) metadata and writes these coordinates and associated attributes to an output point feature class. These photos are often captured using digital cameras with built-in or accessory GPS units or with smartphones.
-
The output feature class will have three attribute fields:
- Path—The full path to the photo file used to generate the point, for example, C:\data\photos\Pic0001.jpg
- Name—The short name of the photo file, for example, Pic0001.jpg
- DateTime—The original capture date and time of the photo file, for example, 2010:11:21 15:23:34
The output DateTime field is a text field with the timestamp in the format yyyy:MM:dd HH:mm:ss. Use the Convert Time Field tool to convert this text field to a true datetime field that can be used to analyze and map the data with time.
If the output DateTime field has a null or empty value, this may be an indication that your device does not capture a useable timestamp with the geotagged photo. Photo files may have a date taken or date modified property, but these often do not represent the date and time the photo was taken.
If the x,y coordinates of a photo are 0,0, no point will be generated for that photo. These empty coordinates often occur because the camera GPS does not have an adequate signal to capture real coordinates. If the Include Non-GeoTagged Photos parameter is checked (ALL_PHOTOS in scripting), the photo will be added as an output record with a null geometry.
The output feature class will have a GCS_WGS_1984 spatial reference, since that is the coordinate system used by GPS receivers.
Syntax
Parameter | Explanation | Data Type |
Input_Folder |
The folder where photo files are located. This folder is scanned recursively for photo files; any photos in the base level of the folder, as well as in any subfolders, will be added to the output. | Folder |
Output_Feature_Class |
The output point feature class. | Feature Class |
Invalid_Photos_Table (Optional) |
The optional output table that will list any photo files in the input folder with invalid Exif metadata or empty GPS coordinates. If no path is specified, this table will not be created. | Table |
Include_Non-GeoTagged_Photos (Optional) |
Specifies if all photo files should be added as records to the output feature class or only those with valid GPS coordinates.
| Boolean |
Add_Photos_As_Attachments (Optional) |
Specifies if photo files will be added to the output feature class as geodatabase attachments. License: Adding attachments requires at minimum an ArcGIS for Desktop Standard license, and the output feature class must be in a version 10 or higher geodatabase.
| Boolean |
Code Sample
The following Python window snippet demonstrates how to use the GeoTaggedPhotosToPoints tool.
import arcpy
arcpy.GeoTaggedPhotosToPoints_management("c:/data/photos", "c:/data/city.gdb/photo_points", "", "ONLY_GEOTAGGED", "ADD_ATTACHMENTS")
The following script demonstrates how to use the GeoTaggedPhotosToPoints tool.
"""Name: GeoTaggedPhotosToPoints example
Description: Convert a folder of photos to points, then perform a buffer
"""
# Import system modules
import arcpy
from arcpy import env
# Set environment settings
env.workspace = "C:/data"
# Set local variables
inFolder = "photos"
outFeatures = "city.gdb/photos_points"
badPhotosList = "city.gdb/photos_noGPS"
photoOption = "ONLY_GEOTAGGED"
attachmentsOption = "ADD_ATTACHMENTS"
buffers = "city.gdb/photos_points_buffer"
bufferDist = "1 Miles"
arcpy.GeoTaggedPhotosToPoints_management(inFolder, outFeatures, badPhotosList, photoOption, attachmentsOption)
arcpy.Buffer_analaysis(outFeatures, buffers, bufferDist)