#------------------------------------------------------------------------------ # File: GPS2MapUrl.config # # Description: User-defined Composite tag definitions to create URLs for various # map websites based upon GPS coordinates embedded in the file. # # Place this file in the same directory as exiftool.exe and start the # command with "-config GPS2MapUrl.config" or clip the section for # the desired tag marked by dash lines and place in your .exifTool_config # file under the "'Image::ExifTool::Composite' => {" line to have these # tags available at all times. # # Requires exiftool version earlier than 11.54 or later than 11.57 # # Tag definitions and examples: # # GoogleMapsUrl # This will create a link to Google maps based upon this StackOverflow answer # https://stackoverflow.com/a/32807681/3525475 # Example: # exiftool -config Map_URL_From_GPS.config -GoogleMapsUrl FILE # # BingMapsUrl # This will create a link to Bing maps based upon this page # https://docs.microsoft.com/en-us/bingmaps/articles/create-a-custom-map-url # Example: # exiftool -config Map_URL_From_GPS.config -BingMapsUrl FILE # # OpenStreetMapsUrl # This will create a link to OpenStreetMap.org maps # Example: # exiftool -config Map_URL_From_GPS.config -OpenStreetMapsUrl FILE # # MapquestMapsUrl # This will create a link to Mapquest maps # Example: # exiftool -config Map_URL_From_GPS.config -MapquestMapsUrl FILE # # YandexMapsUrl # This will create a link to Yandex maps # Example: # exiftool -config Map_URL_From_GPS.config -YandexMapsUrl FILE # # User Parameters # Zoom # This user parameter will add the level of zoom for the URL # Example: # exiftool -config Map_URL_From_GPS.config -userparam Zoom=16 -BingMapsUrl FILE # # Notes: Bing Maps doesn't allow for the creation of push pins without an API key # # Revisions: Ver. 1.0 - 2019-02-04 - Bryan K. Williams (aka StarGeek) Created # 1.1 - 2019-07-25 - Changed undef to empty string # 1.2 - 2024-08-03 - Fixed MapQuest URL, note that MapQuest seems to have problems with some # GPS Coordinates. For example, coordinates 40.6892, -74.0445 will not be found in MapQuest # Disabled Zoom in MapQuest as it no longer works # Removed "sp=point" from the Bing URL as it is ignored, Added default level 16 for Bing # because without it Bing's default level of zoom shows to wide of an area # # # References: #------------------------------------------------------------------------------ %Image::ExifTool::UserDefined = ( 'Image::ExifTool::Composite' => { #------------------------------------------------------------------------------ GoogleMapsUrl => { Require => { 0 => 'GPSLatitude', 1 => 'GPSLongitude', }, ValueConv => q{ my $zm = ($self->Options('UserParam')->{'zoom'}) ? "&ll=$val[0],$val[1]&z=".($self->Options('UserParam')->{'zoom'}) : ''; return ("https://www.google.com/maps/search/?q=$val[0],$val[1]$zm"); }, }, #------------------------------------------------------------------------------ BingMapsUrl => { Require => { 0 => 'GPSLatitude', 1 => 'GPSLongitude', }, ValueConv => q{ my $zm = ($self->Options('UserParam')->{'zoom'}) ? '&lvl='.($self->Options('UserParam')->{'zoom'}) : '&lvl=16'; return ("https://bing.com/maps/?cp=$val[0]~$val[1]$zm"); }, }, #------------------------------------------------------------------------------ OpenStreetMapsUrl => { Require => { 0 => 'GPSLatitude', 1 => 'GPSLongitude', }, ValueConv => q{ my $zm = ($self->Options('UserParam')->{'zoom'}) ? '&zoom='.($self->Options('UserParam')->{'zoom'}) : ''; return ("https://www.openstreetmap.org/?mlat=$val[0]&mlon=$val[1]$zm"); }, }, #------------------------------------------------------------------------------ MapquestMapsUrl => { Require => { 0 => 'GPSLatitude', 1 => 'GPSLongitude', }, ValueConv => q{ return ("https://www.mapquest.com/search/$val[0]%20$val[1]"); }, }, #------------------------------------------------------------------------------ YandexMapsUrl => { Require => { 0 => 'GPSLatitude', 1 => 'GPSLongitude', }, ValueConv => q{ my $zm = ($self->Options('UserParam')->{'zoom'}) ? '&z='.($self->Options('UserParam')->{'zoom'}) : ''; return ("https://yandex.com/maps/?ll=$val[1]%2C$val[0]&text=$val[0]%2C$val[1]$zm"); }, }, #------------------------------------------------------------------------------ }, ); 1; #end