Monday, November 7, 2011

Exif Timeline Comparer

Idea of a tool I want:

Suppose k friends (k>1) join an event (a party, a trip, whatever) and everyone is taking photos with a digital camera. Afterwards they put all their images into a common folder. Unfortunately, the images are sorted alphabetically, so first come all photos from Bob beginning with DSC, then all from Alice matching IMG*. Wouldn't it be nice if all photos would be in chronological order?

Well, fortunately jhead has an option to rename an image after EXIF time:

  jhead "-n%Y%m%d-%H%M%S$friend" *.jpg

where $friend is the name of each friend applying this command.

The group knows that there cameras clocks are not very exact and every clock has a difference from "real time" of up to an hour. Therefore everyone takes a photograph of a (digital) wall clock, calculates the difference of wall time minus exif time and adjusts exif time with calling


jhead "-ta$WallMinusExif" *.jpg


But what are they doing if they forgot to synchronize with wall time and already shared the photos (and reset their camera's time)? That's what I want to have a tool for! What information can the friends extract from their photo streams? At least they can say for sure that some event was before another one.

Say they took a trip to Paris and first saw the Eiffel tower (shot by Alice), went on to a cafe (where Bob took photos) and then to the Seine (where Alice took photos again). Now they want to tell for all events which one was before/after which and calculate a minimum time difference out of this information.

After that, they can tell that Bob's time adjustment (relative to Alice) is between 4 and 7 minutes, and they decide on the middle: 5:30min.

Tuesday, September 27, 2011

OpenLayers with WFS and GeoServer

Today I set up a geometry table in PostGIS and published it with GeoServer as a WFS. My plan was to save features into this layer with WFST, but it worked out very strange: All attributes went through down to the database, but the geometry column was null! I suspected a problem with PostGIS, but I had no problems manually inserting geometries with ST_GeomFromText.

After analyzing the communication between OL and GeoServer with FireBug, I realized that there was something wrong with the geometry column name. I named it "geom" but OL was sending it as "the_geom", which is the default naming.

A look into OL documentation revealed me that you can give it as a parameter geometryName to OpenLayers.Protocol.WFS

        var wfs = new OpenLayers.Layer.Vector("Polygon", {
                strategies : [ new OpenLayers.Strategy.BBOX(), saveStrategy ],
                protocol : new OpenLayers.Protocol.WFS( {
                        version: "1.1.0",
                        srsName: "EPSG:4326",
                        url : "http://localhost:6060/geoserver/wfs",
                        featureType : "buildings",
                        featureNS : "http://www.bjoernhoefling.de/",
                        schema: "http://localhost:6060/geoserver/wfs/DescribeFea
tureType?version=1.1.0&typename=bjoern:buildings",
                    geometryName: 'geom'
                })
        });
        map.addLayer(wfs);