Location Data Google Photos API
Asked Answered
B

4

25

When I query a photo in Google photos via the API, it doesn't return any location data that is associated with the image. I can see the location on the map when I view the information about the image in Google Photos, however the API doesn't give me these coordinates.

[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
                        (
                        )

                )

        )
Brotherson answered 14/7, 2018 at 8:26 Comment(0)
S
18

It appears that Google has no intention of sharing photos location via the Photos API.

You can do that with Google Drive API if it suits you, here is an article on how to get EXIF.

For reference, rhe location field used to appear in the MediaMetadata fields as "Not yet available", but any reference in the Google Photos API, after release, was removed except for the docs about downloading an image, where it's stated: "If you want to download the image retaining all the EXIF metadata except the location metadata, concatenate the base URL with the d parameter".

There is a ticket for this, with nearly 500 upvotes, add your own if you're the very hopeful kind of person. 😏

Sharpeyed answered 12/10, 2018 at 8:41 Comment(1)
How do you get a gdrive FileId for a gphotos PhotoId?Rhotacism
B
9

Even though the PHP wrapper for this class includes the location fields it appears that the Google API is not currently populating this object. In the documentation for the mediaItems resource the field location states "Not yet available".

You can use the Google Drive API to get the location data though of a photo.

There is a ticket raised to track this feature implementation.

Brotherson answered 15/7, 2018 at 3:30 Comment(0)
T
1

I agree that it looks like Google don't want to provide this.

You can star this bug in their tracker to upvote the issue https://issuetracker.google.com/issues/80379228 but it has not yet got any response from Google.

Timms answered 5/3, 2019 at 0:9 Comment(0)
T
1

I solved that by using Google Drive sync. See my Android Application: https://play.google.com/store/apps/details?id=com.levionsoftware.photo_map_for_google_photos

My App has been approved and works very well, but it's annoying that they don't open the door. In many cases it wouldn't work as I did. And at the end it's only a workaround... EDIT: Some are having problems with that, because not all photos are synced to Google Drive...

Taperecord answered 16/3, 2019 at 12:48 Comment(2)
Denny, your link is no longer workingException
@Exception I found it play.google.com/store/apps/…Privative

© 2022 - 2024 — McMap. All rights reserved.