Saturday, October 24, 2009

Using JAK and Google Geocoder

In a previous post I mentioned that I would be doing some experimenting with the JAK - Java API for KML. I have now created a simple program that creates a KML file using co-ordinates obtained from calling the Google Geocoder.

If you wish to review the whole program I have made it available here (4mb).

The main parts of the code are as follows:

GeoCoder class
  • converts a street address into a longitude/latitude point.
  • call getLocation method with a string representing the address.
  • class uses Google Geocoder.

Refer to the Geocoder.java class file in the download for more information on how this works.



Main Class
  • assigns an address from the first command line argument
address = args[0];
  • calls the GeoCoder.getLocation method with Address String
location = Geocoder.getLocation(address).toString(); 
  • creates a KML file using the location value returned by the GeoCoder class
final Kml kml = new Kml();
kml.createAndSetPlacemark()
   .withName(address)
   .withOpen(Boolean.TRUE)
   .createAndSetPoint()
   .addToCoordinates(location);

try {
kml.marshal(new File("HelloKml.kml"));
} catch (FileNotFoundException ex) {
     Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}

In the future I will expand on this application to provide more information in the KML.

Sunday, October 11, 2009

Egreat EG-M31B Network Media Tank

The Egreat EG-M31B is a Network Media Tank (NMT). A NMT is a network attached device that also has connections for output of media to display devices such as HD TV Panels and CRT devices.



The Egreat M31B is a NMT based upon the firmware of the Popcorn Hour A1XX series and implements all of the functions of this player as well as an eSata port for the connection of external hard drives at SATA speeds.

For full details of the specifications of the player see the Egreat website.

Part of the appeal of the NMT devices is the active development community that surrounds them. The centre of this community is the NetworkMediaTank site. This site provides support for all aspects of the devices, but in particular provides a forum to discuss plugins, extensions and themes for the device.

The easiest way to make use of the more popular 3rd party applications is to download and install the NMTInstaller. The NMT Installer takes the hard work out of installing 3rd party applications such as Jukeboxes, Webserver, Automatic Downloaders, Themes and Web Services.

Development on this platform is in PHP, Javascript or in C directly on the device. Further details can be found on the NMT Wiki.

Friday, October 9, 2009

JAK - Java API for KML

In a previous blog post I showed how it was possible to take information recorded by a GPS device and mobile phone and plot the resulting track using Google Maps.

Recently, I found a link to a JAVA API that allows you to interact with the KML files produced by the process using a JAVA application.

The project aims to provide an

"automatically generated full reference implementation of the KML object model defined by OGC’s KML standard and Google’s GX extensions. It is an object orientated API that enables the convenient and easy use of KML in existing Java environments."
Over the next couple of weeks I am going to do some experimentation using this API and try and develop some simple applications to take GPS tracks from Nokia Sports Tracker and my GPS and create interesting KML files.

Stay tuned...