External control of OSSIMPlanet

A while back Mark Lucas took me through a demonstration of the sort of peer-to-peer communication capabilities of OSSIMPlanet. Little known to me after turning on a few check boxes in the preferences (and opening TCP ports in your firewall) it will let you share what you are viewing with others. It can even syncronise the WMS layers the source has loaded. It was really exciting to see this sort of collaborative viewing experience turning into reality.

As mentioned in my last post I'm keen to interface some custom hardware as input into a 3D platform, OSSIMPlanet of course comes to mind first. Fortunately this can be done very easily using the same communication protocols that enable multiple instances to share their viewing information. In OSSIMPlanet Preferences you set a Listener port, with Type = Data, then in your favourite scripting language, connect to it through the TCP socket.

http://spatialguru.com/files/ossimpref2.jpg

I used a simple Python script to send camera location details to the viewer (aka navigator). You can also use the Broadcast feature and connect to it (I did it using UDP) to read examples of the type of XML the Listener expects.

The script worked well, moving the view to my specified coordinates and altitude:

import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("127.0.0.1", 5000))
data = '<Set target=":navigator" vref="wgs84"><Camera><longitude>-121</longitude><latitude>52</latitude><altitude>20000000</altitude><heading>0</heading><pitch>0</pitch><roll>0</roll><altitudeMode>absolute</altitudeMode></Camera></Set>'
s.send(data)

Now things will start to get fun...

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.