I've got a lot of image files (.png or .jpg) that I want to convert from one EPSG defined CRS system to another, e.g. from EPSG:31255 to EPSG:25833, on a server within a Java app.
For each image I know the coordinates (x,y) of the lower left and upper right corner in that specific CRS system.
What I've found so far:
- QGIS: Is able to do this but I'd have to do it by hand (answer)
- GDAL: Is able to convert images but it uses C++ (which I can't use on the server)
- Proj4js: Can only convert coordinates
- Geotools: I've only found information about converting coordinates or full shapefiles so far.
Can GeoTools convert images too or what other Java/JavaScript library can?
Edit:
I'm currently using version 22.2 of GeoTools. The dependencies in the pom.xml file are:
- junit
- gt-shapefile
- gt-swing
- gt-geotiff
- gt-image (not sure if I need that one)
- gt-epsg-hsql
The imports in the java file are:
- import org.geotools.coverage.grid.GridCoverage2D;
- import org.geotools.coverage.grid.io.AbstractGridCoverage2DReader;
- import org.geotools.coverage.grid.io.AbstractGridFormat;
- import org.geotools.coverage.grid.io.GridFormatFinder;
- import org.geotools.coverage.processing.Operations;
- import org.geotools.gce.geotiff.GeoTiffFormat;
- import org.geotools.gce.geotiff.GeoTiffWriter;
- import org.geotools.referencing.CRS;
- import org.geotools.util.factory.Hints;
- import org.opengis.referencing.crs.CoordinateReferenceSystem;