Ramblings of a math and CS teacher

May 31, 2005

Google Maps Directions Using Latitude and Longitude

Filed under: Uncategorized — danschellenberg @ 5:16 pm

Whilst this may be common knowledge, I only recently discovered how “hackable” the Google Maps implementation is in regards to using latitudes and longitudes. While I was reading the Add Google Maps’ Directions to Your Site post from the Malevolent Design weblog, I thought it would be nice to have the ability to direct people to a particular spot that cannot be referenced by name in Google Maps. As it turns out, this is quite simple.

To get the latitude and longitude of a particular spot, navigate to it in Google Maps (ie. search for the nearest reference point that Google Maps recognizes, and then navigate to the particular area you would like to reference). Make sure the map is zoomed in and centred on the spot you would like to reference, and then click on the “Link to this page” link (currently on the upper right hand side of the screen). Google Maps will respond by changing the URL to a bookmarkable URL that includes the latitude and longitude in it, such as:

http://maps.google.ca/maps?q=greenall+school&ll=50.487160,-104.266577&spn=0.004059,0.005240&hl=en

The latitude and longitude are the two numbers after the &ll= section of the URL, in this case 50.487160 and -104.266577. You can use this information to now create a form that generates custom directions to the site you have referenced.

For example, enter your starting location (as a ZIP/Postal Code/City/Address or any other form Google Maps recognizes) to obtain custom directions to Greenall School in Balgonie (where I will be teaching this fall):

The code is simple, and easily adaptable to any location:

<form action=“http://maps.google.com/maps” method=“get”>
<p><label for=“saddr”>Your ZIP code</label>
<input type=“text” name=“saddr” id=“saddr” value=“” />
<input type=“submit” value=“Go” />
<input type=“hidden” name=“daddr” value=“[destination]“ />
<input type=“hidden” name=“hl” value=“en” /></p>
</form>

All you have to do is replace the [destination] part above with the comma separated lat and long values, in this case: 50.487160,-104.266577

May 15, 2005

Guido van Robot (GvR) on Mac OS X

Filed under: Uncategorized — danschellenberg @ 11:01 pm

I’ve spent the past few weeks creating a bunch of resources I hope to use in teaching introductory computer science at some point. The language of choice for this has been Python, though the majority of stuff could be easily transferred to any other object-oriented language. Anyhow, one nifty thing that I will undoubtedly use to start off a semester of teaching CS is Guido van Robot (GvR). It’s an incredibly simple language (5 basic commands) in which the students get to send a robot off doing different tasks. Using this tool allows the students to learn a substantial number of important basic CS concepts, and most importantly (to me) allows them to experiment with algorithms/problem solving and receive instantaneous visual feedback about their algorithm. I can’t think of a better way to introduce computer science than this.

GvR is cross-platform (runs fine on Mac OS X, Windows or Linux), and is therefore suitable to nearly any lab environment. However, as I was doing some testing on my iBook (running OS 10.3.9), I was having problems with GvR not refreshing the screen properly. These rendering bugs were bad enough to make me consider either not using GvR on my Mac (not a good option), or spending some time figuring out the problem. After some investigation, I eventually narrowed the problem down to the version of wxPython I had installed (2.6, the latest at the time). It turned out the version of GvR I was using (GvR 1.2.1) required wxPythonOSX-2.5.2.7-panther-Py2.3 for my system. Installing that version fixed up the problems quite nicely. I thought I’d document this for my own use down the road, but also in case anyone else has run into a similar difficulty.

Blog at WordPress.com.