Beyond just a ‘Map’

This morning, I came across another dose of my Apple maps debate. We’ve been continuously going back and forth about how bad the data on iOS6 maps are and that it’s a shame that Apple is doing this to their customers. To be fair, making a map, a base layer, is not a tiny task. Nor it is something that a team of 50 can pull together in 3 months. It takes rigorous learning and efficient processes to build a map which ‘delivers’ what people want. It’s not about building a map that looks good on the phone. It’s about building the geospatial data repository where you find what you are looking for.

The whole new ‘Social Map’ phenomenon is making me think that we are attempting the Borgesian map. In 1946, Jorge Luis Borges published a short story on how the map of an empire got too accurate and exact enough that anything smaller than the representation equivalent to the size of the empire will be considered incorrect – ‘a scale of a mile to the mile’.

May be we are not attempting it to be of that size, which quite clearly is impossible, but where we are heading is a bit scary – the map where you will find anything you want – you will see where your friends are – you will see what you would want to do next. Trust me, I’ve seen my friends in trouble after they started using Google Latitude.

The amount of detail that people want on the map makes me cringe at times. I leave it here for everyone else to think.

And yes, the Curiosity Rover checked in from Mars!

The life changing lesson.

I’ve a bunch of friends coming home tonight to celebrate the success of the last couple of days, which were the most intense, delightful and tiring days of my life so far. The house is a mess, with clothes thrown here and there, random papers and gadgets all over the place. Yes, I’m just cleaning but I don’t want to push off writing this blog post any more. I should have done this yesterday, but my mind and body just didn’t allow, even now I can feel the warmth in my eyes.

Eight months passed since I moved to Bangalore. At the beginning of this year, I made one of the best decisions in my life, to join HasGeek. I might not be able to put this into flowery words but yes, HasGeek is a bunch of exciting, super exciting and fascinating people. The way each of us work is in itself a new big story.

My first assignment at HasGeek was to join the trip to Goa (yes, that was a work trip), and the first official task which I executed was to drive the car. That was an exciting trip. While we were planning the year ahead, I figured out that Nigel and I might be writing code while rest of the team will be running events. But right now, it feels like the world and words have suddenly changed in front of me. Even though I’m spending just few hours a week for HasGeek, I got the chance to run an event.  The Cartonama Workshop. Yes, we did it.

In 2011, right after Android Camp, bunch of us spent the whole night hacking on one thing – build a community around open geographic data and showcase the projects in India – Cartonama.com. Nowhere in the wilderness of my thoughts I could imagine that we would do events around Cartonama.

A week before JSFoo Pune, Kiran asked whether I would be able to take charge of the Cartonama Workshop. Maps are something that fascinates me all the time and I totally wanted to take this up. I remember that day quite clearly. That day marked exactly a month plus a week to the event. The news that Mikel and Schuyler are coming to Bangalore for the workshop was even more exciting.

We wanted to get the website out by the end of that week. Fortunately or unfortunately, I had to spend that weekend in Calicut. And now it’s time to tell you about one of my best friends, Ashima. We spent the days together when she figured out that I’m stressing out so much. We went for long walks on the beach talking about Cartonama and what I wanted to do about it. She’s amazing.

Kiran had couple of ideas how the website should be and I thought it would be best if he takes care of that. Kiran was just busy and didn’t have any bandwidth to get this going. Nothing happened and no sign of the website getting live. Zainab was the biggest pillar of support – and an entirely different woman that I’ve seen all my life. By the end of the week, I realized, getting the website live was just my task, no matter how I can execute it. Nigel, Riju, Aditya and I created the first iteration and we went live. There was something quite different from rest of the events that we have done – the ticket price for the workshop being INR 10,000. That amount will just help us break even with the expenses, only if we sell 30 tickets. So the problem is not to create a good looking website, but to create a website that will sell tickets. Parag did the second iteration and that was fabulous.

Unlike conferences, chances of attracting sponsorship was very weak. The task at hand was quite tricky – to convince people and sell tickets. I was slightly bothered because, two days after going live with the website we couldn’t sell any tickets. I tried to sell tickets all day, let alone near the barber shop. Zainab would say “Take it easy boy, we shall prevail!”. We did prevail. And my heart is beating fast with joy.

Mikel was in the US and Schuyler in Afghanistan. That was some serious distance which was filled by flood of emails between us. We wanted the workshop to be covering the entire technology stack that would help someone to run a location based service. The funnel was put into test again and we discovered many interesting ways to improve it.

Two weeks later, we have sold two tickets. I was getting very nervous, and there were moments when I would just close my eyes trying to stay sane. Patience.

Today, after the event I just don’t want to think about those days anymore. We sold a total of 22 tickets. Not bad.

Some people are just sloppy and intense to deal with. The most inconsistent person I’ve ever seen in my life was that new caterer with whom we signed up. He screwed up everything at the last moment and we switched. When people are sloppy, there is nothing that you can do. Patience.

Billy is another interesting character that I met recently. I can tell you that he is quite a character. Billy is prompt and perfect. His thoughts are sharp and ideas are simple and sensible. Throughout the two days of the workshop, it was Billy, I and Nigel managing the logistics at the venue, while Zainab and Kiran were busy backing us up.

I understood that technology and infrastructure is inconsistent. They wont wait or keep promises. We bumped into issues after issues on day one of the workshop and I felt terrible, but Billy and Nigel was dealing with endless crisis. Patience is the word again.

Internet is something that people care about. They get frustrated every moment when the Internet goes down. There would be sudden chaos. Every nerve in my body was hurting and there were moments when I just wanted to scream out to the people to be patient.

In the middle of the sessions, my eyes would just lock between Mikel’s and Schuyler’s. I just don’t know why, but that gives me a pulse of how everything was going.

At the end of day 1, Billy and I reached home quite late. I was tired and sleepy, but we sat down and started talking about everything that happened that day. I realized that there were too many things that we could’ve done better.

Day 2 was interesting. I was just worried by the thought that whether the participants are enjoying the sessions. Interacting with many of them over the breaks told me that things are going just alright. Sigh of relief. People just loved the way Mikel and Schuyler was taking them through the sessions. They just loved it.

And today, I can proudly say that the workshop wasn’t too bad. I guess it was intense as we promised. The amount and depth of things I learned over the last couple of days cannot be just described. Patience is the key. It is. Always.

 

 

MapQuest tiles through Leaflet.js

Cross posted from geohackers.in.

Leaflet.js by default supports Cloudmade’s awesome map tiles. The Open MapQuest project also provides beautiful tiles, which are now used at OpenStreetMap.org. To use these tiles all you have to do is to change the map preamble as follows.

The Cloudmade maps layer looks like this.

Change the preamble to.

Setting up Mapnik for rendering tiles in your language.

Mapnik is the default renderer on the OpenStreetMap main site. We can setup our own OpenStreetMap server for rendering the tiles either online or offline. This note would help you to setup an offline one (online if you do on your server) with special eye on font setup for localized tiles.

To render the tiles using Mapnik, you need to create a PostgreSQL database out of the OSM data. Then install Mapnik depending on the Operating System you run. These primary steps are very well covered in the following pointers.

  1. Setting up PostgreSQL database out of the OSM data. Read more.
  2. Build your own OpenStreetMap server – Richard Weait. Read more.
    • For Ubuntu Lucid Lynx read here.
  3. Using Mapnik for rendering the tiles – Richard Weait. Read more.

Once you are done with the above steps, we might think of tweaking the Mapnik rules to render the tiles in a local language. For this all we need to do is point Mapnik to the right font. You can quickly follow the steps briefed by Richard, here.

You can run

python
>>> from mapnik import *
>>> for face in FontEngine.face_names(): print face
… [Enter]

DejaVu Sans Bold
DejaVu Sans Bold Oblique
DejaVu Sans Book
DejaVu Sans Condensed
DejaVu Sans Condensed Bold
DejaVu Sans Condensed Bold Oblique
DejaVu Sans Condensed Oblique
DejaVu Sans ExtraLight
DejaVu Sans Mono Bold
DejaVu Sans Mono Oblique

……………………………………..

>>> Ctrl-d

to see what fonts are currently being recognized by Mapnik. The second task is to install the local language unicode font to Mapnik’s default font directory. If you have already installed Mapnik, you can run strace -ff, and search for font to see which directory is used by Mapnik. In my case it was the default directory at /usr/share/fonts/

Next, you need to copy the required fonts to the above directory. You might run the python code snippet again to see whether Mapnik recognizes the fonts. For example, in my case, it looks like this.

DejaVu Sans Bold

DejaVu Sans Bold Oblique

DejaVu Sans Book

DejaVu Sans Condensed

DejaVu Sans Condensed Bold

DejaVu Sans Condensed Bold Oblique

DejaVu Sans Condensed Oblique

DejaVu Sans ExtraLight

Rachana Regular —> new one
Note the name of the font that appears in the above list. This name would be used in the Mapnik rule file.
Now, we’ll edit the Mapnik custom rule file, as described below.
You can find this in ~/mapnik/<template name>.xml. Open the file in an editor of your choice. The file begins with something like this.

<FontSet name=”bold-fonts”>
<Font face_name=”DejaVu Sans Bold”></Font>
</FontSet>
<FontSet name=”book-fonts”>
<Font face_name=”DejaVu Sans Book”></Font>
</FontSet>
<FontSet name=”oblique-fonts”>
<Font face_name=”DejaVu Sans Oblique”></Font>
</FontSet>

Change the face_name to the font name we just copied to the fonts directory.  In my case, it would look like this.
<FontSet name=”bold-fonts”>
<Font face_name=”Rachana Regular”></Font>
</FontSet>
<FontSet name=”book-fonts”>
<Font face_name=”Rachana Regular”></Font>
</FontSet>
<FontSet name=”oblique-fonts”>
<Font face_name=”Rachana Regular”></Font>
</FontSet>
Mapnik rule file defines fonts for each of the possible tags which appear in the map data. You need change that in order to apply the special fonts to specific tags.

<TextSymbolizer name=”name” fontset_name=”book-fonts” size=”11″ fill=”rgb(0,0,0)” halo_radius=”1″></TextSymbolizer>

You can edit the lines which are like as shown above. Change the fontset_name, to the one you want. And run the renderer! You are done!
I have two images to egg you on!
Before installing font After installing fonts
DejaVu Sans Bold
DejaVu Sans Bold Oblique
DejaVu Sans Book
DejaVu Sans Condensed
DejaVu Sans Condensed Bold
DejaVu Sans Condensed Bold Oblique
DejaVu Sans Condensed Oblique

DejaVu Sans ExtraLigh

Thanks to the #osm channel irc.oftc.net and Richard Weait for helping out to figure the changes.

Render Maps Quickly

If you want to render you OpenStreetMap data quickly into beautiful maps, Mapgen is the tool for you. A very easy to use, perl script, with less dependencies. Mapgen supports rendering to SVG, PNG and PDF. All you have to do is to get the package and then command!  The rules file is easy to tweak for your custom needs.

I have packaged the required stuffs into a tar.gz. Download it from here. The Manual is available here.

For the impatient, use the following command to get the map rendered.

perl mapgen.pl -in = file.osm -style=mapgenRules.csv -out=map.svg

A small area of Calicut

I managed to render a small area of Calicut in few seconds.

Fort Cochin Heritage Walk Mapping!

Fort Cochin is marked for one of the earliest establishments of foreign trade in Kerala. The heritage walk is an awesome 6 KM journey on foot, which takes us back to the 1700’s when the Dutch, the Portuguese and the English was busy trading the wealth. The island provided them a very wonderful place to trade and refresh. The heritage walk meets us at different monuments which reminds us of these historical landmarks.

I met Arky at the Ernakulam Boat Jetty, from where we collected few maps and other resources. We took a boat ride to Fort Cochin. The boat journey was refreshing for as I did not have anything for my breakfast. We planned how to get the things done.

IMG_9953
The Boat Ride
The Boat Ride
The Boat Ride

We refined the list of POI’s. The boat took us to Fort Cochin in 25 minutes. It was around 10.20 AM. Pinged Sameer of i-lug cochin and Prinson of SPACE. Prinson promised to join us soon with the wireless internet device. But, we could not wait, and started mapping right from the point where we got down. It took us a moment to set up the GPS device, the notepad and our Camera. I was tweeting all the way.

We started our walk by watching the beautiful Chinese fishing nets.

Chinese fishing nets
Chinese fishing nets

We decided to take photographs in such a way that we could properly geotag them.

On the left, we found the Nehru Childrens’ Park. We sat down there for a moment and verified our route in the map we obtained.

Nehru Park
Nehru Park

We took the walk on to the paved retaining wall, and found the third POI, the Great Anchor

Anchor
Anchor

This was one of the four anchors used by Lord Wellingdon.

We continued our walk through the pavements and came across the Steam Boilers.

Steam Boilers
Steam Boilers

These were used by the cranes. Coke and Coal was the important fuels of the boilers.

On the right we found few rest shelters.

Shelters
Shelters

We held back at the shade of a tree to watch a beautiful yacht moving the back water. Arky was exclaiming his dream to spend a day in such a yacht.

Yatch
Yacht

We came across the remains of the Fort Immanuel, the Gunnary.

Gunnary
Gunnary

This was used to fire at any illegal boats or yachts found in the waters.

There were two look out points or view points leading to the waters. Somebody can walk upto it and enjoy the fishermen making their life.

I could not resist to jump into the sea side beach. The climate was very hot and dry.

Beach
Beach

Still we enjoyed the walk and with sheer enthusiasm, decided to continue.

We took a deviation from the paved way into the Dutch Cemetery Road.

Cemetery
Cemetery
Inside
Inside

It dragged us back to the times, the Dutch established their colony in Fort Cochin.

Next, we came across the Thakur House.

Thakur House
Thakur House

Thakur was one of the earliest North Indian who settled down in Fort Cochin for Trade purposes. This is the place where he lived.

We took a left to the Napier Street

Napier Street
Napier Street

And found the St. Andrews Parish Hall.

St. Andrews Parish Hall
St. Andrews Parish Hall

Looking on the watch, we realized that we walked for half an hour. And, yet, we enjoyed. I was getting the feel of hunger.

ATM
ATM

Since our plan is create a tourist friendly map, we were focussing on places like this too.

Bishops House
Bishops House

The Bishops house was near by.

Indo-Portuguese Museum
Indo-Portuguese Museum

It was a lucky find. The museum is located inside the campus of Bishops House. But unfortunately, we could not sneak in as it remains closed on Mondays.

Now, we checked the data so far we have collected and correlated them with the pamphlet we obtained. Almost done. Few more to go, and continued walking.

VOC Gate
VOC Gate

This was really interesting. The VOC gate. The Dutch establishment in Fort Cochin was like a colony. There were many gates for the fort or whatever they call it. This was the main entrance gate, built in 1740.

Vasco House
Vasco House

We came across the Vasco House and ..

Vasco Cafe
Vasco Cafe

We walked across the street to find the St. Francis Church.

IMG_0024

We sneaked into the church, a lot of people were offering their humble prayers.

IMG_0025

Inside the church we found these large sheet hanging from the roof top. Arky reminded that they are the fans and we talked a bit about the slaves who sat outside the church and pulled the rope to wave the sheets. This was serving as a fan.

The next find was the Santa Cruz Basilica.

IMG_0035

There were a lot of believers flowing into the basilica.

We collected the required points and photographs and continued walking, and Arky pulled my attention to this one.

IMG_0038

We watched the love birds chirping as we walked past the street.

Koder House
Koder House

We came across the Koder House. Guess we missed the Delta Study, Arky verified the resource maps and confirmed we had to trace back.

Delta Study
Delta Study

Not too far. We found it. Recorded the POI.

We took the street across the Koder house again and reached the Vasco da Gama Square near the Nehru Park. This is the place where we had begun the walk. And back to square one. We had some tender coconut juice, and verified the waypoint data we collected. It was amazing for us.

The Device
The Device

Prinson popped in. We together walked to Vimal’s bookshop in the Prince Street. Sat down there for a moment and downloaded the data.

Vimal's Shop
Vimal's Shop

To our surprise, we have collected a lot of data in very short time. Prinson reminded that there is a harthal tomorrow. Vimal tried to arrange us a stay, but this season, it was very difficult.

So we decided to wrap it up and move to the Regional Centre of SPACE at Kalamasery. We met Sameer of i-lug Cochin there.

Tagging in JOSM
Tagging in JOSM

The walk was tagged and uploaded to OpenStreetMap. This was one of the projects by Geohackers. The event was a get-away for me, Arky and Prinson. We learned to improve the quality of map making process.

The next step is to create a tourist friendly map. This is the important part. It is great that we have Hiran to help on creating the overlay.

Will update once it is complete.

Reworking NIT-C Maps

The first Mapping Party in Kerala was held at National Institute of Calicut, Calicut, during 23-24 October 2009. The event was organized by the Free Software User Group Calicut and GeoHackers. Indeed the quality was poor. As a result of few discussions on the OSM emailing lists, I have been reworking with the data we collected. Added few new roads, paths etc. Making the map more rich. The map is here.