[GIS] Looking for an open-source Java based GeoTIFF library

geotiff-tiffimportjavaopen-source-gissoftware-recommendations

I have written many programs for reading and writing various types of spatial data in the past but I must admit that the GeoTIFF format has often gotten the better of me. It's such a flexible format that writing code to read/write the variations that are commonly found in the wild is extremely challenging. So I am looking for a library that I can use for accomplishing this task.

Here are my requirements:

  1. It must be developed in Java and exist as a single and ideally very small JAR file that can be easily incorporated in existing projects.

  2. It must have a licence compatible with the GNU GPL.

  3. It must be able to handle many different flavours of GeoTIFF including the various types of data compression.

The GeoTIFF web page recommends GeoTIFF-JAI (it's also recommended by the answerer of this GIS.SE question) however the project doesn't appear to have been maintained since 2001 and I am not able to find any documentation to describe its use. I am currently using a modified version of the UCAR GeoTIFF reader but it similarly is not actively maintained nor documented, and does not handle many types of modern GeoTIFFs (no compression formats). I am aware that GDAL can handle GeoTIFF quite well and that there is a JNI interface to link with Java but I am looking for a small-footprint native Java solution. I am also aware that GeoTools has a means of dealing with GeoTIFFs, but as the OP of this question points out, it actually requires a GDAL plugin, which unfortunately I need to avoid.

I realize that I am asking for a lot here but is anyone aware of a GeoTIFF library that meets these conditions? I thought I'd ask before spending another couple of days trying to hack together a solution for dealing with compressed formats.

Best Answer

Install OpenJUMP and study what all has been gathered into it

enter image description here

I have never really understood what all the alternatives are. ImageIO-ext is probably utilising native GDAL binaries if such are available but at least most other alternatives are pure java. There is also one more alternative in OpenJUMP called "Sextante raster" which is also pure java. Different drivers understand different tiff variants. Make a test data set with different compressions and try what works and what not. Sometimes the tiff needs to be geotiff with valid georeferencing, sometimes .tfw is enough and sometimes even an ungeoreferenced tiff opens.

GeoTools and GeoServer for sure can deal at least with some tiff variants without the ImageIO-ext extension. Install GeoServer without extensions and create new GeoTIFF raster stores from different tiffs and you will know what works and what not with GeoTools.

enter image description here