views:

1382

answers:

7

I am looking for a Java library to display map data from various sources, including shapefile, WMS, WFS, Google Maps, possibly ArcIMS, etc. It seems like OpenLayers is the closest thing to what I want, except it's a JavaScript library, and I'm writing a Swing application.

GDAL looks promising, but as far as I can tell there won't be Java bindings until "sometime" in the future.

Just to be clear, I am looking for a single Java API that I can use to display maps from a number of map servers/sources.

Does anyone know if anything like this exists, and if not, where to go from here? Should I build this API on top of GeoTools? Or...

+1  A: 

GeoTools is a good bet for this. The Google Maps Terms of Service prohibit accessing Google Maps tiles except through the (JavaScript) Google Maps API, so it's not likely that you'll find a freely available codebase to access them in a Java application. Similar restrictions probably apply to other commercial layers.

David Winslow
I was hoping for something at a higher level of abstraction than Geotools, but I will just have to build what I need on this foundation.
dave4351
A: 

I have used MapXtreme for Java, it was pretty good and supported several formats. It is not cheap but it delivers.

It is geared towards rendering vectorial data formats.

You can use it either server or client side.

Mario Ortegón
A: 

Try mapscript for java www.mapserver.org

CU

A: 

Have a look at UDig

http://udig.refractions.net/

It is based on the eclipse RCP works with Geotools and can display most types of spatial data.

it is open source and seems to have quite a bit of activity

Gabe
+2  A: 

uDig would probably meet your needs just fine if you can work within the RCP framework. I don't have any experience with uDig or NASA World Wind, but if you need to put the map features in an existing application, NASA's World Wind Java SDK is another option. It is extensible and supports industry standards for geospatial data. They have an informative wiki here. I first saw NASA World Wind at JavaOne 2007 and it doesn't look like the Java SDK has really taken off nor does it look like the .Net version is seeing a lot of new releases, but it could meet your needs if they are basic.

DavidValeri
A: 

ArcGIS Engine Java will do what you need. It integrates into a fully-integrated GIS platform. There are tools to create cartographic quality maps, publish them, host them out, or to build custom apps.

James Schek
A: 

This is a case where you have lots of choice. GeoTools is indeed a low level library and an excellent choice for some hands on work. We recently started using Swing for our example code in order to make tutorials more visual. That said they are tutorial code only and do not represent a multi threaded system such as uDig.

If you are looking for Swing applications to start form there is the Jump family (sadly scattered through a closed development process - OpenJump represents a collection of the various forks), gvSig which has excellent financial backing in Span, and so on.

You may also wish to look at the library side of the deegree project (which I seem to recall produced a desktop application as well?).

I also recommend looking at some of the tiled map viewers produced around Nasa World Wind and Open Street Map datasets. These will be more similar to the OpenLayers experience.

Disclaimer I am on the steering committee for GeoTools, and uDig.

Jody Garnett