Uploaded image for project: 'GeoTools'
  1. GEOT-5595

Cannot read/write GeoTIFF with Azimuthal_Equidistant projection

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 17-beta
    • Fix Version/s: 15.4, 16.1, 17-beta
    • Component/s: coverage, geotiff
    • Labels:
      None

      Description

      I am trying to write a GeoTIFF file with Azimuthal_Equidistant projection:

      CoordinateReferenceSystem crs = CRS.parseWKT("PROJCS[\"unnamed\", "
      		+ "GEOGCS[\"unnamed ellipse\", "
      		+ "DATUM[\"unknown\", SPHEROID[\"unnamed\",6370841.391468334,0]], "
      		+ "PRIMEM[\"Greenwich\",0], "
      		+ "UNIT[\"degree\",0.0174532925199433]], "
      		+ "PROJECTION[\"Azimuthal_Equidistant\"], "
      		+ "PARAMETER[\"latitude_of_center\",42.42], "
      		+ "PARAMETER[\"longitude_of_center\",16.16], "
      		+ "PARAMETER[\"false_easting\",0], "
      		+ "PARAMETER[\"false_northing\",0],"
      		+ "UNIT[\"metre\", 1, AUTHORITY[\"EPSG\",\"9001\"]]]");
      double range = 100;
      ReferencedEnvelope envelope = new ReferencedEnvelope(-range, range, -range, range, crs);
      GridCoverageFactory f = new GridCoverageFactory();
      GridCoverage2D coverage = f.create("test", new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB), envelope, null, null, null);
      GeoTiffFormat format = new GeoTiffFormat();
      GridCoverageWriter writer = format.getWriter(new File("c:/tmp/a.tiff"));
      writer.write(coverage, null);
      

      I get the following exception:

      Exception in thread "main" java.lang.IllegalArgumentException: Unable to map projectionAzimuthal_Equidistant
      	at org.geotools.coverage.grid.io.imageio.geotiff.CRS2GeoTiffMetadataAdapter.parseCoordinateProjectionTransform(CRS2GeoTiffMetadataAdapter.java:775)
      	at org.geotools.coverage.grid.io.imageio.geotiff.CRS2GeoTiffMetadataAdapter.parseProjection(CRS2GeoTiffMetadataAdapter.java:289)
      	at org.geotools.coverage.grid.io.imageio.geotiff.CRS2GeoTiffMetadataAdapter.parseProjCRS(CRS2GeoTiffMetadataAdapter.java:242)
      	at org.geotools.coverage.grid.io.imageio.geotiff.CRS2GeoTiffMetadataAdapter.parseCoordinateReferenceSystem(CRS2GeoTiffMetadataAdapter.java:177)
      	at org.geotools.gce.geotiff.GeoTiffWriter.write(GeoTiffWriter.java:255)
      

      It looks like this projection is not yet supported. Same with reading in org.geotools.coverage.grid.io.imageio.geotiff.GeoTiffMetadata2CRSAdapter.setParametersForProjection

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                bencaradocdavies Ben Caradoc-Davies
                Reporter:
                Gyorgy Tomcsanyi Gyorgy Tomcsanyi
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: