Friday, January 22, 2010

First experience of armchair mapping using Mapzen and JSOM WMS plug-in

In previous post I shared my first experience of making changes to OSM database with Potlatch and JOSM. As I mentioned there both of them are good tools but neither is perfect so I’m still looking for some alternatives.

Mapzen caught my eye recently probably because it becomes quite a popular buzz word in blogs and news feedings so I decided to give it a try. At first glance, Mapzen looks quite similar to Potlatch (CloudMade who hosts Mapzen is founded by the same person who started OSM):

1. It requires an account (you can register it for free) to work with;

2. A peek at source of Mapzen front page shows it’s based on Flex too;

3. It uses OSM map as base layer in view mode;

4. It uses Yahoo Imagery as based layer in edit mode; (by the way, Yahoo Aerial Imagery is probably the only imagery available for free which has decent globe coverage. I never see other options, do you?)

Mapzen in view mode:


Mapzen in edit mode:


I like the way it categorize those pre-defined features in Points, Lines and Shapes and each one of the feature types has a meaningful icon associated. Of course it lacks some of the advanced editing functionalities that are available in Potlatch (it seems to have a tool to line up points) and JOSM, but it has more than enough for majority of the users. Another thing I like Mapzen over Potlatch is the look and feel when you draw the geometry on map. With Potlatch I always feel like using a big brush for wall painting, where all I actually need is pencil for sketch. The only weakness though is that I didn’t find a way to upload data as input for my editing, either through an osm file or a gpx track while Potlatch provides that option. Everything must be hand drawn. But anyway you can always combine the power of both.

After editing simply click “Save Map” button at corner (you might want to input some notes for this particular editing). The picture above shows the hand-draw building and foot way of my house using Mapzen, as well as a BBQ island garden “August Town” (named after my boy).

JOSM with its WMS plugin (with the Yahoo Aerial Imagery extension) is another option I tried after Mapzen, which I probably rank the highest among all three of them (Potlatch, Mapzen and JOSM). Like I mentioned before, the lack of a decent base imagery is a huge bottleneck which makes it almost impossible for armchair mapping, but the WMS plug-in with Yahoo Aerial Imagery extension overcomes it like magic. So let’s equip with it first by following the instructions here. A brief list of steps:

Install WMS plugin itself:

With the plugin manager

You can easily install plugins from within JOSM as follows

  1. Start JOSM, open the preferences window (Edit->Preferences or use the toolbar icon) and select the plugins tab.
  2. Click on "Download List" to download the list of available plugins.
  3. Check the plugins you want installed.
  4. Click the accept button. All new plugins should start downloading and installing.
  5. Restart JOSM.

With older versions (up until 277), you have to install the plugins manually.

  1. Download the plugin file from wherever the plugin is hosted. Look in the plugin page or the 'Plugins' page on the JOSM wiki site for the location of this file.
  2. The file should have an ".jar" extension. If it doesn't, rename the downloaded file so that it ends with ".jar". Internet Explorer, for instance, may rename some files to ".zip".
  3. Move the .jar file to the JOSM preferences directory ("%APPDATA%/JOSM" in windows, "~/.josm/plugins/" in Unix/MacOS.)
  4. Start JOSM, open the preferences window (Edit->Preferences) and select the plugins tab.
  5. Activate the plugin in the plugins tab.
  6. Restart JOSM.

Install Yahoo! Aerial Imagery Downloader

On Windows use the WebKit based downloader called webkit-image as follows

  • Download
  • Unzip it.
  • Move the contents so that the DLL files and the EXE file are somewhere "on your system path" (eg. c:\windows ). The best way to achieve this might be to place them alongside josm-latest.jar Keep the 'imageformats' subfolder alongside too (so all the contents of the zip).
  • Restart JOSM
  • Do 'WMS' menu -> YAHOO (Webkit)

You should start to get Yahoo! imagery (may take up to 30 seconds to start showing). If not, it may not be finding the DLL files correctly.

Note: If you don't want to place webkit-image in your system path or the JOSM directory you don't have to. By editing the download program you can specify an absolute or relative path to the webkit-image executable. Examples:

  • webkit/webkit-image {0} - loads webkit-image.exe from the subdirectory webkit relative to the JOSM installation directory
  • D:/webkit/webkit-image {0} - uses webkit-image D:\webkit\webkit-image.exe

After a successful install, restart JOSM and you should a new menu called “WMS” like below:


Now download your data from OSM database as usual first, and after select the “WMS” menu and select “Yahoo Sat”. Wait for about 5, 6 seconds you will see a nice aerial imagery base layer underneath your OSM data.


Well done! And this is perfect for armchair mapping. Now enjoy your smooth mapping experience with powerful tools in JOSM. I didn’t try out the WMS layer and rectified image yet which can definitely be better base layer options for specific area.

After the editing simply click upload button (right next to download button) and upload the changes. (you may need to set your OSM account username and password)



So my conclusion is that JOSM with WMS plugin is an obvious winner due to the smooth and rich desktop UI experience if you’re doing armchair mapping at home. But Potlatch and Mapzen have their own advantages of being browser based and easy to use for non-professional users.

Wednesday, January 20, 2010

Install Apache HTTP Server + PHP5 on Windows 7 (64bit)

Recent installation of dokuwiki (a simple web-based wiki engine) requires a combination of Apache HTTP Server + PHP5 on my 64-bit Windows 7 machine, but setup process didn’t seem to be as simple as “following the wizards”. So I decide to jot a few lines down such that I don’t have to search on the web again when I need to repeat the installation.

1. Install Apache HTTP Server; (just go to the official site and pick up .msi, and install in default path C:\Program Files(x86)\Apache Software Foundation\ seems to be ok)
2. Install PHP5;

This worth a short paragraph. My understanding of the install steps on PHP website is that it should be automatically taken care of by the installation wizards if it is for a popular http server like apache, and the install wizard UI does indicate that too. But unfortunately I didn’t get it to work in which I either got an general error message or no error message but just not working. So I switch to the zip version of PHP5 which is suggested by some article online and following the steps below makes it work properly:
2.1 Unzip the the zip version of PHP5 to your local disk; (unzip it to C:\Program Files(x86)\PHP5 seems to be working too)
2.2 Open httpd.conf file of Apache HTTP server in a text editor;
2.3 At the end of the http.conf file add following lines to make Apache HTTP Server be aware of PHP5; (adjust you path accordingly)
1: # Begin enable php5
2: LoadModule php5_module "C:/Program Files (x86)/PHP5/php5apache2_2.dll"
3: AddType application/x-httpd-php .php
4: PHPIniDir "C:/Program Files (x86)/PHP5"
5: # End enable php5
2.4 Save the change and restart Apache HTTP Server, and if successful you should see
“Apache/2.2.14(Win32) PHP/5.3.1” in the status bar of Apache Service Monitor.
Now your Apache HTTP Server should be able to display php content, at least my php based dokuwiki is running perfect.

Tuesday, January 19, 2010

Google Maps Navigation failed me again

As an Android G1 mobile phone user and a fan of Google products and services, I was really excited when the GPS killer app Google Maps Navigation was ported to Android 1.6. But I don’t usually drive to a lot of new places that I have no idea how to get to, even when I do I will do my homework on desktop first, which leaves Google Maps Navigation on my Android phone very few chances to prove its value. But the only time I was trying to rely on it to help me out, it failed. That was about one month ago, I am on my way to metro station in Riverside to pick up my wife after work. Due to the heavy traffic on CA-91 I decided to switch to the station right after the original one (Riverside-La Sierra station), which as I recall later was the first time Google Maps Navigation on my G1 phone coming to rescue in a real situation rather than a fake drill. It actually did a very good job for the most part, which I even see the metro station I was looking for (the red place marker). But amazing thing happened when I passed by the destination (I should have followed the green dash line). First Google Maps Navigation didn’t tell me that I had arrived (I had a second thought that I should just turn into the parking lot, but I hesitated because Google never failed me before), instead it told me to get onto the highway that I just got off again in other direction (the solid green line). I followed although with a little doubt (still believe Google was right) but was totally pissed off after a few seconds when right in the middle of the ramp (where the red cross is) it said that I’ve arrived.

I followed the solid green line which Google Maps Navigation told me to, but the red cross is the place where it said that I’ve arrived.


Today the fancy free Google Maps Navigation failed me again. I was looking for Bed Bath & Beyond in Mira Loma, CA, which seems to be pretty new because my 3-year old Magellan GPS wasn’t able to find it at all. Searching in Google Maps Navigation (by typing “Bed Bath and Beyond” and click search) gave me a matching Bed Bath & Beyond in Mira Loma, which has the accurate telephone number and address. But obviously it put the spin at a wrong place which is about half mile north west of the actual location in a lake. Using the same searching pattern in Google Maps generates the same error, but if you type the result address back in both Google Maps and Navigation points to the right place.

Bed Bath & Beyond in Swan Lake


The red place marker is where Google Maps Navigation directed me to, while the green spin is the correct place:


Another thing I notice is that the streets around wrong Bed Bath & Beyond location in Google Maps hasn’t been updated at all, or at least not recent enough to reflect current name. An example is that the “Peachtree Dr” in red circle doesn’t exist any more. Looking at OpenStreetMap for the same area gives me the accurate result as below: