Saturday, January 06, 2007

Last Open Street Map

This is probably going to be my last contribution to OpenStreetMap, at least for a while. Dad and I went for a walk (him for the exercise, me for the mapping), and have now surpassed the up-to-datedness of Google Maps. You see, back when the military base was open the PMQs (there's no Wikipedia page for PMQs that I want, so you get gc.ca instead) had a main street running through it called "Boulevard", and the latest Google Maps reflects this. Now that Garrison Crossing has moved in and rebuilt the area, the street has been renamed to "Garrison Boulevard". Thanks to me Open Street Map has the new name, and Google Maps still has the old name.

For this update, Canterbury Drive has been completed, Keith Wilson runs from Boundary to Vedder (before it was Boundary-Kathleen), added and completed Peach Road, added the Vedder Trail from Peach to Vedder Road, added Vedder road from the trail parking lot to Keith Wilson, added Garrison Boulevard, and added and completed Birmingham. If someone could do Vedder at the bridge area and Vedder from Keith Wilson to Watson, then Vedder will be finished (it becomes Vedder Mountain Road on the north side of the bridge). With Vedder and Evans being done, the major arteries of Sardis will be completed, and it will be down to mostly residential streets. Now we just have to wait for the OpenStreetMap tile renderer to get around to doing the Chilliwack area.

Thursday, January 04, 2007

Pacific Storm in London Drugs

My brother's band came over today for a jam session, so my Dad and I went out to the malls to do some chores. Whilst in the London Drugs I noticed two boxed copies of Pacific Storm available in the computer section. The cool thing about this is that Pacific Storm was made using the LGPL 3D engine Ogre3D. This is probably the first time that I personally have seen open source software on the shelves of a major retailer (Mandriva at the UBC Bookstore is the only other case). A big congradulations go out to Lesta Studios on getting their work into major retailers, a big congradulations to Sinbad and the rest of the Ogre3D team for making Ogre3D a top notch open source graphics engine. Pacific Storm can be purchased from your local London Drugs for $40. You can check out more screenshots of Pacific Storm on the Ogre3D website. Now if we could convince them to port to Linux (Ogre3D (OpenGL) runs on Linux already)

This isn't an isolated case of quality coming from open source games. I am constantly keeping my eye on Battle for Wesnoth, which recently released version 1.2. This version introduces some new music, multiplayer features, and graphics, including new character portraits. I know that the character portraits were the main complaint of Byron, and with these new ones (and hopefully even better ones in the future), he's got far less to complain about. I think I prefer the mountain graphics from the previous releases, but these kind of artistic things are still getting ironed out.

Another game having a new release recently is Danger from the Deep, a WWII German submarine simulator. This game used to have the standard ugly programmer graphics, but in the past year the models and other graphics have gotten much better. This is a game that looks like it is really picking up speed (it's at about Klein Fahrt right now, but it's getting closer and closer to Grosse Fahrt), and you might want to give it a download and try it. The game desperately needs a manual (as much of the gameplay is difficult to figure out), but I think it could be a submarine simulator's dream.

Another game using Ogre3D is Ankh, made by Deck13 (Ogre3D site screenshots). Ankh is an adventure game, much like the LucasArts games that many of us grew up on. I don't know how much it retails for, but the game looks like it kicks ass. The primary language of the game is German, and they even got some professional voice actors to do the voices (apparently the main character is voiced by the guy who does German dubbing for Tom Cruise). The developers did a preorder campaign to see if there was enough demand for a Linux port. About a week later they announced that there was plenty of demand for Linux, and the Linux port is now underway.

If anybody thinks that Linux/open source gaming is dead, I'm sure they will be beat down to a bloody pulp this coming year. Just check out the Featured Projects page for Ogre3D.

Another Street Map

Last night my brother and father went out to see the Canucks/Stars game. Of course, I asked them to take out the GPS. I have now uploaded an almost complete Keith Wilson Road, some of Boundary Road, No 3 Road from Boundary to the Highway, Highway 1 from No 3 to 176th, 176th down to 88th ave, then over to King George Highway, then up to the King George skytrain station. They even had the thing turned on both ways so I got information for both directions for Trans-Can and King George (which have medians). I still have to get the section of Trans-Canada between No 3 Road and Vedder.
Free Image Hosting at www.ImageShack.us
In the screenshot you can see the NASA imagery being underlayed behind the map. This image is very low resolution (is this due to my zoom level when requesting the image, or due to poor resolution in the image database?), maybe around 30m/pix

Wednesday, January 03, 2007

Width of Blogger

I was doing some minor Blogger maintenance today, things like updating my template, as Google is updating a bunch of the Blogger stuff (like servers, how the backend works, etc). When I switched to the new template I noticed that it was rather narrow (who wants to scroll five pages to read a simple blog post?), so I decided to widen it a bit. The outer wrapper is now 760 pixels wide, while the text area is 510 pixels wide. This means that the whole page should still fit within a 1024x768 screen. It looks to me like the Google template won't resize if it comes across a smaller screen, and I don't know gml (Google's markup language for their templating system) enough to make variable width templates. Are there any other complaints?

Tuesday, January 02, 2007

Contributing to Open Street Map

This post will have two purposes, one being an introduction to contributing to OSM, the other to give an update on my contributions.

Open Street Map (wiki) is an effort to generate street maps of the world with an open license, similar to Wikipedia is doing for knowledge. I don't think I really need to introduce it, so I will leave it at that. To follow this tutorial, you will need an account at OSM (accounts for contributing to the map and contributing to the wiki are different accounts. This tutorial will use the map account). For editing OSM data I like using Java Open Street Map (JOSM is what most people call it), as it runs locally (and therefore a bit faster) than the other applet/ajax programs available. I'll assume that you can manage to get JOSM downloaded and running on your own (of the ones I have tried, "latest/snapshot" is generally stable). Now there are two ways that GPS units will record logs, and this seems to affect how editing happens ever so slightly. The way that most people on the OSM wiki seem to track their routes is through a timer-based recording, ie. the GPS unit will record current position every x seconds. Another method is distance displaced, ie. record position if further than x meters from last recorded position. My fathers GPS (and I can't seem to get it out of this mode) will record position if you start deviating from a straight line, ie. the unit checks your trajectory from the last position and if you are traveling in a straight line, it will not record positions. This has the effect of minimizing the number of nodes recorded, but I am uncertain about the algorithm's accuracy (and if there is "latency" in detecting turns/curves). The mode will affect how we work in JOSM, so keep this in mind. If you can save your track logs onto your computer somewhere, that is good, because they need to be converted. Go download GPSBabel to convert your tracks from the format of your gps unit to the GPX format. GPSBabel comes with a GUI frontend for Win32, but this only crashed for me. In the command line, because my GPS unit is a Magellan eXplorist, I type in
gpsbabel.exe -i magellanx -f "c:\Documents and Settings\The Dunns\Desktop\TKLG005.log" -o gpx -F "c:\....\TKLG005.gpx"
the -i is for the input format, the -o for the output format, the -f for the input filename, and the -F for the output filename. You now have a GPX file ready to import into JOSM. In JOSM, Files->Open will open the GPX file, and the view window will automatically zoom to the bounds of the log. Then you go to Connection->Download from OSM, check the OpenStreetMap data checkbox and hit OK. It will ask for your account info, which you should already have registered. If you don't want to enter your info every time, there is a place in the settings where you can enter your account info once (note that it is stored/transmitted in plaintext). When downloading from the OSM server, JOSM will request a bounding box equal to the currently viewable area. This is why you should import your trace log before downloading from OSM. JOSM is very powerful, and I will only cover the basic topics. There are tutorials and video tutorials that you can check out if you want to learn more. Hover over the buttons on the top and side, as most of them are self-explanatory.

In JOSM a node is a point on a map, a segment connects two nodes, and a way combines multiple segments to create one object. Most streets are ways with name/other labels. Everything in JOSM is stored in layers, with raw GPS data going into GPS layers, and OSM data going into the "Data Layer". You can only edit things that are in the "Data Layer", and there is only one "Data Layer" at a time! This is where GPS logging mode is important. If you are using time-based or displacement-based logging, you will want to leave your GPS logs in a GPS layer and add nodes/segments from scratch in the Data Layer. This will reduce the number of nodes that are used, and make things a lot "cleaner". In my case, because the GPS unit is already reducing the number of nodes recorded, I just right-click on the imported GPS layer in the layers dialog and "Convert to Data Layer". Now the Data Layer will contain the downloaded OSM data along with the new information that we want to add. The new data will be imported as one long way, so the first thing I do is make sure nothing is selected (by selecting some blank space), then I select the "delete" tool and click on the imported line once. This will delete the way from all those segments. Then I look over the trace and start eliminating redundancies. Sometimes I travel down a street more than once, so I have overlapping segments. I eliminate these segments by using the delete tool and clicking on segments and nodes that I want to get rid of. Note that a segment requires both of its nodes to exist, so you must delete a segment before deleting a node if it is the last node in a set of connected segments. I will also get rid of unnecessary nodes in this step (like if I know the road is straight, but the GPS added extra nodes for some reason). In the process of removing redundancies I will tweak some positions (like if you walk down the sidewalk the actual center of the road might be four meters south). Once I have eliminated redundancies then I go about connecting all connected roads (see Junctions for an example of what I'm talking about). This will generally involve adding a node to one of the roads where the intersection occurs (ie. "into segment", click the little arrow in the "Add Node" tool for a dropdown of add node modes), then deleting (ie. breaking if it's two through roads or deleting the last segment and node if it's a T-Junction, and finally connecting the node of the intersection to the broken road. Direction is important in OSM and JOSM, so mind which way the arrows point. Now that all my redundancies are eliminated and all the roads are properly connected I will start assigning "ways". As I stated earlier, a way is a grouping of segments, and are what we assign road names/types to. I will use the box selection to select the segments I want, then shift-click to refine my selection and finally click on the "Add a New Way to the Data". Now we have a way. In the properties dialog I will then set key/value pairs for the road type (most OSM users seem to be British, and they seem to call all roads "highways" so don't be confused when the proper key for a residential street is "highway"), and for the name, plus other information such as oneway or pedestrian only. When I am JOSM-ing, I usually have three pages open: Map Features, Editing Standards and Conventions, and Key:highway. They come in quite handy and I use them to determine how things should be labeled. Also helpful are Wikipedia and an online mapping site (Yahoo Maps, MapSend, Google Maps, MS Live Local, etc). Be careful when using online map sites to verify things, as they will have easter egg errors to catch copyright infringement. Once you have imported, converted, eliminated, tweaked, wayed, tagged, and keyed everything you should download once more (make sure your view window covers all your changes) to make sure there will be no conflicts when you upload, in case someone else is editing the same area. Then upload, and be content that you are contributing to the open sourcing of the world.

For New Years Eve, my dad went up to some friends house in the Okanagan. You would be correct in guessing that I got him to take the GPS with him. As a result, I have now contributed the Trans-Canada Highway from Vedder Road to Hope, the Crowsnest Highway from Hope to Keremeos, the 3A from Keremeos to Kaleden, the 97 from Kaleden to Okanagan Falls, and some of Eastside Drive (near Okanagan Falls). Expanded roads are Vedder, and Watson.

In the first screenshot you can see HW1 in blue (what is that, powder blue?), with 3, 3A, and 97 in green. You will also notice a small bit of road in Penticton (somebody did a poor job of mapping out Lakeshore Drive, and then gave up. Guess I'm not the first person in BC to contribute to OSM). The second screenshot has got Chilliwack in more detail, with Vedder in red and the walking paths in Watson Glen Park in green, plus some of the roads on the south side of Cumberland in shades of grey. One interesting thing about doing the highway system was trying to figure out what names to give different sections of pavement. The section of road from Kaleden to Okanagan Falls has the names "British Columbia Provincial Highway 97", "British Columbia Provincial Highway 3A" and "Okanagan Highway". This is where Wikipedia's BC Highways page came in handy. Well, that about wraps it up for today. Perhaps I'll get some more of the Cumberland area done tomorrow. I won't have a GPS unit in residence, but if people want to send me GPX files with a general description of where they went, I'd be happy to help out.