10 messages in com.googlegroups.google-picasa-data-apiRe: .NET Client: Set geo location for...| From | Sent On | Attachments |
|---|---|---|
| Bas | 25 Nov 2007 13:30 | |
| Frank Mantek | 25 Nov 2007 23:36 | |
| Bas | 26 Nov 2007 01:00 | |
| Frank Mantek | 26 Nov 2007 01:25 | |
| Bas | 26 Nov 2007 02:26 | |
| Bas | 26 Nov 2007 02:55 | |
| Frank Mantek | 26 Nov 2007 03:30 | |
| Bas | 26 Nov 2007 03:37 | |
| Frank Mantek | 26 Nov 2007 05:25 | |
| john...@gmail.com | 04 Dec 2007 08:11 |
| Subject: | Re: .NET Client: Set geo location for PhotoEntry![]() |
|---|---|
| From: | Frank Mantek (fman...@gmail.com) |
| Date: | 11/25/2007 11:36:16 PM |
| List: | com.googlegroups.google-picasa-data-api |
I am not sure i understand....
I assume you are inserting a new entry into picasa, using PicasaService.Insert. The returned entry should be castable to a read/ write picasaentry like it is done in phototest.cs (also, i did update the photobrowser sourcecode to edit geo location information, if you like to take a look there):
PicasaFeed feed = service.Query(query); if (feed != null) { PicasaEntry album = feed.Entries[0] as PicasaEntry; Uri postUri = new Uri(album.FeedUri.ToString()); FileStream fs = File.OpenRead("testnet.jpg"); PicasaEntry entry = service.Insert(postUri, fs, "image/jpeg", "testnet.jpg") as PicasaEntry;
entry.Title.Text = "This is a new Title"; entry.Summary.Text = "A lovely shot in the shade"; PicasaEntry updatedEntry = entry.Update() as PicasaEntry; }
If you are, indeed, creating a picasaentry from scratch per the object model, and then try to use the photoentry.update method, that will most likely fail, as you would have to set the photoentry.edituri property correctly. An entry determines if it is read/write by checking if it has a URI that it can use to update.
Does this make sense?
Frank Mantek Google On Nov 25, 2007, at 10:30 PM, Bas wrote:
I'm having a problem setting the geo location for a picasa PhotoEntry object. The problem is that the PhotoEntry is ReadOnly. It is ReadOnly, because I create the object from an AtomEntry object which is returned by the PicasaService.Insert and PicasaService.Get functions.
As it is not possible to cast the returned AtomEntry to a PhotoEntry, I create a new PhotoEntry object and assign the properties I will use later. As the Location property is introduced first for the PicasaEntry object and is inherited by the PhotoEntry, I have to set it at the PhotoEntry object. The problem is, it can not be updated with the PicasaService.Update function, it throws an error because the object is ReadOnly. The PhotoEntry.Update() function does not throw an error, but does not seem to update the Location (latitude, longitude) values.
What can I do to set/update the Location property on a PhotoEntry object?




