Board index FlightGear Development New features

Java Mapping Utility

Discussion and requests for new features. Please note that FlightGear developers are volunteers and may or may not be able to consider these requests.

Java Mapping Utility

Postby cnovak » Mon Feb 09, 2009 1:41 pm

Hello,

I'm not sure whether this is the right subforum, but I have written a small mapping utility similar to Atlas. It parses the NavAid and Fixes files of an existing Flightgear installation and displays them as an overlay on a map from the openstreetmap project. The program listens on port 5500 (the same as Atlas) for nmea packets from FighGear and displays the current plane location on the map. The airport file of FlighGear can be searched and specific information about an airport can be displayed (in a textfield).

The current version can be downloaded from

http://jmapview.sourceforge.net/

It is still in beta stage (but should work nevertheless), so please report any errors/ideas/requests for enhancements to me :-)

Regards,

Clemens
cnovak
 
Posts: 8
Joined: Wed Jun 11, 2008 2:38 pm

Re: Java Mapping Utility

Postby frozen » Mon Feb 09, 2009 2:51 pm

Hello Clemens,

I had a look at it for some minutes (sorry, couldn't look longer) and found out it worked quite easy. Change the paths, launch it - there you are. Great! Just two things: Would it be possible to draw a little plane symbol at the center? It's not necessary, but it would add to being able to recognise ones position before taking off. ;) And the other thing: After some minutes, flightgear dropped to a framerate of 0 and jmapview no longer reacted on anything, not even on the request to close it! Maybe this is a problem of my machine though... ;)

So: thank you very much, I like this tool! The maps look good and the program is simple to use. Maybe one could extend it, but it's already very fine!

Kind regards,

frozen
frozen
 
Posts: 33
Joined: Fri Jan 30, 2009 2:43 pm

Re: Java Mapping Utility

Postby brisa » Tue Feb 10, 2009 3:01 pm

very good work :D

And since I mostly use java (With netbeans) as program language I am happy to see a project I can put my hands in (I mean I can help).

Jsut some question, it seems to me that the map that are shown are from google, is there any way to sue maps from osm ?
Last edited by brisa on Tue Feb 10, 2009 5:50 pm, edited 1 time in total.
User avatar
brisa
 
Posts: 268
Joined: Fri May 16, 2008 8:32 pm
Location: Olgiate Comasco (CO) Italy
Callsign: brisa

Re: Java Mapping Utility

Postby Gijs » Tue Feb 10, 2009 3:23 pm

brisa wrote:it seems to me that the map that are shown are from google, is there any way to sue maps from osg ?

>>>
and displays them as an overlay on a map from the openstreetmap project.


Nice tool! A link on the FlightGear mainpage won't be a mistake (Curt!) ;)
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9544
Joined: Tue Jul 03, 2007 3:55 pm
Location: Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: Java Mapping Utility

Postby Groucho » Tue Feb 10, 2009 9:51 pm

cnovak wrote:Hello,

I'm not sure whether this is the right subforum, but I have written a small mapping utility similar to Atlas. It parses the NavAid and Fixes files of an existing Flightgear installation and displays them as an overlay on a map from the openstreetmap project. The program listens on port 5500 (the same as Atlas) for nmea packets from FighGear and displays the current plane location on the map. The airport file of FlighGear can be searched and specific information about an airport can be displayed (in a textfield).


Fabulous.

The only thing I noticed: The map does not resize when the window is maximized.
_____________________________________
Callsign: D-HARP
Flight locations: TNCM, TKPK, EDNY, LOWI
Aircrafts
Helis: EC130, Bo105, UH-1, R22
Twins/Jets: Aerostar, CRJ-200
User avatar
Groucho
 
Posts: 1212
Joined: Sun Jun 17, 2007 11:28 am
Location: Airborne Lake Constance/Germany
Callsign: D-HARP
Version: GIT
OS: Kubuntu

Re: Java Mapping Utility

Postby cnovak » Wed Feb 11, 2009 10:34 am

Hi,

thanks for the nice replys :-) I have added a link to flightgear on the SF project site, the plane icon and the resize behaviour will be tackled soon...

Regards - Clemens
cnovak
 
Posts: 8
Joined: Wed Jun 11, 2008 2:38 pm

Re: Java Mapping Utility

Postby brisa » Wed Feb 11, 2009 12:22 pm

If I want to contribute to your project, how can I do it ? I have modified a little function, and I would like to submit to you my modification, should I do it by sending you an email ? if yes, which is your address ?

btw do you think there is any way to use maps from osm instead of the google ones ?
User avatar
brisa
 
Posts: 268
Joined: Fri May 16, 2008 8:32 pm
Location: Olgiate Comasco (CO) Italy
Callsign: brisa

Re: Java Mapping Utility

Postby davidevirgilio » Wed Feb 11, 2009 2:28 pm

I got this error:
11-feb-2009 14.25.47 org.jdesktop.swingx.mapviewer.AbstractTileFactory$TileRunne
r run
GRAVE: Failed to load a tile at url: http://tile.openstreetmap.org/12/2046/1363.
png, retrying
java.net.UnknownHostException: tile.openstreetmap.org
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown
Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Sour
ce)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown So
urce)
at java.net.URL.openStream(Unknown Source)
at org.jdesktop.swingx.mapviewer.AbstractTileFactory$TileRunner.cacheInp
utStream(AbstractTileFactory.java:348)
at org.jdesktop.swingx.mapviewer.AbstractTileFactory$TileRunner.run(Abst
ractTileFactory.java:307)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source
)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


Can you help me?
Davide66
davidevirgilio
 
Posts: 38
Joined: Fri Dec 14, 2007 2:26 pm
Location: ITALIA

Re: Java Mapping Utility

Postby Groucho » Wed Feb 11, 2009 6:05 pm

davidevirgilio wrote:I got this error:
[color=#0000FF]11-feb-2009 14.25.47 org.jdesktop.swingx.mapviewer.AbstractTileFactory$TileRunne
r run
GRAVE: Failed to load a tile at url: http://tile.openstreetmap.org/12/2046/1363.
png, retrying
java.net.UnknownHostException: tile.openstreetmap.org
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)


Let me guess- this is Linux ? If yes, edit your /etc/hosts and put in your current host address...
_____________________________________
Callsign: D-HARP
Flight locations: TNCM, TKPK, EDNY, LOWI
Aircrafts
Helis: EC130, Bo105, UH-1, R22
Twins/Jets: Aerostar, CRJ-200
User avatar
Groucho
 
Posts: 1212
Joined: Sun Jun 17, 2007 11:28 am
Location: Airborne Lake Constance/Germany
Callsign: D-HARP
Version: GIT
OS: Kubuntu

Re: Java Mapping Utility

Postby cnovak » Thu Feb 12, 2009 9:40 am

Ok, just for clarification, the maps used are from osm, not Google. I have no idea about Google's licensing, given the fact that the map images are cached locally and I do not want to mess with Google... Moreover, this is free software, so we should use a free map service, too ;-) The component which draws the map (JXMapView from SwingLabs) can use other map data and on the SwingLabs homepage there are some screenshots showing NASA satellite maps, but either the server was very slow or is down - in any case, it didn't work for me.

Since the images are loaded from the web, the computer the program runs on has to be online. As the images are cached, after a while there are enough images in the local cache, so it should work without internet access, too (given that you fly in the same area!). Sometimes the tile server of osm is under heavy load and then my program can't get its images and throws some exception - guess the best thing is to wait a bit and hope :-)

Finally, my mail address is clenovak (at) gmail.com - you can send me a patch/diff to that address... Otherwise I am trying to get svn on sourceforge up and running so you can check out/submit stuff there. BTW, does anyone know how to set up an own website at sourceforge instead of the ugly default one? Or has some tutorial - I found the docs at sourceforge a bit confusing...
cnovak
 
Posts: 8
Joined: Wed Jun 11, 2008 2:38 pm

Re: Java Mapping Utility

Postby davidevirgilio » Thu Feb 12, 2009 3:47 pm

Thank you for your replay and suggest.

Just to add information:
1. OS Windows XP
2. Connected to internet
3. I show without problem png with browser ( mozilla and IExplorer )
Davide66
davidevirgilio
 
Posts: 38
Joined: Fri Dec 14, 2007 2:26 pm
Location: ITALIA

Re: Java Mapping Utility

Postby Groucho » Fri Feb 13, 2009 5:04 pm

davidevirgilio wrote:3. I show without problem png with browser ( mozilla and IExplorer )


Do you use a proxy server to access the internet?
_____________________________________
Callsign: D-HARP
Flight locations: TNCM, TKPK, EDNY, LOWI
Aircrafts
Helis: EC130, Bo105, UH-1, R22
Twins/Jets: Aerostar, CRJ-200
User avatar
Groucho
 
Posts: 1212
Joined: Sun Jun 17, 2007 11:28 am
Location: Airborne Lake Constance/Germany
Callsign: D-HARP
Version: GIT
OS: Kubuntu

Re: Java Mapping Utility

Postby penta » Fri Feb 13, 2009 9:13 pm

Just would like to thank you for this great utility! I use ubuntu intrepid and it worked straightforward!
Thanks again
penta
 
Posts: 238
Joined: Mon Dec 29, 2008 12:05 pm
Location: Parma-Italy
Version: Git
OS: Ubuntu Linux

Re: Java Mapping Utility

Postby davidevirgilio » Sun Feb 15, 2009 10:59 am

Groucho wrote:
davidevirgilio wrote:3. I show without problem png with browser ( mozilla and IExplorer )


Do you use a proxy server to access the internet?


Yes, I use a proxy server.
Davide66
davidevirgilio
 
Posts: 38
Joined: Fri Dec 14, 2007 2:26 pm
Location: ITALIA

Re: Java Mapping Utility

Postby Groucho » Sun Feb 15, 2009 11:06 am

davidevirgilio wrote:
Groucho wrote:
davidevirgilio wrote:3. I show without problem png with browser ( mozilla and IExplorer )


Do you use a proxy server to access the internet?


Yes, I use a proxy server.


There you go- your browser has the right settings for the proxy, your JAVA runtime environment does not. So this explains why your browser has access and the JAVA programs does not.
_____________________________________
Callsign: D-HARP
Flight locations: TNCM, TKPK, EDNY, LOWI
Aircrafts
Helis: EC130, Bo105, UH-1, R22
Twins/Jets: Aerostar, CRJ-200
User avatar
Groucho
 
Posts: 1212
Joined: Sun Jun 17, 2007 11:28 am
Location: Airborne Lake Constance/Germany
Callsign: D-HARP
Version: GIT
OS: Kubuntu

Next

Return to New features

Who is online

Users browsing this forum: No registered users and 7 guests