Summary
Creates points from the x-, y-, and z-coordinates 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 coordinates from JPEG and TIFF photo files and writes these coordinates and associated attributes to an output point feature class.
The output feature class will have these 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
- Direction—The direction the device is pointing when the photo was captured. Values range from 0 to 359.99, where 0 indicates north, 90 east, and so on. If no direction is recorded by the device, this field will have a value of -9999. Depending on the device being used this could refer to degrees from true north or magnetic north. Refer to device documentation for more information.
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 Python), 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
GeoTaggedPhotosToPoints_management (Input_Folder, Output_Feature_Class, {Invalid_Photos_Table}, {Include_Non-GeoTagged_Photos}, {Add_Photos_As_Attachments})
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.
| Boolean |
Code sample
GeoTaggedPhotosToPoints example 1 (Python window)
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")
GeoTaggedPhotosToPoints example 2 (stand-alone script)
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
# Set environment settings
arcpy.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)
Environments
Licensing information
- ArcGIS Desktop Basic: Limited
- ArcGIS Desktop Standard: Yes
- ArcGIS Desktop Advanced: Yes