Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2005

Tip: Looking for answers? Try searching our database.

passing instructions to Google Earth through Java

Thread view: 
matthewburton@gmail.com - 11 Nov 2005 03:21 GMT
Hi,

I'm a student trying to build a system that controls Google Earth
through alternative input devices. I want to use Java to listen to my
serial port, translate the data into XML (with the help of the Google
Earth API), and pass this XML to Google Earth with instructions to
change its view according to the XML. Is it practical to tell an
outside application to take instructions from a Java program? Any
suggestions on how to do so or ideas for other approaches would be very
helpful. This whole idea might seem odd, but I'm doing it mainly to
learn the inner workings of GE and pick up some new Java skills, not to
build a marketable device, so it's fine if it turns out clunky.

thanks,
Matt
Andrew Thompson - 11 Nov 2005 04:08 GMT
> I'm a student trying to build a system that controls Google Earth
> through alternative input devices. I want to use Java to listen to my
> serial port, ...

What special significance is the serial port?

>...translate the data into XML (with the help of the Google
> Earth API), and pass this XML to Google Earth with instructions to
> change its view according to the XML.

According to this,
<http://www.keyhole.com/kml/kml_tut.html>
the Google Earth API can be configured by XML in the
form of a KML file.  The last section refers specifically
to the mime-types that need to be configured for the server,
so that the client system recognizes the content correctly
(and takes the appropriate action, such as open 'Google Earth'
with the file).

That suggests that Google Earth is designed to be externally
configured in ways that are simpler than direct interaction
via the serial port.
matthewburton@gmail.com - 11 Nov 2005 04:50 GMT
Thanks, Andrew. I'd read the KML docs, but the implication of the last
paragraph didn't dawn on me until now.

I want to use a joystick to control Google Earth navigation. The
significance of the serial port is that my class has done lots of
labwork with serial output through variable resistors and PIC
microchips. My first thought was to let the joystick's two
potentiometers fill the role of the variable resistor. I would then
debug the joystick's output and write a Java program that translates
this output into GE-relevant values.

> That suggests that Google Earth is designed to be externally
> configured in ways that are simpler than direct interaction
> via the serial port.

If I can find an easier way to do this, my professor would probably be
open to it. But I don't see how I'm gonna get around the serial port.
JScoobyCed - 11 Nov 2005 07:17 GMT
> If I can find an easier way to do this, my professor would probably be
> open to it. But I don't see how I'm gonna get around the serial port.

There is the Java Communication API that can be used to read/write
from/to serial and parallel ports. But it needs to obey the standard
protocols.
If your joystick follows the serial communication protocol (RS-232),
then you can send binary data to the serial port, which can be read from
Java and then translated to KML.

Signature

JSC

Dag Sunde - 11 Nov 2005 08:02 GMT
> Thanks, Andrew. I'd read the KML docs, but the implication of the last
> paragraph didn't dawn on me until now.
[quoted text clipped - 13 lines]
> If I can find an easier way to do this, my professor would probably be
> open to it. But I don't see how I'm gonna get around the serial port.

So what you want is to start GE and your app. with GE showing some default
point.

When you move your joystick, you want GE to pan the map-picture N/S/E/W?

If so, Your app must know the start coordinates (Can probably get
this info from GE via KML).

Then you need to poll your joystick, registering the direction of motion,
scale/translate the joystick values into offsets from the original
coordinate (lat/lon).

Calculate a new absolute coordinate (lat/lon), and send these to GE as an
KML file.

(If I understood you correctly, that is)

Signature

Dag.

matthewburton@gmail.com - 13 Nov 2005 01:41 GMT
Dag, both you and JSC have the right idea. Thanks for your ideas.

Translating the serial data into XML strings won't be a problem. What
I'm unsure of is how to write these strings to a file. My default
coordinates are in an existing KML file, and I just want to tell Java,
"replace those coordinates with the ones I just created."

It's essential that the program be able to do update the data
perpetually, with every move/click on the joystick.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.