I've got a typical two-dimensional array in Java with values which represent a grid. Rows, columns, coordinate system (latlon), origin and cell size are known. I am able to export this data as ASCII Grid but I need to create a compressed GeoTiff. And I would like to stay in the Java world, so doing it with gdal_translate is straight forward but not the solution I am looking for.
I found GeoTools GeoTiffWriterTest.java but am not able to extract the main part I need.