Geotagging Photos

Armed with a GPS and a digital camera with a love of hiking, it is time to store the location I take my photos into the images and then show them on a map. I review several software which can do this and present my workflow.

Now that I have a GPS, I can have some fun with hiking and photography. The idea is to record my position on the GPS while hiking (i.e., the tracklog). This will provide me (and others) with a good record of different hikes. In addition, I can pinpoint the location where I took photographs and hence tag the photos with those coordinates (i.e., geotagging).

Here is the procedure I use for the purpose:

  1. Set the GPS tracklog setting. My GPS allows time, distance and auto. Time and distance options are for specifying the time or distance respectively after which the GPS position should be recorded in the tracklog. Auto mode tries to determine the optimal interval automatically, though Garmin does not provide any information about how it determines the optimum interval. The preferable mode is specifying the time interval. If you are walking, then a time interval of 6 seconds should give you maximum accuracy and in my case the tracklog won’t fill up to its maximum of 10,000 points for about 17 hours. This just needs to be decided on once.
  2. At the start of the hike, set the camera clock to the time from the GPS. You can either use UTC (popularly known as GMT) or your local time zone. I prefer to set the camera to UTC since then I don’t have to get into the hassle of changing camera time at the end of daylight savings or when I travel.
  3. Sometimes, I also like to take a photograph of the GPS screen with the time showing so that I can later compare the difference in their clocks.
  4. Reset the tracklog.
  5. Mark waypoints on the hike for features, like parking, trailhead, scenic view, waterfall, etc. Write some shorthand in the waypoint name on the GPS to remember the reason later.
  6. Take photographs whenever I feel like it.
  7. Go home and upload the waypoints and tracklog from the GPS to my computer.
  8. Upload the photographs from my camera.
  9. Run RoboGEO to geotag the images and create a Google map.
  10. Use GPS Visualizer to create an elevation profile for a hike.
  11. Upload everything to my web server.

One thing I also want to do is to create a database of the tracklogs of trails which I hike. For this purpose, I will be providing you the GPX file for my hikes here. However, it would probably be a good idea to upload them to public repositories of trails. Does anyone know any such good sites?

Before using this technique on a hike, I decided to test it with a walk locally. I set my GPS tracklog setting to “auto”. With this setting the average time between tracklog points was 12 seconds but there was one interval of 2minutes and 57seconds, probably when I was sitting.

I tried several software solutions for geotagging and creating maps with the photos. Here is my review of them.

TopoFusion

Rich Owings told me about TopoFusion which is a great software with lots of features. But their PhotoFusion is not up to par. It is super-easy to use. All you do is load the tracklog either directly from your GPS or from a GPX file on your computer, point PhotoFusion to the folder where the photographs are and voila!

However, it does not output the coordinates of the photo locations in any form (EXIF data of the images or as waypoints in a GPX file). Hence, we are limited to its own output which shows the locations on USGS aerial and topographic maps with camera icons.

Another problem is that the camera icons do not stand out and can be difficult to spot in the web page output. We also have no options to set the size of the map image for the web output, so we have to set the size of the main TopoFusion window to whatever size we want the final map image to be.

if I provide an output folder in the options for PhotoFusion, thumbnails and all other files are created there. But the original photos are not copied. However the link to full photos in the web page is to the output directory, so those links don’t work without copying the original images yourself.

Also, thumbnails are created but you have to specify both width and height and so there might be a black band if the aspect ratio is not correct. You can see that in the one landspace format thumbnail in my test scenario.

Finally, the output of PhotoFusion is a static map image and the user cannot pan, zoom out or do other interesting things with the map like you can with Google Maps.

One good thing about it is that the output includes an elevation profile and other useful info (like distance travelled etc.)

Here is my test of TopoFusion.

WWMX and GPS Visualizer

Let’s now look at some free solutions. While there are several free solutions, none of them are as easy to use or as complete for this task. One has to use multiple software: one for geotagging the photos and another for creating maps.

The best solution for the map creation is GPS Visualizer, an online tool that does almost anything you could think of.

But before using that, I needed to geotag the photos using my tracklog. I checked two programs for that.

WWMX Location Stamper is a Windows-based application which is simple to use but does not have many features. For example, the camera must be set to the same time as your computer and you cannot specify any difference in the clocks of the GPS and your camera. It needs a GPX file with a tracklog as input unless you use WWMX TrackDownload which can get the tracklog directly from a GPS. It shows the track and photo locations on a map within the application (I think the map requires you to be connected to the Internet) and then stores the location info in the image EXIF.

Another program for geotagging is gpsPhoto.pl, a command-line Perl tool to extract location info from a tracklog and write to EXIF. It has a lot of options. However, it is command-line and requires Perl installation on your computer. Also, you can’t check the results in a map. One pro for this tool is that it is OS-independent.

Once I had the images with their coordinates in the EXIF info, I had to get it in a format that would be acceptable for GPS Visualizer. For the tracklog, I could use the GPX format, but for the photo information, I needed CSV as described here and here. I wrote a short Perl script to do that using Image::ExifTool.

Now comes the time to get GPS Visualizer’s Google Maps form to generate the map. If you are going to fill out the same form again and again, it helps to use the Firefox extension Form Saver to store the form data so you don’t have to select the same options every time.

And finally using the GPX file, I created an elevation profile of my walk.

Here is the page with all the results.

So you might be thinking why go through all this hassle. First, it is free. Second, GSP Visualizer has lots of options and can do almost anything: Google Maps, Google Earth, SVG or JPEG maps, topographic, aerial, street maps, all kinds of profile graphs, etc. And you can control the presentation in detail. Take a look at the map linked to above. In addition to the Google maps, it also has USGS topographic and aerial maps as well as some imagery from NASA.

The downside is the amount fo time/effort used to create a map every time. Also, I would be dependent on another website to create and display my maps.

I do plan to use GPS Visualizer to create elevation profiles and other special maps, but it is too much work for regular stuff.

RoboGEO

RoboGEO looks good and does lots of stuff related to geotagging. You can set the location of your photos manually using Google Earth, or set it using GPS waypoints or use the tracklog. It stores the location info in the EXIF fields or can even stamp the location on the image itself. The output can also be in several formats: Google Maps, Google Earth, GPX/CSV, Flickr, ESRI shapefiles, etc.

For Google maps, the output is in the form of a web page, but it also creates an XML file with all the data in case you want to use XSLT to create your own web page. There is also an option for string substitutions in the generated web files if you want to customize. These options are not as good as having a templating system for web page generation, but they do provide ways to customize the web page code.

I used the string substitution option to add USGS topographic and aerial maps to my map pages. I got the required code to do this from GPS Visualizer and Acme Mapper.

The demo version of RoboGEO is sort-of crippleware as it adds big random error to photo locations and tracklog points. However, I liked it enough after trying it out that I immediately bought it.

Another gripe I have with RoboGEO is that it stores output files in the Program Files folder.

One feature I would really like to see in RoboGEO is to be able to put the waypoints in my GPX files on the map as well. This would help by pointing out parking, trailhead, scenic view, waterfalls, or other features on a hike on the map. I emailed Tim Helton about this and he’s agreed to put it on his to-do list.

Before I show you the map from my test created using RoboGEO, if you are overwhelmed with signing up for a Google Maps API key etc., you can simply create a Google Earth KMZ file embedded with the photographs using RoboGEO and put it online (example). Then just enter the URL of this file in Google Maps like this and voila!

Continue reading “Geotagging Photos”

Pride and Prejudice

Jane Austen’s Pride and Prejudice has been made into multiple movies and TV series. This latest version is good, though not as good as the BBC miniseries. I rate it 7/10.

The latest movie version of Pride and Prejudice reminds me more of Bride and Prejudice than the BBC miniseries (which was the best). And I have actually forgotten the book completely by now, so cannot compare the movie to the book.

Overall, this version was good. We liked it enough to watch it, but it isn’t great either. I would rate it 7/10.

Islamic Calendar

Fiqh Council of North America has decided to use astronomical calculations for the Islamic lunar calendar. I like the idea, but it is very controversial in the community. Let’s take a look at the blogosphere’s reaction. Ramazan Mubarak!

Finally, the Fiqh Council of North America has made the decision to create an Islamic lunar calendar using astronomical calculations instead of relying on sighting the moon every month.

A special conference on Hilal Sighting was organized by the Fiqh Council of North America (FCNA) on 10 June 2006, in Virginia, attended by a number of jurists, Imams, astronomers and other concerned Muslims. [… T]he following is concluded:

  1. It is decided to use astronomical calculation to determine the beginning of the Islamic lunar months with the consideration of the sightability of the crescent anywhere on the globe.
  2. To determine a lunar Islamic calendar, a conventional point of reference must be used. The International Date Line (IDL) or the Greenwich Mean Time (GMT) may be used.
  3. The new Islamic Lunar month begins at sunset of the day when the conjunction occurs before 12:00 GMT.

A number of people say that it is against the practice of Prophet Muhammad to use astronomical calculations and hence should not be done. However, we use such calculations for lots of things nowadays as this explanation says.

These astronomical calculations are already being used in acts of Islamic worship such as directions of Qiblah, five daily prayers, Imsak and Iftar timings, the acts of worship which are more significant and frequent than sighting the crescent. The Qura’nic verses and the Prophetic commandments clearly indicate some means to accomplish the aspired objectives. For instance, The Qur’an connects the Imsak timings with the white and black thread at the dawn time. Presently we go by our watches based upon the astronomical calculations. The Hadith connects the Iftar timings with seeing the night coming from the East. Currently we break fast without sighting the night coming from the East but by our watches. The Qur’an and Ahadith connect the five daily prayers timings with the shadow and movement of the Sun. According to the Ahadith Angel Jibreel himself taught the Prophet (PBUH) timings of these prayers and connected them with the shadow of the Sun. The entire Ummah somehow goes by the astronomical timings of the watches and not with the letter of the Qur’an and Hadith texts. There is a consensus among the Muslim jurists that these means are permitted to determine the Salah, Imsak and Iftar timings and nobody makes fuss about them being against the Sunnah or against the crystal clear texts of the Qur’an.

Here is some information from the Fiqh Council of North America and here is the calendar for the next 5 years.

This is not the first instance of Muslims not using moonsighting. There is a Fatimid calendar used by Nizari Ismailis and Dawoodi Bohras.

The Tabular Islamic Calendar (also called the Fatimid Calendar) is a rule-based variation of the Islamic calendar. It has the same year numbers and months, but the months are determined by arithmetic rules rather than by observation or astronomical calculations. […]

Each year has 12 months. The odd numbered months have 30 days and the even numbered months have 29 days, except in a leap year when the 12th and final month has 30 days. There are 11 leap years in a 30 year cycle.

In addition to all the confusion and waiting till late night that the moonsighting approach entailed, there were also scheduling and economic issues.

Kareem Irfan, of the Council of Islamic Organizations of Greater Chicago, where an estimated 400,000 Muslims live, said the uncertainty of the old system has been costly.

Organizers of the massive community worship services that mark the holiday had to reserve convention halls for two different days, losing money on the double deposit, he said. Muslims who needed a day off from work or had to make plans for pulling their children out of school could not say when the celebration would be.

So how have we, in North America, been deciding on Ramazan and Eid until now? The Moon Sighting Debate Blog explains.

Camp #1: This is the camp of the majority of the traditionalists. They firmly follow the local moon sighting position.

Camp #2: This is the Saudi moon sighting camp. Although, they tend to portray themselves as followers of the global sighting position, in reality they only determine their Islamic dates according to the moon sighting announcements made all the way in Saudi Arabia.

Camp #3: True followers of the traditional global sighting position. I have personally come across only one major scholar from Syria who says he follows this position.

Camp #4: This is the brand new camp. [… T]his camp has declared a five year pre-determined Islamic calendar based solely on astronomical calculations.

Most of the mosques in Atlanta fall in camp #2, but it is still common to have two Eids in almost every major city in the United States.

While I think a calendar based on astronomical calculations is a good idea, it is definitely no panacea for the multiple Eids problem since a lot of people are sticking to their guns and plan to observe Eid using the method they like. In fact, in recent days, a number of new organizations based around moonsighting have sprouted.

Here are some reactions from the Muslim blogosphere, without comment, on this issue.

Wa Salaam: I’m still not sure exactly where I stand on this issue.

Eteraz: Muslim sure do fight over the moon a lot. This is because the Muslim calendar is lunar and so to know when Ramadan starts (or ends) you have to have a moon-sighting. The problem is that because the Earth spins on an axis (stupid axis!), the moon does not appear at the same time in different places. In fact, because the axis spins on a slow 24 hour cycle (stupid axis!) it means that the same moon can appear in one place a whole day after it appears in another place (stupid moon!). This, in the American context, gives rise to the most idiotic ‘debate’ to strike Islamic Law since Khomeini’s madrassa hypothetical.

جہانزیب: میں آسٹرانومی کی بنیاد پر بنائے گئے کیلنڈر کے حق میں ہوں اور امریکہ میں خصوصاً اور باقی اسلامی دُنیا میں عموماً ایسے لوگ پہلے سے موجود ہیں جو آسٹرانومی کی بنیاد پر کیلنڈر کا اجراء چاہتے ہیں۔ نہیں تو حالات وہی رہیں گے جو نیویارک میں ہیں لوگ پاکستان، سعودی عرب فون کر کے پوچھتے رہیں گے کہ رمضان کب ہے اور اُس حساب سے اپنی عیدین مناتے رہیں گے۔ ہمارے گھر کے قریب ایک مسجد ہے جہاں دو عیدیں پڑھائی جاتی ہیں وہاں ڈیوٹی پر موجود ایک پولیس اہلکار کا سوال تھا کہ ایک ہی علاقے میں رہنے والے مسلمان ایک ہی عید پر متفق نہیں ہو سکتے؟

میرا پاکستان: رمضان کی آمد آمد ہے اور ایک بار پھر مسلمان اس تفرقے کا شکار ہوجائیں گے کہ رمضان کب شروع کریں اور عید کب کریں۔ عرصہ ہوا دنیا کو اتنی ترقی کۓ ہوۓ کہ چاند کے گھٹنے بڑھنے کا اندازہ پہلے سے ہی لگایا جانے لگا مگر مسلمان ہیں کہ اس ٹیکنالوجی سے انکاری ہیں اور وہ اپنی آنکھوں سے ہی چاند دیکھ کر رمضان شروع کرنے پر بضد ہیں۔

David Kearns: Based on what I’d read, and the assertions of groups like ISNA, I’ve been saying for years that if you don’t sight the moon, it just doesn’t count. Apparently that’s not the case any more. In reality I’ve just followed the guidance of ISNA, and I guess if they’ve taken a new stance, then I’m all for it. This certainly helps for scheduling things. Maybe some day I’ll be less busy and can investigate the jurisprudence behind this.

Ginny’s Thoughts and Things: I’m all for creating an “American Muslim identity” and all of that, but let’s not throw away the Qur’an, along with the Sunnah of our noble prophet (Allah’s peace and blessings be upon him), in the process of “trying to fit in”. We can use science, yes, we can carve out our own niche, we can do all of that, but we can do it and still “follow the rules”, as it were. I mean, while we are at it, if we’re going to be “like everyone else” and dispense with calculations, then let’s stop wearing hijab, let’s just stop eating hilal meat, etc. Basically, in my “sarcasm” I think this is getting dangerously close to the “slipperly slope”

Lota Enterprises: This is literally something that has been unknown to the ummah of Muhammad(saw) for literally over 1,420 years. It has never been done before, and especially not on this scale. Its August, and they have already announced Eid. They’ve zapped all of the fun, excitement, and most of all the SUNNAH of anticipating Ramadan and Eid!!

The Moon Sighting Debate Blog, which actually presents only the side against the astronomical calendar, has reactions against the Fiqh Council decision here and here.

And I forgot. Ramazan Mubarak! It starts tomorrow.

UPDATE: Also, Happy Rosh Hashanah!

Movable Type Upgrade

I have upgraded to Movable Type 3.32 and have made modifications to run it natively with Unicode. I like some of the new features (better Unicode support and tags). If there are any problems due to the upgrade, drop me a line.

I just upgraded to Movable Type 3.32 and am now running Movable Type on UTF-8 natively (that’s my doing, not Six Apart’s), but more on the Unicode issues later.

Here’s what I like about the changes in MT 3.3.

  • Movable Type can now be configured (using the DeleteFilesAtRebuild configuration directive) to delete files made unnecessary by changes made in the administrative interface. Individual archive files are deleted when previously published entries are deleted or unpublished. Category archives are deleted when their corresponding categories are deleted.
  • Pings coming from the same IP address with the same Source URL are now silently discarded. A success value is, however, sent to the pinging server so that the doesn’t keep trying to reping. [Not the best approach but better than duplicate pings.]
  • The order of attributes specified in template tags is now observed and respected (e.g. trim_to=”10” remove_html=”1” is different than remove_html=”1” trim_to=”10”). In addition, the same attribute can now be processed multiple times if so desired (ie, regex=”abc” regex=”def”). [ Jacques must like that.]
  • Added textarea resizing controls to the template editing pages.
  • In version 3.2, using certain later versions of MySQL or postgreSQL, some non-ASCII characters were not returned correctly from the database as originally written. This was caused by a mismatch between the character_set_client and character_set_connection variables. To fix this problem, we’ve added a configuration directive, SQLSetNames, which will inform the database of the character set being used by the client. The database character set must match the PublishCharset used by Movable Type. [I had implemented it already in my system.]
  • Implemented TrackBack transcoding between many character sets via Encode/JCode modules. This allows for correct display of TrackBacks sent in an encoding different than the recipient’s blog character encoding. [It is good that Six Apart is doing this, but I don’t like their implementation and prefer the one by Jacques Distler which I have been using already.]

I also like the inclusion of tags, though it would take me some time to populate my posts with tags and make any use of them.

The search page is barely working right now, but I’ll fix it soon. If there are any other problems with the upgrade (with commenting, trackbacks or anything else), please let me know.

I have also made some template changes. One is the inclusion of a menu bar at the top so that you can find the most common pages easily. Also, I am now including the sidebar in most pages other than individual entries.

The Rock : A Tale of Seventh-Century Jerusalem

The Rock is a combination of history and imagination. It is fiction but uses historical events and places to weave a great tale. I think Makiya succeeds in creating an overall legend and myth for the Rock in Jerusalem.

I think I read about this book from Brian’s blog, though I do not remember now.

The Rock: A Tale of Seventh Century Jerusalem is good as the author Kenan Makiya weaves a tale combining some historical events with myths, legends and his own imagination.

The book tells the story of Jerusalem and specially the Temple Mount during the era of Islam’s rise in the 7th century. Most of the story covers the years from the Muslim conquest of Jerusalem in 638 AD to the construction of the Dome of Rock mosque in 691 AD. Makiya uses accounts of Jerusalem from Judaism, Christianity and Islam and combines them together in a magical fashion with his own imagination.

It is a quick read and I finished it in a few days.

Oldboy

Oldboy is a revenge thriller. A man is kidnapped, imprisoned for 15 years and then released. Then he looks for his kidnapper and why he was kidnapped. It is an interesting movie. I rate it 6/10 as I foresaw the plot twist.

Oldboy is a Korean film and a revenge thriller.

A man is kidnapped on the day of his daughter’s birthday and imprisoned for 15 years. Then he is released suddenly and equipped with money and a cellphone. As he looks for his kidnapper, we learn the background story.

It is an interesting movie, but I saw the main plot twist miles away. Amber had no inkling about it. So that reduced my enjoyment of the movie somewhat. Because of this, I am going to rate it only 6/10.

It also has an ambiguous ending and you would find lots of people arguing about what it means.

Liberty or Death

Liberty or Death by Patrick French is one of the few books on Indian independence that is not anti-Jinnah. Its portrayal of Jinnah and Mountbatten is realistic. I recommend it to anyone interested in the partition of India and Pakistan.

Liberty or Death — India’s Journey to Independence and Division by Patrick French was recommended to me by Conrad and an offline friend of mine.

It is a good, well-balanced book. In fact, it is one of the few books on the history of the independence and partition of India not written by a Pakistani that is so positive about Jinnah. May be it is my latent patriotism, but I found its somewhat sympathetic portrayal of Jinnah and its harsh treatment of Mountbatten much closer to my understanding of the history than the picture painted in Freedom at Midnight.

Probably the one thing that distinguishes Patrick French’s work here is his use of the archival records from the intelligence services.

While I would recommend Liberty or Death highly to anyone who wants to read about the history of Indian/Pakistani independence, I do think that most of the books I have read on the topic focus too much on the 1940s and not as much as they should on the earlier decades of British rule in India.