Andrew Powell

Into The Mind of A Solutions Architect

Andrew Powell

Entries Tagged as MapQuest

SpatialKey Hitting The Big Time

September 05, 2008 · No Comments

This month's issue of ComputerWorld contains a cover story titled: "Can Web 2.0 Save BI?".  SpatialKey is featured on the cover of the issue as part of the article!  The article goes into depth about how the Ogden Police Department is using Web 2.0 (SpatialKey Law Enforcement, in particular) to analyze data in seconds, rather than days.  Doug and Ben go into this article in a bit more detail if you want to learn more about it.  

Anyway, here is the cover:

ComputerWorld Cover Featuring SpatialKey

No CommentsTags: MapQuest · Cairngorm · Java · ColdFusion · Flex · General · BlazeDS · Spring · Adobe · Universal Mind · Hibernate · AIR

Live GPS Visualizations With AIR & Merapi

August 23, 2008 · 8 Comments

So, my co-worked Adam Flater started up the Merapi Project a while back and asked me to contribute. Up until now, the only thing I've had time to contribute was the name. Well, after seeing the cool stuff that he and Jordan were doing at 360|Flex, I decided it was time to step up to the plate, get my shit together, and produce my own kick-ass Merapi demo.

Anyone who has been following the blogs knows that we at UM are real big into GIS and data visualization. Don't believe me? Take a look at SpatialKey to see what we can do with it.

I recorded a screencast where I walk you through the setups and the code of the application:

Java Code:

package com.universalmind.merapi;
import gnu.io.CommPort;
import gnu.io.CommPortIdentifier;
import gnu.io.NoSuchPortException;
import gnu.io.PortInUseException;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.IOException;
import com.diddlebits.gpslib4j.GPS;
import com.diddlebits.gpslib4j.IDate;
import com.diddlebits.gpslib4j.IGPSlistener;
import com.diddlebits.gpslib4j.IPosition;
import com.diddlebits.gpslib4j.ITime;
import com.diddlebits.gpslib4j.Position;
import com.diddlebits.gpslib4j.PositionRadians;
import com.diddlebits.gpslib4j.Garmin.GarminGPS;
import merapi.Bridge;
import merapi.MerapiObject;
import merapi.messages.Message;
public class GPSReader extends MerapiObject implements IGPSlistener{
   GPS gps;      
   Position position = null;
   IPosition current = null;
   BufferedInputStream input;
   BufferedOutputStream output;
   
   public Bridge bridge;
   
   public static void main( String[] args )
   {
      
      new GPSReader();
   }
   
   public GPSReader()
   {
      super();
      
      bridge = Bridge.getInstance();
      
      CommPort port;
      
      try {
         port = CommPortIdentifier.getPortIdentifier("/dev/tty.USA19H1d1P1.1").open("GPSReader", 3000);
      } catch (NoSuchPortException e) {
         System.out.println("/dev/tty.USA19H1d1P1.1 not found!");
         return;
      } catch (PortInUseException e) {
         System.out.println("Port already in use by " + e.currentOwner);
         return;
      }
      
      try {
         input = new BufferedInputStream(port.getInputStream());
         output = new BufferedOutputStream(port.getOutputStream());         
      } catch (IOException e) {
         System.out.println("Error opening /dev/tty.USA19H1d1P1.1");
         return;
      }      
            
      gps = new GarminGPS(input, output);
      gps.setAutoTransmit(true);
      gps.addGPSlistener(this);
      
   }
   
public double getLat() {return __lat;}
   public void setLat(double lat) {
      this.__lat = lat;
   }
   public double getLon() {return __lon;}
   public void setLon(double lon) {
      this.__lon = lon;
   }
   public String getTime() {return __time;}
   public void setTime(String time) {
      this.__time = time;
   }
   public String getDate() {return __date;}
   public void setDate(String date) {
      this.__date = date;
   }
   
   public void dateReceived(IDate d) {
      String dateString = d.getMonth() + "/" + d.getDay() + "/" + d.getYear();
      System.out.println(dateString);
      this.setDate(dateString);
   }
   public void positionReceived(IPosition pos) {
      current = pos;
      this.setLat(toDecimalDegrees(current.getLatitude()));
      this.setLon(toDecimalDegrees(current.getLongitude()));
      Message message = new Message();
      GPSPoint point = new GPSPoint();
      point.lat = this.getLat();
      point.lon = this.getLon();
      point.date = this.getDate();
      point.time = this.getTime();
      message.setData(point);
      try {
         bridge.sendMessage(message);
      } catch (Exception e) {
         
         System.out.println(e.getMessage());
      }
      
   }
   public void timeReceived(ITime t) {
      String timeString = t.getHours() + ":" + t.getMinutes() + ":" + t.getSeconds();
      this.setTime(timeString);
      System.out.println(timeString);
   }
   
   private double toDecimalDegrees(PositionRadians rads){
      return Math.toDegrees(rads.getRadians());
   }
   
   private double __lat = 0;
private double __lon = 0;
private String __time = "";
private String   __date = "";
}

8 CommentsTags: Merapi · MapQuest · Java · Flex · General · Adobe · Universal Mind · MapMyPix · AIR

GeoTwitter Alpha 1 Release

April 23, 2008 · No Comments

Download GeoTwitter(AIR Application - 417KB)

I had been messing around with building a geocoding Twitter app for a while, but had neglected the code for a while. The release of Twittearth made me get off my butt and get something done with this project.

I finally put together something I could call an alpha release that I can put out there to show where it's going. At its heart, GeoTwitter is a mashup of the Twitter, MapQuest, and Yahoo Maps APIs. Eventually, I would like to turn this into a full-blown Twitter client, but this is the first step.

You may ask "Why use both the MapQuest and Yahoo Maps APIs?" Well, the answer is simple: geocoding. I love the way the the MapQuest TileMap Component works. I'm not such a big fan of Yahoo's map component. On the other hand, I think Yahoo's geocoding far exceeds MapQuest's. Any geocoding service gives you back latitude/longitude in some format, you just have to get the values out of the response. Those values are used to plot a point on the map, any map. In this case, the MapQuest TileMap Component. So, there is a bit of method to the madness. You could just as easily use any other geocoding service to get your lat/lon pair. You could also flip the tables and use Yahoo's map and MapQuest's geocoding, if you wanted to, to achieve the same result.

Go download the app, play with it, break it, and let me know about any bugs or features you want to see.

UPDATE: You can view the source and tweak it yourself at GeoTwitter's Google Code Site

Download GeoTwitter(AIR Application - 417KB)

No CommentsTags: MapQuest · Flex · General · Universal Mind

I Think I Won The 360|Flex API Contest: Ribbit Category

April 10, 2008 · 5 Comments

I talked to John & Tom over at 360 Conferences asking what the outcome of the API Contest was....  They told me I didn't win.  Well damn, I had pimped the hell out of my entry.  Oh well.  I went on with my day, a bit disappointed and resolved to the staking out of Target to buy a Wii.... If they're ever in stock. 

Well, fast forward to today when Ben Clinkinbeard IMs me and asks me if my name is Tony Fendall. I was puzzled, to say the least, so he gave me a link to the contest winners.

Looks like my app, but not my name. So I think I won the contest for the Ribbit category. Stay tuned to see what really happened.

 

P.S.  I don't know who you are Tony, but I'm sure you're a nice guy and a damn fine developer too.

[UPDATE]  It was a typo, and I did, indeed, win the Wii. 

5 CommentsTags: MapQuest · ColdFusion · Flex · General · Conferences · Adobe · Universal Mind · KayakAPI

MapQuest Love

April 04, 2008 · No Comments

So, as you all know by now, I have absolutely no problem with shameless self-promotion. I got some great love from MapQuest on their developer blog. Click the link, go look at the post, and then go vote for me in the 360|Flex API Contest.

No CommentsTags: MapQuest · Flex · General · Adobe · Universal Mind · KayakAPI