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.

Rendering Maps: A quick how-to

After a bit of mapping at the Technopark, we planned to render the map offline. This being a step towards the Fort Cochin Heritage Walk Mapping. So, I banged into the #osm channel on irc.oftc.net with the question, the first answer was Mapnik. But Mapnik, essentially, requires you to generate the Postgresql database instance out of the .osm file using osm2pqgsql or osmosis.
But, the quick method is to use Osmarender. The following steps would let you render a good .osm file into a map.

  1. Dowload the xml or .osm data subset of your area of interest.
  2. If you do not have installed subversion system, type sudo apt-get install subversion
  3. Now, you need to get the latest source files of Osmarender, for that type  svn checkout http://svn.openstreetmap.org/applications/rendering/osmarender/
  4. cd to the directory. Probably cd /home/<user_name>/osmarender/
  5. Type  apt-get install xmlstarlet
  6. Now, call the magic!
  7. Type xmlstarlet tr ~/osmarender/xslt/osmarender.xsl  -s osmfile=<file_name>.osm  ~/osmarender/stylesheets/osm-map-features-z17.xml  > <destination_file_name.svg>
  8. You’re done!

Now you should get an svg of the map. I got something like this by tweeking the stylesheets a bit

Map
Map

You can further make additions to the stylesheet files and adjust the parameters to suit your needs. More information is available at the Osmarender wiki.

Converting log to gpx

One of the lessons from the NIT-C Mapping Party was regarding the conversion of .log files to .gpx formats. The OpenMoko, records the GPS data in .log format. But the map editors, uses gpx format. There had been two important converters suggested, one, a python script, other, a perl script. We resorted to use the python script. Straight away converted the files and opened in JOSM. Whao! All of us were out of words. Better you watch the pic below!

log --> gpx
log --> gpx


The problem was that, OpenMoko records speed, altitude and other close information. These resulted in the circles within the gpx file. We had to open the python script and comment out those lines which converted the altitude and other unwanted details, as follows.

#    f.write(”        <ele>” + riga[2] + “</ele>”)
#    f.write(”        <speed>” + riga[3] + “</speed>”)
#    f.write(”        <course>” + riga[4] + “</course>”)
#    f.write(”        <fix>3d</fix>”)
#    f.write(”        <hdop>” + riga[5] + “</hdop>”)

Convert the log again with the script edited as above, this should work fine!

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.