Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

GPS support
Vipermania
#1 Posted : Monday, 28 April 2008 6:39:03 PM(UTC)
Rank: Newbie

Joined: 9/01/2008(UTC)
Posts: 6
Location: Belgium

Hi Martin,

I have a feature request, although I can imagine it's not so important to the most of us.
(I did do a search in the forum to see if this request was already made but couldn't find anything)

Most new digital cameras have the ability to hook up a GPS so that the coordinates are recorded into the header of the picture.

Your software has already the ability to read the EXIF data from a picture. Will it also already extract these GPS coordinates ? or does extra code need to be added ?
A bonus would be to have a button near the coordinates that allows you to go directly to (for example) google maps and show where the picture was taken.

Thanks in advance !

Vipermania
Roger Martin
#2 Posted : Monday, 28 April 2008 11:31:42 PM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,300
Location: Fort Atkinson, WI

GPS coordinates aren't currently extracted, but I can see how that would be cool. If you (or someone else) could send me one of these photos with embedded GPS, I can use that as starting point for getting it working. Send it to roger*at*techinfosystems*dot*com.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
Vipermania
#3 Posted : Tuesday, 29 April 2008 9:52:00 PM(UTC)
Rank: Newbie

Joined: 9/01/2008(UTC)
Posts: 6
Location: Belgium

I've just send you an email with a picture with embedded GPS tags.

Hopefully you can work something out !

thanks !
Roger Martin
#4 Posted : Thursday, 1 May 2008 2:45:11 AM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,300
Location: Fort Atkinson, WI

Yep, I received it - thanks. I added it to the official feature request log, but it will unlikely be included in a release this year. However, if someone volunteers to add the feature to the source code, I will try to get it in the next release.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
Vipermania
#5 Posted : Thursday, 1 May 2008 6:42:38 PM(UTC)
Rank: Newbie

Joined: 9/01/2008(UTC)
Posts: 6
Location: Belgium

I'm more than happy to look into it myself (although i'm not a great programmer).

Is there any chance you can point me into the right direction ? What files need to be modified ?
Roger Martin
#6 Posted : Friday, 2 May 2008 2:28:04 AM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,300
Location: Fort Atkinson, WI

OK, I glanced at the source and did a quick test with your image file. I think it won't be too hard. Here's what you need to know:

The metadata extraction is done in the file/class MediaObjectMetaDataExtractor.cs in the project TIS.GSP.Business. Metadata are extracted when an object is first added to the gallery and when a synchronization is performed when the "Re-import metadata" option is selected. Metadata are extracted in two basic steps:

1. Raw metadata are extracted from the image and stored in an internal dictionary named _rawMetadata.

2. A small subset of the raw metadata is extracted and formatted into user-friendly phrases, such as "3008 px" for width. This subset is returned by the GetGalleryObjectMetadataItemCollection method and assigned to a property on the Image class, where it is ultimately stored in the gs_MediaObjectMetadata table in the database.

I confirmed that GPS data is being extracted in the first step, so all you have to do is format the raw data into a user-friendly format. The dictionary where the raw data is stored (_rawMetadata) is keyed by the enum RawMetadataItemName. Notice this enum has over a dozen items beginning with 'GPS', with probably the most important being GpsLatitude and GpsLongitude.

What you need to do is add code to the function AddExifMetadata to pull out the raw GPS data from _rawMetadata, format it, and add it to IGalleryObjectMetadataItemCollection parameter passed into the function. This will involve adding at least one item to an enumeration named FormattedMetadataItemName - I suggest GpsLatitude and GpsLongitude but if you think something else is more appropriate go for it.

Once you add the formatted value to the collection, you are done. It should automatically be persisted to the database and displayed in the metadata window. In fact, it probably took me as long to write this as it would have to have actually done it, but this post can serve as general instructions for anyone wishing to modify the metadata extraction.

Note: In addition to pulling data directly from the Exif data using the .NET 2.0 technique, if .NET 3.0 or 3.5 is installed, the MediaObjectMetaDataExtractor class gives priority to any metadata discovered via the new WPF classes. This happens in the function AddWpfBitmapMetadata. However, for GPS purposes you can ignore this as the new WPF classes don't extract GPS data anyway.

Hope this helps,
Roger Martin
Creator and Lead Developer of Gallery Server Pro
rkalantari
#7 Posted : Wednesday, 23 July 2008 6:39:32 AM(UTC)
Rank: Newbie

Joined: 23/07/2008(UTC)
Posts: 2
Location: New York

Hi there, just found your gallery a few days ago...I was looking for a nice .net gallery with source code available and after looking around for nGallery to realize it had been discontinued and rolled into CS I found your gallery!

I love it, 1 thing I was looking for was GPS data so I can display photos on a map...I noticed you had quite a bit of the legwork done to extract the data and then I found this post. I have finished off the work to import longitude and latitude, I have linked to the files that I modified for this. I figure you can diff them against your source files, if you need the exact changes made please email me.

Thx for this great product!

TIS.GSP.Business:
fraction.cs
MediaObjectMetadataExtractor.cs
Resources.Designer.cs
Resources.resx

TIS.GSP.Business.Interfaces
MetadataEnums.cs

Hope you can use this!
Roger Martin
#8 Posted : Friday, 25 July 2008 1:00:06 AM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,300
Location: Fort Atkinson, WI

Thanks for your work. I will take a look at this and possibly incorporate it into the 2.1 release next month.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
Rss Feed  Atom Feed
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.