Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Java and any external libraries, how can I draw latitude/longitude points onto a graphical representation of the Earth?

Tags:

java

mapping

gis

I'm currently using the Java Map Projection Library (I was able to obtain the code used for the Applet from the author and modify it for use in a desktop application - not sure if he linked to that on his website yet) to draw a map of the Earth in an application. However, I want to take this a step further. I have a set of latitude/longitude points that I want to plot on this map - I just need to draw a circle at each point and perhaps some lines connecting the circles (points) on the map. However, as the user uses the built-in panning and zooming capabilities, the points need to be redrawn in the proper position. The best I have been able to achieve is maintaining the points when zooming, and even then the points get larger as you zoom in.

I'm totally open to switching libraries, however I really haven't found a library that can take care of drawing a world map, particularly onto a Swing component (it doesn't need to be that accurate, just show the various landmasses somewhat correctly) and also plotting additional points on top of that map and having them "stick" to various latitude/longitude coordinates.

I have looked at Google Earth and NASA WorldWind, however they are awfully heavy for my purposes (I don't need anything that detailed or accurate) and it doesn't seem that easy to allow for offline use and integrate the world image view into an existing application.

Suggestions or thoughts?

like image 362
Thomas Owens Avatar asked Jul 10 '09 15:07

Thomas Owens


People also ask

How do you graph longitude and latitude coordinates?

Here are examples of formats that work: Decimal degrees (DD): 41.40338, 2.17403. Degrees, minutes, and seconds (DMS): 41°24'12.2"N 2°10'26.5"E. Degrees and decimal minutes (DMM): 41 24.2028, 2 10.4418.

What is latitude and longitude explain with diagram?

The geographic grid is a system designed to pinpoint any location on Earth by laying a vertical and horizontal grid over the Earth's layout. The vertical lines are called the longitude and the horizontal lines are the latitude. The intersection of these two points determines any exact location.

How do you draw latitude on a map?

If you're using a map with longitude and latitude lines, stick a pin where you're located. Then, draw a straight horizontal line from your point to the east or west edge of the map. Then, draw a vertical line from your location to the north or south edge of the map. Put together the 2 coordinates to find your position.


1 Answers

You might take a look at other components of the www.osgeo.org Java stack. One of them is geotools: http://geotools.codehaus.org/

they is also development going on to create a GUI: http://geotools.codehaus.org/GUI+Architecture

like image 82
milovanderlinden Avatar answered Nov 14 '22 21:11

milovanderlinden