The Revolution Will Be Geotagged



Over the weekend I’ve been working on a Python for Series 60 project that I thought up a few days ago while exchanging information with Gustaf between Google Earth instances. It really should have hit me when Google Sightseeing packed its sights in to a KML file, but what can I say, I’m a little slow.

After sending a .kml file via email to Gustaf, I decided to take a look at what exactly made up a .kml file. I started to drool a little bit when I read the KML documentation. The first example is extremely simple yet there’s a lot of power behind it. A few lines of XML can tell Google Earth exactly where to look and what to look at.

Proof of Concept

With this simple example in mind, I started to prototype out a proof of concept style Python app for my phone. Right now everything is handled in a popup dialog, and for the time being I’m just going to save a .kml file and let you do with it as you please, but over the next few days I plan to re-implement the app with an appuifw.Form, get latitude and longitude information from Bluetooth GPS (if you’re so lucky), and work on smtplib integration so that the app can go from location -> write KML -> send via smtplib.

Rapid Mobile Development

When I say that I’ve been working on this app over the weekend, that’s not strictly accurate. I prototyped the proof of concept over about 20-30 minutes on Friday night using the Python for Series 60 compatability library from the wonderful folks at PDIS. I then spent the rest of some free time over the weekend abstracting out the KML bits and reverting my lofty smtplib goals to saving to a local file on the phone. I’m not sure if the problem is due to my limited T-Mobile access or if I need to patch smtplib in order to use it on my phone.

There’s also one big downside to trying to use smtplib on the phone, and that’s the fact that smtplib (and gobs of dependent modules) aren’t distributed with the official Nokia PyS60 distribution, so if I’m going to distribute this app with smtplib functionality, I’ll have to package up a dozen or two library modules to go with it. I’m going to mull it over for a few days and see if I can get past my smtplib bug or investigate alternatives.

from kml import Placemark

I’ve started a rudimentary Python kml library designed with the Series 60 target in mind. It’s rather simplistic, and so far I’ve only implemented the simplest of Placemarks, but I plan to add to it as the need arises. It should be quite usable to generate your own KML Placemark. Here’s a quick usage example:

>>> from kml import Placemark
>>> p=Placemark(39.28419, -76.62169, \
"The O's Play Here!", "Oriole Park at Camden Yards")
>>> print p.to_string()
<kml xmlns="http://earth.google.com/kml/2.0">
<Placemark>
  <description>The O's Play Here!</description>
  <LookAt>
    <longitude>-76.62169</longitude>
    <latitude>39.28419</latitude>
    <range>600</range>
    <tilt>0</tilt>
    <heading>0</heading>
  </LookAt>
  <Point>
    <coordinates>-76.62169,39.28419</coordinates>
  </Point>
</Placemark>
</kml>

Once I have my Placemark object, saving to disk is cake:

>>> f=open("camdenyards.kml", "w")
>>> f.write(p.to_string())
>>> f.close()

If you have Google Earth installed, a simple double click should bring you to Camden Yards in Baltimore. The simplicity of it and the “just works” factor intrigue me, not the fact that this can be accomplished in a few dozen lines of python but the fact that KML seems so well suited for geographic data interchange.

Camden Yards in Google Earth

It’s About Interchange

If you are really in to geographic data, and I mean so at an academic or scientific level, KML probably isn’t the format for you. You might be more interested in the Open Geospatial Consortium’s GML (Geography Markup Language). It looks like it does a great job at what it does, but I’m thinking that the killer format is aimed more at the casual user. KML is just that. From a simple Placemark describing a dot on a map to complicated imagery overlays, KML has your back covered. I find the documentation satisfying and straighforward, though I’m no expert on standards.

In the very near future conveying where you are or what you are talking about in a standard way is going to be extremely important. Right now there’s only one major consumer of .kml files and that’s Google Earth. Expect that to change rapidly as people realize how easy it is to produce and consume geodata using KML and .kmz files (which are compressed .kml files that may also include custom imagery).

I would love to see “proper” KML generators and consumers, written with XML toolkits instead of throwing numbers and strings around in Python. I would love to have a GPS-enabled phone spitting out KML using JSR-179, the Location API for J2ME. I hope to use Python for Series 60 to further prototype an application that uses a Bluetooth GPS receiver for location information and allow easy sharing of geodata using KML.

The Code

If you’d like, take a look at the current state my kml Python library, which is extremely simple and naive, but it allows me to generate markup on either my laptop or N-Gage that Google Earth is happy to properly parse. A proof of concept wrapper around this library can be found here. I hope to expand both in the coming days, and I hope to soon have the smtplib-based code working properly on my phone with my carrier.

Update: Oops, forgot to add the <name/> tag. Fixed. The name should now replace the (ugly) filename for your Placemark.

Comments

113 responses to “The Revolution Will Be Geotagged”

  1. blog Avatar

    I like the precious data you be offering for your articles. I can bookmark your blog and have my kids test up here generally. I’m slightly certain they’ll be informed numerous new stuff here than anyone else!

  2. hiCVJLEJ Avatar

    XPkLldD

  3. hazard Avatar

    “@Brujo89 with al pacino in the mix. its due to 2011”

  4. tum Avatar

    Many thanks for spending some time to talk about this, I feel strongly about it and love learning more about this topic. If at all, while you gain expertise, can you mind updating your website with extra information? It’s very great for me.

  5. payday loan uk Avatar

    happy new year

  6. The O Cloud Nine Avatar

    I picture this may well be diverse upon the written content material? however I nonetheless consider that it may be suitable for nearly any type of matter material, because it could ceaselessly be satisfying to decide a heat and delightful face or perhaps listen a voice while preliminary landing.

  7. best coloring pages Avatar

    Cool post cheers, needed a few more images though.

  8. rcmarket Avatar

    This is very interesting, You are a very skilled blogger. I have joined your rss feed and look forward to seeking more of your excellent post. Also, I’ve shared your website in my social networks!

  9. wczasy nad morzem Avatar

    Good job here. I actually enjoyed what you had to say. Keep going because you undoubtedly bring a new voice to this topic. Not many people would say what youve said and still make it interesting. Properly, at least Im interested. Cant wait to see much more of this from you.

  10. cheap bourgas holidays Avatar

    This content is so useful it is going straight to my facebook fanpage on the subject with a link back to your site. It’s a win-win situation for both. You get traffic and links and I get good content for my visitors.

  11. work family history Avatar

    Personally i think like I’m often in search of interesting things find out about a number of topics, but I seem to incorporate your blog among my reads every single day because you have compelling entries we anticipate. Here’s hoping there’s additional amazing material coming!

  12. decaptcha Avatar

    An impressive share, I simply given this onto a colleague who was doing a little bit evaluation on this. And he actually bought me breakfast because I found it for him.. smile. So let me reword that: Thnx for the deal with! However yeah Thnkx for spending the time to debate this, I really feel strongly about it and love reading more on this topic. If possible, as you grow to be expertise, would you thoughts updating your weblog with extra particulars? It’s extremely useful for me. Large thumb up for this blog publish!

  13. bangkok reseguide Avatar

    really enjoyed what you wrote . it really isn’t that simple to find good text toactually read (you know.. really READ and not just going through it like a zombie before going somewhere else), so cheers man for really not wasting my time on the god forsaken internet. 🙂

  14. stair elevator Avatar

    I recently found unbelievable blog not to mention I’ve got to believe this amazing can be a nice article post within the blog. Many thanks regarding this phenomenal material.

  15. Team Building Avatar

    Thank you for making the trustworthy attempt to explain this. I feel very sturdy about it and would like to learn more. If it’s OK, as you reach extra in depth wisdom, would you thoughts including more posts very similar to this one with more information? It will be extremely helpful and useful for me and my colleagues.

  16. Betfair Avatar

    I enjoy you because of all your effort on this blog. My mom loves managing investigation and it’s obvious why. My spouse and i hear all about the dynamic manner you deliver precious items via the web site and therefore strongly encourage response from visitors on the concept plus our princess is actually studying so much. Have fun with the remaining portion of the year. You’re conducting a tremendous job. Cya Betfair Bonus.

  17. gordonii Avatar

    I’d need to check with you here. Which isn’t something I normally do! I take pleasure in reading a put up that can make people think. Additionally, thanks for permitting me to comment!

  18. porno izle Avatar

    I started to follow your blog

  19. bobo rodregas Avatar

    Thank you for your help!

  20. lillie mcandrews Avatar

    It’s really a nice and helpful piece of information. I am glad that you shared this useful info with us. Please keep us up to date like this. Thank you for sharing.

  21. Jeanette Avatar

    Found your weblog and decided to have a study on it, I don’t always do this, but this blog is wonderful. Awesome to see a web site that isn’t full of spam, and actually makes some sense. Great job

  22. Hoodia gordonii Avatar

    An attention-grabbing discussion is value comment. I believe that it’s best to write extra on this topic, it won’t be a taboo subject but typically people are not enough to talk on such topics. To the next. Cheers

  23. tattoo ink Avatar

    For all the above commentors. Blogs may very well be greater to learn if you possibly could keep comments short in order to the point. No person loves to read huge comments as soon as the material might be conveyed with a smaller comment.

  24. Grafik komputerowy Avatar

    You can for sure see your skills in the work you write. The Europe hopes for more &moe passionate redactors like you who aren’t afraid to write how they believe. Always follow your heart. Grafik komputerowy.

  25. roleplay Avatar

    That is nice to definitely find a site where the blogger knows what they are talking about.

  26. wpolscemamymocneseo Avatar

    Hi there, just became alert to your blog through Google, and found that it is really informative. I’m going to watch out for brussels. I’ll be grateful if you continue this in future. Numerous people will be benefited from your writing. Cheers!

  27. computer forensics Avatar

    For all your above commentors. Blogs may be far better you just read if you’re able to prevent your comments short in order to the particular. No person likes to read huge comments as soon as the subject theme is usually conveyed employing a smaller comment.

  28. prezentacje maturalne Avatar

    Realy good work cheers mate!

  29. navy seals training Avatar

    Hello my friend! I wish to say that this post is awesome, nice written and include almost all vital infos. I would like to see more posts like this .

  30. Softwares and PC games for free Avatar

    you are really a good webmaster. The web site loading speed is amazing. It seems that you are doing any unique trick. In addition, The contents are masterwork. you have done a magnificent job on this topic!

  31. pozycjonowanie Avatar

    High birth is a poor dish on the table. – Italian Proverb

  32. budapest reseguide Avatar

    i have checked this blog a couple of times now and i have to say that i find it quite good actually. keep the nice work up! 😉

  33. betclic Avatar

    Excellent goods from you, man. I’ve understand your stuff previous to and you’re just extremely wonderful. I actually like what you have acquired here, really like what you are saying and the way in which you say it. You make it enjoyable and you still care for to keep it sensible. I can not wait to read far more from you. This is really a great site

  34. metasuchmaschine Avatar

    This really answered my downside, thank you!

  35. Wedding Rings Avatar

    Someone essentially help to make seriously posts I would state. This is the first time I frequented your web page and thus far? I amazed with the research you made to create this particular publish incredible. Magnificent job!

  36. meine webseite Avatar

    Great artical, had no problems printing this page either.

  37. Modeling Class Avatar

    Its Pleasure to go through your site.This articles is very impressive, and that i genuinely enjoyed reading your blog and points you expressed. I appreciate to reach retrace regularly,post regarding the subject.Many thanks for sharing…keep writing!!!

  38. Claiming PPI Avatar

    Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon.

  39. click here Avatar

    As far as me being a member here, I didnt even know that I was a member here. When the article was published I received a notification, so that I could participate in the discussion of the post, That would explain me stumbuling upon this post. But we’re certainly all intellectuals.

  40. adult dvds Avatar

    I do not mind sitting within my laptop computer and doing nothing but being impressed by how great and fantastic this web site of yours is. There’s no other site that keeps me glued for some time apart from yours. Please continue the good work!

  41. Dude Ranch Avatar

    it isn’t about african american and whitened its about ethics certain point he could be lacking. Its about honesty still one more attribute he is less than. He supplies the great unwashed plenty belonging to your US believing that they’ll all get zero expense health care. I get a pal that functions while in the effectively becoming business as nicely as morning appropriate right after this shithole payment handed down they became aligned your gate to obtain their insurance coverage a credit card. Really don’t these idiots recognize that it’s visiting require 4 an extensive time of many people obtaining taxed out our asses before they’re capable to fund this. It states this appropriate throughout the invoice that it will carry impression in 2014. The expense may not be repealed , a common situation which could perhaps be accomplished can be to vote republicans into place of work that could vote compared to financing this invoice

  42. free blog Avatar

    Thanks greatly with this great blog;here is the almost component that keeps me going by method of out my day. I’ve been wanting round in this site while i heard about it at a friendand was gladwhen I discovered it after looking it on googlefor lengthy time. Becoming a avid blogger, I’m blessed to find out others taking initivative and contributing to the community. I’d really like to comment to show my approval for the postas it’s very interesting, and many bloggers do not get the informationthey deserve. I’m positive I am backand will spread the phrase to all or any my local freinds.

  43. zero friction marketing Avatar

    You completed various nice points there. I did a search on the subject and found a good number of persons will go along with with your blog.

  44. decals Avatar

    really enjoyed the post that you wrote actually. it really is not that easy to discover great posts to read (you know READ and not just browsing through it like some zombie before going somewhere else), so cheers man for really not wasting any of my time! 😀

  45. opony Avatar

    Good job here. I actually enjoyed what you had to say. Keep going because you undoubtedly bring a new voice to this topic. Not many people would say what youve said and still make it interesting. Properly, at least Im interested. Cant wait to see much more of this from you.

  46. hair loss treatment Avatar

    I definitely need to revisit this website much more in future, facts like this is hard to come by..white iphonefreebiejeebies hair loss women google gadgets

  47. malignant mesothelioma Avatar

    Hi I reach your web site by mistake once i was searching bing because of this wii issue, I have to admit your website is really helpful Furthermore love the style, its amazing!. I dont have so much time for them to read your complete post at this time but We have bookmarked your web site and also enrolled in your Nourishes. I will be the government financial aid in one day. appreciate your a terrific site. They could n’t need to drive around searching for a parking spot when there are numerous tenants while in the same complex.

  48. duphaston grossesse Avatar

    For want of a nail the shoe was lost; for want of a shoe the horse was lost; and for want of a horse the man was lost

  49. home Avatar

    This was very informative. I have been reading your blog alot over the past few days and it has earned a place in my bookmarks.

  50. business loans Avatar

    There are some interesting points in this article but I don’t know easily see them all heart to middle . You can find some validness but Let me take hold judgment until I take a look at it further. Good clause, thanks therefore we want more! Put into FeedBurner as well.