位置数据Google相册API

And*_*ltz 12 google-api google-photos google-photos-api

当我通过API查询Google照片中的照片时,它不会返回与图像相关联的任何位置数据.当我在Google相册中查看有关图片的信息时,我可以在地图上看到该位置,但API并未向我提供这些坐标.

[mediaMetadata] => Google_Service_PhotosLibrary_MediaMetadata Object
        (
            [creationTime] => 2018-07-13T13:20:38Z
            [height] => 4032
            [photoType:protected] => Google_Service_PhotosLibrary_Photo
            [photoDataType:protected] => 
            [videoType:protected] => Google_Service_PhotosLibrary_Video
            [videoDataType:protected] => 
            [width] => 3024
            [internal_gapi_mappings:protected] => Array
                (
                )

            [modelData:protected] => Array
                (
                )

            [processed:protected] => Array
                (
                )

            [photo] => Google_Service_PhotosLibrary_Photo Object
                (
                    [apertureFNumber] => 1.8
                    [cameraMake] => Apple
                    [cameraModel] => iPhone 8
                    [exposureTime] => 
                    [focalLength] => 3.99
                    [isoEquivalent] => 50
                    [internal_gapi_mappings:protected] => Array
                        (
                        )

                    [modelData:protected] => Array
                        (
                        )

                    [processed:protected] => Array
                        (
                        )

                )

        )
Run Code Online (Sandbox Code Playgroud)

And*_*ltz 7

即使此类的PHP包装器包含位置字段,但似乎Google API当前未填充此对象.在mediaItems资源的文档中,字段位置指出"尚未可用".

您可以使用Google Drive API获取照片的位置数据.

提出了一个跟踪此功能实现的票证.


Ala*_*405 7

Google似乎无意共享照片位置。

位置字段曾经显示在MediaMetadata字段中,但尚不可用,但是Google Photos API在发布后已被删除,但有关下载图片文档除外,其中指出:“如果要下载保留的图片,除位置元数据外,所有其他EXIF元数据都将基本URL与d参数连接在一起”。