Project

General

Profile

Weather data

Added by Alessio Sangalli over 10 years ago

Hi, I run the website:

http://escursionisticivatesi.it/webcam/

We have four cameras at the top of a mountain, the view is great is it's not cloudy ;)

My program controls the cameras and captures images. I would like to save GPS coordinates and weather data inside the image:
temperature, humidity, pressure, wind direction and speed.

How do you suggest to proceed? I know Exif can contain GPS data but I am not sure about weather. My program is written in C++ but I think I will be able to inter operate with a C++ library.

Thanks!
as


Replies (6)

RE: Weather data - Added by Robin Mills over 10 years ago

For sure the exif specification deals with GPS data. I personally add GPS information to photos using the exiv2 library. I access exiv2 from Python using the pyexiv2 wrapper. I've written an article about this: http://clanmills.com/articles/gpsexiftags/ It is of course possible to do this in C++.

The GPS tags http://www.exif.org/Exif2-2.PDF (p46) allow you to record not only position and altitude, but also direction, bearing and even speed! However I don't see any tags in the exif specification concerning weather.

You could encode your data (as XML or JSON or any ascii format) in a user comment (ImageDescription p22). Another possibility is to use a user comment to store a URL from which weather data can be obtained. For that matter, the Exif.Photo.DateTimeOriginal and could be used to fetch the weather information from a webservice or database.

The good news is that the exiv2 library can add the GPS (and other exif metadata) to your images. However it's not clear that the current version of the exif standard provides tags for atmospheric/weather conditions.

RE: Weather data - Added by Alessio Sangalli over 10 years ago

OK thanks. As the system will need to access the weather data also when it's offline, I would prefer to store such data inside the picture, maybe using the user comment as you mentioned. I will try to look for an example. JSON format is OK.

RE: Weather data - Added by Andreas Huggel over 10 years ago

Have you considered storing the data as XMP metadata (instead of Exif) within the image?
That has the advantage that you could add your own fields if you don't find any existing XMP properties that fit.

Andreas

RE: Weather data - Added by Alessio Sangalli over 10 years ago

Well I have to say I am not familiar with "XMP metadata". If it works for my application - good! That is basically the reason why I wrote on this forum, to get advice on how to do.

What is important to me is that I would be able to extract such data at a later time by a command line utility (I have a script that creates videos like: http://www.youtube.com/watch?v=x8JhuS22spc and I would like to put weather data on top of it while I encode it) and, possibly, by PHP, that I use on the website to publish the real-time status...

RE: Weather data - Added by Alessio Sangalli over 10 years ago

By the way, according to what I've found there are:
EXIF
IPTC
XMP

Exif seems to be limited in the fields; but why should I choose XMP over IPTC to store weather data? Are these complementary systems or what?

RE: Weather data - Added by Robin Mills over 10 years ago

I think Exif and XMP are rather different.

The focus of XMP (owned and invented by Adobe) is to provide meta-data for any kind of resource (not only images). Often, the XMP code (in XML) can be buried inside the resource (JPEGs, PDFs and many files). If it's impossible to add the data (for example a Windows BMP), you can use a side-car file (an external file).

Exif and IPTC seem similar in intent and scope and add tags to images. These two standards appear to me to overlap and I suspect they emerged almost in parallel. Two similar (but different) solutions to the same need really. I believe there are differences in the set of file formats that are supported by the two standards.

I'm sure Andreas (or another contributor to the forum) will be able to explain more about the history of this and the rationale involved.

    (1-6/6)