Then the base class write_PDS_JP2_label method is called to apply the generic label modifications and write the label file. Finally the copy of the original parameters is restored to the content of this converter.

Parameters:

PDS_label_pathname

The pathname for the detached label file.

JP2_pathname

The name of the JP2 image data file referened by the label file.

removed_parameter_names

A NULL terminated array of character strings that are the names of parameters to be removed from the source label before being written. May be NULL.

additional_parameters

A pointer to PDS_Data that contains additional parameters with product-specific label conversion information. May be NULL.

A copy is made of the source label represented by the Parameter Aggregate of the PDS_Converter base class. The original parameters then have their image map projection parameters adjusted to be consistent with the selected image region and rendering resolution.

Then the base class write_PDS_label method is called to apply the generic label modifications and write the label file. Finally the copy of the original parameters is restored to the content of this converter.

Parameters:

PDS_label_pathname

The pathname for the file that begins with the converted PDS label.

image_region

A Rectangle pointer that specifies a region within the image that was rendered. N.B.: The rendered image region is specifed after any resolution change has been applied (don't just shift the full resolution image region by the resolution level, which may be inaccurate, get the rendered image size from the JP2 decoder). If NULL, the entire image was selected.

resolution_level

The resolution level at which the image is rendereed from the JP2 codestream is rendered. 1 is full resolution, 2 is half resolution, 3 is quarter resolution, etc.; i.e. the rendering scale is 1 / (2**(L - 1)).

removed_parameter_names

A NULL terminated array of character strings that are the names of parameters to be removed from the source label before being written. May be NULL.

additional_parameters

A pointer to PDS_Data that contains additional parameters with product-specific label conversion information. May be NULL.

Exceptions:

runtime_error

If the source label does not contain the expected parameters required to achieve the conversion.

Unless the additional_parameters are non-null and contain a GeoTIFF_PARAMETER_NAME or GML_PARAMETER_NAME parameter with a value of "TRUE" or "1", nothing is done.

For each of the UPDATE_VERSION_PARAMETER_NAMES the parameter value has its minor version number set to the DATA_SET_VERSION_MINOR_VALUE if it is less than that value. The version number is expected to be at the end of the parameter value string in the format "Vm.n", where m is the major version number and n is the minor version number. If any of the UPDATE_VERSION_PARAMETER_NAMES can not be found or a minor version number is not found in its value, it is left unchanged.

Parameters:

additional_parameters

A pointer to PDS_Data that contains additional parameters with product-specific label conversion information. May be NULL.

This method is only used during the write_PDS_label PDS/JP2 to PDS label conversion.

N.B.: The parameters are modified in place.

The following parameters are adjusted to be consistent with a selected subarea and/or reduced resolution rendering of the image:

Image size

The size, in pixels, of the image. The values of these parameters will be set to the image region width and height and are expected to be identical to the size of the rendered image listed in the IMAGE parameters group.

Key values used to map image locations (sample,line) to to real world (longitude,latitude) locations. The values of these parameters are relative to the image origin (upper-left corner).

HORIZONATAL_OFFSET_PARAMETER_NAME (SAMPLE_PROJECTION_OFFSET)

VERTICAL_OFFSET_PARAMETER_NAME (LINE_PROJECTION_OFFSET)

Image resolution

Defines the size of a pixel in real world units which are specified by the parameter. The values of these parameters are adjusted by the rendering ratio.

METERS_PER_PIXEL_PARAMETER_NAME (MAP_SCALE)

PIXELS_PER_DEGREE_PARAMETER_NAME (MAP_RESOLUTION)

Image boundaries

Specifies the real world (longitude and latitude degrees) location of the image edges. The values of these parameters are re-mapped to the boundaries of the image region.

WESTERN_LONGITUDE_PARAMETER_NAME (WESTERNMOST_LONGITUDE)

EASTERN_LONGITUDE_PARAMETER_NAME (EASTERNMOST_LONGITUDE)

MINIMUM_LATITUDE_PARAMETER_NAME (MINIMUM_LATITUDE)

MAXIMUM_LATITUDE_PARAMETER_NAME (MAXIMUM_LATITUDE)

N.B.: If the IMAGE_MAP_PROJECTION_GROUP_NAME parameter value specifies that a stereographicp projection was used and the image region is not the entire image then the image boundary parameters will be removed from the converted label because the linear re-mapping normally used would not be reliable for the non-linear projection. An implementation of the non-linear projection algorithm is needed to correct this defect. These parameters are not necessary to perform mappings between image (sample, line) and real world (longitude,latitude) locations using the appropriate projection algorithm.

Parameters:

image_map_projection

A pointer to the Parameter Aggregate that contains the IMAGE_MAP_PROJECTION parameters.

image_region

The Rectangle of image data that will be rendered relative to the scaled image pixel grid. The size of the rectangle is the size of the output image to be described. The origin of the rectangle is the position of the upper-left corner of the output image on the scaled image grid.

ratio

The ratio of full resolution image grid to the the scaled image grid. The ratio will always be a power of 2 corresponding to the selected image rendering resolution level. A ratio of 1 means the image was not scaled, 2 means the size of the scaled resolution grid is half the size of the full resolution image grid, 4 when the grid is quarter scale, etc.