Geo Tagging Photo

Topics: Developer Forum, User Forum
Aug 5, 2011 at 7:11 PM

Is there any way I could achieve geo tagging (WP7 app) of photos using FilckrNet API or some other helper API  .so that I can provide the location where the picture was taken. If there is an option please provide some sample code. 

Coordinator
Aug 7, 2011 at 5:29 PM

If you turn on adding location data to mobile photos then you shouldn't have to do anything.

http://www.microsoft.com/windowsphone/en-us/howto/wp7/pictures/add-location-info-to-my-pictures.aspx

If that is turned on then just upload the photo straight to Flickr and it recognises the location automatically.

If the user has that turned off then you could set the location after the photo is uploaded using PhotosGeoSetLocation().

Sam

Aug 10, 2011 at 8:49 PM

can you please tell me how to use  PhotosGeoSetLocation(). function and also how to get the latitude and longitude settings which can be passed to the function ... sample code would be really helpful

Coordinator
Aug 10, 2011 at 9:21 PM

There is plenty of sample code available already for that - try here: http://create.msdn.com/en-US/education/basics/location_mapping

And at a minimum PhotosGeoSetLocation only takes three variables, so there really isn't much to tell.  http://www.flickr.com/services/api/flickr.photos.geo.setLocation.html

Sam

Aug 11, 2011 at 11:19 AM

Hi Sam,

I have turned on the settings to display the location in my windows phone .

http://www.microsoft.com/windowsphone/en-us/howto/wp7/pictures/add-location-info-to-my-pictures.aspx

 

still i could not see the location info getting added to the pictures I  upload to filckr . 

 

I m using the following function to upload pictures to flickr 

=========================================================================================================================================================================================

                        app.Flickr.UploadPictureAsync(stream, AppSettings.ImageFilename, imageName.Text, imageDesc.Text, imageTags.Text, IsPublicChecked, IsFamilyChecked, IsFriendsChecked, ContentType.Photo, SafetyLevel.None, HiddenFromSearch.None, r =>
                        {
                            Dispatcher.BeginInvoke(() =>
                            {
                                if (r.HasError)
                                {
                                    MessageBox.Show(r.Error.Message);
                                }
                                else
                                {
                                    UploadProgressBar.Visibility = System.Windows.Visibility.Collapsed;
                                    MessageBox.Show("Uploaded Sucessfully");
                                    NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
                                }
                            });
                        });

 

======================================================================================================================================================================

 

any ideas how to check whether the location information is getting added to photos or not ? 

Coordinator
Aug 15, 2011 at 10:23 AM

I've just tried it on my own device and it works fine for me.

Are you modifying the image in memory at all? If you resize or create a new image from the one passed in by the PhotoTaskChooser (or from the Extras functionality) then the location information (which is stored in the EXIF data) would be lost.

Sam

Aug 15, 2011 at 6:42 PM

thanks for the reply sam is it some how possible to check whether the image contains the EXIF data or not ?

Coordinator
Aug 16, 2011 at 9:34 AM

I think I used a library called ExifLib. It might require some modifications to work in Windows Phone 7, I'm not sure.

I don't know what the GPS data EXIF data is called however, you'd have to experiment yourself.

Might it be possible you are taking the photo in a location where GPS is not available?

Sam