Uploaded image for project: 'GeoTools'
  1. GeoTools
  2. GEOT-5594

AzimuthalEquidistant projection missing parameters

    Details

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

      Description

      The class for the AzimuthalEquidistant projection is not reporting its parameters correctly.

      Example code:

      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\"]]]");
      System.out.println(crs.toWKT());
      

      Output:

      PROJCS["unnamed", 
        GEOGCS["unnamed ellipse", 
          DATUM["unknown", 
            SPHEROID["unnamed", 6370841.391468334, 0.0]], 
          PRIMEM["Greenwich", 0.0], 
          UNIT["degree", 0.017453292519943295], 
          AXIS["Longitude", EAST], 
          AXIS["Latitude", NORTH]], 
        PROJECTION["Azimuthal_Equidistant"], 
        PARAMETER["longitude_of_center", 0.0], 
        PARAMETER["latitude_of_center", 0.0], 
        PARAMETER["false_easting", 0.0], 
        PARAMETER["false_northing", 0.0], 
        UNIT["m", 1.0], 
        AXIS["x", EAST], 
        AXIS["y", NORTH]]
      

      Parameters longitude_of_center and latitude_of_center show zeroes instead of the correct values.

      I am not very familiar with the code, but after some debugging I think adding the following function to the class org.geotools.referencing.operation.projection.AzimuthalEquidistant.Abstract should solve the issue.

      @Override
      public ParameterValueGroup getParameterValues() {
      	final ParameterValueGroup values = super.getParameterValues();
      	final Collection<GeneralParameterDescriptor> expected = getParameterDescriptors().descriptors();
      	set(expected, Provider.LATITUDE_OF_CENTRE,  values, latitudeOfOrigin);
      	set(expected, Provider.LONGITUDE_OF_CENTRE, values, centralMeridian);
      	return values;
      }
      

        Attachments

          Issue links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: