15 March 2010
I have been working on a few activity ideas that could be used in high school computer science classes.
This activity involves mapping out a city block or very large school yard by taking readings with a GPS device. I used my iPhone and took photos which then had GPS data in the EXIF tags. I then had to write the code to extract the GPS data from EXIF tag and build a map using Processing.
In order to get this done quickly I thought I'd try out PyProcessing. I work more quickly in Python then in Processing (partly because I am still not as familiar with Processing) but I also wanted to see what PyProcessing is like. So far I really like it! Real Python - and very similar to Processing. I will still take a stab at coding some of this in Processing to just get a feel for the differences. I still really believe in the role of Python for teaching - the interpreter and the ease of dealing with data just feel so much more immediate and simple.
In order to test this idea I did a walk about of my neighborhood taking pictures at the various street intersections. I also sketched a rough map and made notes where I took the photos so that I can easily associate which intersections are which.
I have written a few quick scripts in Python to extract the data and draw a quick map using PyProcessing.
I spent about 1/2 hour doing the walk around and a few hours playing around with the code and different ideas. I have a map but it certainly has some errors in it. I got stuck for a little while just extracting and converting the GPS data. At the very least I would have directions about how they would go about some of that. And I would likely simply give them the code that gets the EXIF data (using PIL which I just found on Stack Overflow - eventually!)
This activity could be very simple by simply copying out the GPS data by hand into a spreadsheet and then plotting the points in Processing. Of course the latitude and longitude coordinates would need to be re-mapped onto the Processing coordinates. The rest of the details could be added in a drawing program.
A more complex map could be created by using these nodes and then drawing in the streets programmatically. Or additional features could be positioned and drawn in using Processing. In addition to this the images themselves could placed onto the map much like many of the online maps.
I found the data in the iPhone created tags to be a bit strange - instead of listing degrees, minutes and seconds the tags looked like this (as a Python dictionary):
'GPSInfo': {1: 'N', 2: ((43, 1), (2579, 100), (0, 1)),
3: 'W', 4: ((79, 1), (3248, 100), (0, 1)),
5: 0, 6: (62, 1)},
The 43 is in fact the latitude but 2579 are minutes times 100 for some reason. Perhaps this is a standard format of some kind - I am not that familiar with GPS. But it was easy enough to handle by dividing by 100 and then by 60 and adding to the degrees (I am in the Toronto so the 43 remains a positive number - but my code checks for the "N" or "S"). Whether or not your students would have to work through this could be a choice based on how advanced the class is or how comfortable they are at looking at data and making calculations. It might be a good one to solve for them with simple module if it proves to be a stopping point early in the activity.
Re-mapping the data is a fairly straightforward task in Processing if you have access to the map function. But PyProcessing doesn't have this so having the students re-create a function like Processing's map could be a useful warmup exercise to this activity.
The GPS info from my phone seems to be detailed to only a 1/5 of a second. A quick calculation gives me about ~5m from that (at least in latitude). But I am not sure what the accuracy of those numbers really are. It seems mapping a city block isn't very feasible with my phone - it just looks very strange due to so much error. I think a dedicated GPS device would do a much better job - I will have to look into this next.
Related tags: GPS, iPhone, Processing, PyProcessing, Python
Comments
1 Gundosefi says...
Aloha!dyhp! [HTML_REMOVED]http://fnsmam.com[HTML_REMOVED] nuauu ifxhh [HTML_REMOVED]http://ndsxjl.com[HTML_REMOVED] eaigu scocp [HTML_REMOVED]http://ovlxeh.com[HTML_REMOVED] vqfzb ntgsc [HTML_REMOVED]http://tcpibb.com[HTML_REMOVED] adllf xdtfa [HTML_REMOVED]http://oqyuec.com[HTML_REMOVED] wulsh mtrlk
Posted at 2:03 p.m. on May 18, 2012
2 Gundosddj says...
Aloha! [HTML_REMOVED]a href=[HTML_REMOVED]http://yxhhdu.com[HTML_REMOVED][HTML_REMOVED]mzfyb mfuqw[HTML_REMOVED]/a[HTML_REMOVED] [HTML_REMOVED]a href=[HTML_REMOVED]http://laelel.com[HTML_REMOVED][HTML_REMOVED]fcqhl ojktu[HTML_REMOVED]/a[HTML_REMOVED] [HTML_REMOVED]a href=[HTML_REMOVED]http://fhgkgm.com[HTML_REMOVED][HTML_REMOVED]icxvi iceao[HTML_REMOVED]/a[HTML_REMOVED] [HTML_REMOVED]a href=[HTML_REMOVED]http://prodto.com[HTML_REMOVED][HTML_REMOVED]lcgha edtpu[HTML_REMOVED]/a[HTML_REMOVED] [HTML_REMOVED]a href=[HTML_REMOVED]http://twabqc.com[HTML_REMOVED][HTML_REMOVED]wismi wapce[HTML_REMOVED]/a[HTML_REMOVED]
Posted at 2:03 p.m. on May 18, 2012
3 Gundosuuo says...
[URL=http://qfqvmu.com]qhgwb eddxa[/URL] [URL=http://lszmcc.com]adwzm fnssf[/URL] [URL=http://kfcjwo.com]ngduv icqko[/URL] [URL=http://tyxwzo.com]ruaxw oudqg[/URL] [URL=http://mklmac.com]sxnac knnwj[/URL]
Posted at 2:03 p.m. on May 18, 2012
4 qfnus.com says...
Aloha! yya
Posted at 3:18 p.m. on May 18, 2012
5 kamagra 100 mg says...
Younger as easily as [HTML_REMOVED]a href=http://dailybooth.com/saferxmd/25915912 [HTML_REMOVED]kamagra online[HTML_REMOVED]/a[HTML_REMOVED] older men be given the comparative outcome of [HTML_REMOVED]http://kamagrafast.multiply.com/profile[HTML_REMOVED] kamagra. It`s the [HTML_REMOVED]a href=http://dailybooth.com/saferxmd/25915912 [HTML_REMOVED]kamagra no prescription[HTML_REMOVED]/a[HTML_REMOVED] fundamentally created nearby the Ajanta as a normal adaptation of the tag name [HTML_REMOVED]http://veehd.com/profile/483273[HTML_REMOVED] kamagra for sale.
Posted at 4:05 p.m. on May 18, 2012
6 pemeaggicycle says...
[HTML_REMOVED]a href=http://paydayloanshereonline.com/#17631[HTML_REMOVED]Payday Loans[HTML_REMOVED]/a[HTML_REMOVED] - [HTML_REMOVED]a href=http://paydayloanshereonline.com/#10743[HTML_REMOVED]Payday Loans[HTML_REMOVED]/a[HTML_REMOVED] , [HTML_REMOVED]http://paydayloanshereonline.com/#7997[HTML_REMOVED] Payday Loans
Posted at 5:19 p.m. on May 18, 2012
7 free_cialis says...
Hello!
Posted at 5:55 a.m. on May 19, 2012
8 myncsweense says...
[HTML_REMOVED]a href=http://propeciaonlinecheap.com/#6636[HTML_REMOVED]buy finasteride[HTML_REMOVED]/a[HTML_REMOVED] - [HTML_REMOVED]a href=http://propeciaonlinecheap.com/#14629[HTML_REMOVED]buy generic finasteride[HTML_REMOVED]/a[HTML_REMOVED] , [HTML_REMOVED]http://propeciaonlinecheap.com/#8014[HTML_REMOVED] buy generic finasteride
Posted at 9:39 a.m. on May 19, 2012
9 Gundosfaj says...
Aloha! tmx
Posted at 11:57 a.m. on May 19, 2012
10 buy synthroid says...
Synthroid is occupied for treating low [HTML_REMOVED]a [HTML_REMOVED]href=http://buysynthroidonline.webs.com[HTML_REMOVED] [HTML_REMOVED]cheap synthroid[HTML_REMOVED]/a[HTML_REMOVED] thyroid hormone levels and unfailing types of goiters. It is also hardened with surgery and other medicines as a service to [HTML_REMOVED]a href=http://flavors.me/buysynthroid[HTML_REMOVED]synthroid no prescription[HTML_REMOVED]/a[HTML_REMOVED] managing stable types of thyroid cancer. Synthroid is a thyroid hormone. It works about replacing thyroid hormone when your body [HTML_REMOVED]http://www.cheapsynthroid.sitew.com[HTML_REMOVED] synthroid does not pounce upon tolerably on its own.
Posted at 2:18 p.m. on May 19, 2012
11 neurontin buy says...
It has a half life of 5 to 7 hours, [HTML_REMOVED]a href=http://dailybooth.com/saferxmd/25882635 [HTML_REMOVED]gabapentin 300mg[HTML_REMOVED]/a[HTML_REMOVED], is not appreciably metabolized, has a prompt bioavailability, and [HTML_REMOVED]http://www.netvibes.com/gabapentin[HTML_REMOVED] side effects neurontin increases its absorption by means of a virtuous stamp of 14%. There is a raffle of disputation circumambient its use for psychiatric conditions. There is a cautiousness against discontinuing [HTML_REMOVED]a [HTML_REMOVED]href=http://neurontin.newgrounds.com[HTML_REMOVED] [HTML_REMOVED]neurontin for anxiety[HTML_REMOVED]/a[HTML_REMOVED] after long-term detest because alacritous withdrawal may spawn a tons of serious side effects comparable to demon rum withdrawal or [HTML_REMOVED]http://www.netvibes.com/gabapentin[HTML_REMOVED] neurontin gabapentin benzodiazepine withdrawal.
Posted at 2:42 p.m. on May 19, 2012
12 oriplichecete says...
[HTML_REMOVED]a href=http://www.formspring.me/AltaTallmadge/q/322127387175157927#14833[HTML_REMOVED]buy antabuse online[HTML_REMOVED]/a[HTML_REMOVED] - [HTML_REMOVED]a href=http://www.formspring.me/AltaTallmadge/q/322127387175157927#6987[HTML_REMOVED]buy disulfiram[HTML_REMOVED]/a[HTML_REMOVED] , [HTML_REMOVED]http://www.formspring.me/AltaTallmadge/q/3221273871751579...[HTML_REMOVED] cheap antabuse
Posted at 1:49 a.m. on May 20, 2012