Status

Location
Arlington, VA
Subscribe to GeoRSS Subscribe to KML


Geolocation

GreaseRoute - Mapping the web

Published in Geolocation, Google, Howto, Javascript, Maps, Open-Source, Programming, Technology, Web


I’ve been fairly quiet for the past couple of weeks. I’ve been focused on some projects, including entries to the MapQuest OpenAPI developers’ competition.

One of my entries, which may or may not actually be considered a “mashup”, is a Firefox GreaseMonkey script called GreaseRoute that creates map and route icons for an Microformat formatted adr or geo locations. These are often used in an hcard.

One of the cooler parts is that the extension automatically determines the location of the person viewing the page. Using the HostIP IP-to-Location database, the user’s location is automatically entered as the starting location. So when a user is viewing the webpage of, for example, a store or business, they can click the “route” link and get turn-by-turn directions to that location. No more copy & pasting street/city/state to a form or asking the person next to you “where are we?”

Microformats are a stepping stone on the way to the semantic web. They are a simple way to encode useful information for viewing and mining by users and other applications (ala mashups).

Example adr

The proper format of the adr is as follows:

<div class="adr">
 <div class="street-address">1517 N. Main St.</div>
 <div class="extended-address">Box 203</div>
 <span class="locality">Royal Oak</span>,
 <span class="region">MI</span>
 <span class="postal-code">48067</span>
 <div class="country-name">US</div>
</div>

which will then be displayed as:

1517 N. Main St.
Box 203

Royal Oak,
MI
48067

US

Example geo

Instead of an address, one can instead just encode the latitude and longitude:

N 37° 24.491
W 122° 08.313

The Result

GreaseRoute has 2 version, the lite version and the embed version. The lite version displays a map and route icon next to the addresses found on the webpage:

The embed version displays a “route” link. When clicked, a pop-up map is displayed between the users location and the encoded address.

Give GreaseRoute a try and let me know what you think.

You can also go over to Userscripts.org, the GreaseMonkey script repository, and rate them and leave comments.


Javascript XML parsing for GML and you

Published in Geolocation, Howto, Javascript, Programming


You find the need to determine the locations of your visitors, and you wonder how to do this? Surely it’s impossible. Alas, it is not. Services like HostIP provide the ability to locate your users given their IP address. The slick way to do this is via javascript. Unfortunately, the HostIP API doesn’t provide a JSON interface.

But of course, the response is in XML, so you’re also wondering how to parse this XML response for something meaningful? The answer is the DOMParser and namespaces. There is a really nice function, getElementsByTagNameNS that allows you to parse out elements given a namespace. I kept trying getElementsByTagNameNS("gml","name"), which didn’t work. The answer seems to be that you need to include a valid uri for the namespace.

var dom = new DOMParser ( ) .parseFromString ( responseText,
                            "application/xml" ) ;

var location = dom.getElementsByTagNameNS (
   "http://www.opengis.net/gml", "name" ) [1].firstChild.data
    if location == " ( Unknown city ) "
        return "";


Plazes API

Published in Geolocation, Maps, Open-Source, Programming, Technology, Web


Plazes, a very nice user-location mapping site, has released a API for all your mashup/application consumption. Announced here

With all these API’s I wonder about conflicts of licensing and terms. They all have their little niggles: no realtime, no commercial use, limited number of queries, limited by directory, etc. etc. I have a feeling people are going to break lots of these terms without realizing it. Of course, the data originators probably won’t mind until either their servers start getting crushed, someone tries to sue them for bad data, or the masher makes serious bank.

Other Quicky Links:


Rails Model Location functions

Published in Geolocation, Open-Source, Programming, Ruby


I put up some code snippets for a Location model in a Rails application. They include simple things like:

  • degree< ->radians conversions
  • distance between two locations
  • Min/Max latitude & longitudes given a location and radius
  • Database queries for locations in a given range from a center point

Essentially they’re making up for not have a true GIS interface to the database running PostgreSQL and PostGIS.

Most of the functions actually came from another project, but I unfortunately lost the note, so if you can properly id the originator of some of the functions, please do!


Homebrew fleet tracking

Published in Engineering, Geolocation, Mobile


On the geowanking mailing list (a discussion group for various gps, geolocation, and tracking ideas) a question was asked regarding how to make a DIY fleet tracking to be used at Burning Man.

Ok. need to throw together a system to track multiple cars around burning man from a mobile command car.

Wroking on command car software and hardware now. Have never used GPS at the playa. Worked a good bit with GPS years ago on robots.

Quick start with command car: (is this acceptable, better ideas?)

1. Purchase NMEA module like the GPS25-LVS.
2. Acquire attenna (any recomendations).
3. Wire up everything.
4. Connect module serially to computer.
5. Write software.

Ok, any flaws with the previous.

No assuming similar computers on the other cars, just need to get the gps position back to the command car. Good recommendation for PTP serial links that will span the playa? Maybe a network system (not PTP) like 802.11, then only one antenna on command center instead of one per client.

Now, for accuracy may need differential. Stationary base station with same PTP communications to command car.

The big problems are that you cannot rely on having cell towers (for mobile/sms), power may be limited, location needs to be fairly exact, so some sort of differential or WAAS is necessary.

Several options have been suggested:

Garmin Rino
a GPS-enabled handheld that integrates radio functionality to provide two-way communications. The Hardware Hacking Projects for Geeks book goes through how to build your own
Mologogo
Built-in cellphone location tracking using Nextela or Boost Mobile phone (Best Buy sold it for $45)
OpenTracker
an open-source hardware that connects GPS over serial link to APRS, a radio system for transmitting location and location information. However, this requires a HAM radio license. Kenwood TH-D7AG
FindU
a website and system for uploading and sharing APRS location information
Walkie-talkies
since there is no cell or necessarily wifi - hook up computers to walkie-talkies and somehow audio-encode/decode the information
Local Wifi
Put a wifi station on the command vehicle and possible others around burning man. Setup a local Wifi network and transmit GPS location information as well as possibly use the Wifi signals as differential correction

It will be interesting to see what works in the end for fleet tracking in such a remote location.