Typedefs | |
| typedef EnumWrapper < InterpolationTypeEnum > | InterpolationType |
Enumerations | |
| enum | InterpolationTypeEnum { NEAREST_NEIGHBOR, BILINEAR, BICUBIC } |
Functions | |
| std::vector< DimensionDescriptor > | generateDimensionVector (unsigned int count, bool setOriginalNumbers=true, bool setActiveNumbers=false, bool setOnDiskNumbers=false) |
| bool | determineSkipFactor (const std::vector< DimensionDescriptor > &values, unsigned int &skipFactor) |
| bool | determineExportSkipFactor (const std::vector< DimensionDescriptor > &values, unsigned int &skipFactor) |
| std::vector< DimensionDescriptor > | subsetDimensionVector (const std::vector< DimensionDescriptor > &origValues, const DimensionDescriptor &start, const DimensionDescriptor &stop, unsigned int skipFactor=0) |
| FileDescriptor * | generateFileDescriptor (DataDescriptor *pDd, const std::string &filename, const std::string &datasetLocation, EndianType endian) |
| FileDescriptor * | generateAndSetFileDescriptor (DataDescriptor *pDd, const std::string &filename, const std::string &datasetLocation, EndianType endian) |
| FileDescriptor * | generateFileDescriptorForExport (const DataDescriptor *pDd, const std::string &filename) |
| FileDescriptor * | generateFileDescriptorForExport (const DataDescriptor *pDd, const std::string &filename, const DimensionDescriptor &startRow, const DimensionDescriptor &stopRow, unsigned int rowSkipFactor, const DimensionDescriptor &startCol, const DimensionDescriptor &stopCol, unsigned int colSkipFactor, const std::vector< DimensionDescriptor > &subsetBands=std::vector< DimensionDescriptor >()) |
| FileDescriptor * | generateFileDescriptorForExport (const DataDescriptor *pDd, const std::string &filename, const DimensionDescriptor &startRow, const DimensionDescriptor &stopRow, unsigned int rowSkipFactor, const DimensionDescriptor &startCol, const DimensionDescriptor &stopCol, unsigned int colSkipFactor, const DimensionDescriptor &startBand, const DimensionDescriptor &stopBand, unsigned int bandSkipFactor) |
| RasterDataDescriptor * | generateRasterDataDescriptor (const std::string &name, DataElement *pParent, unsigned int rows, unsigned int columns, unsigned int bands, InterleaveFormatType interleave, EncodingType encoding, ProcessingLocation location) |
| RasterDataDescriptor * | generateRasterDataDescriptor (const std::string &name, DataElement *pParent, unsigned int rows, unsigned int columns, EncodingType encoding, ProcessingLocation location) |
| RasterDataDescriptor * | generateUnchippedRasterDataDescriptor (const RasterElement *pOrigElement) |
| void | subsetDataDescriptor (DataDescriptor *pDd, const DimensionDescriptor &startRow, const DimensionDescriptor &stopRow, unsigned int rowSkipFactor, const DimensionDescriptor &startCol, const DimensionDescriptor &stopCol, unsigned int colSkipFactor, const std::vector< DimensionDescriptor > &subsetBands=std::vector< DimensionDescriptor >()) |
| void | subsetDataDescriptor (DataDescriptor *pDd, const DimensionDescriptor &startRow, const DimensionDescriptor &stopRow, unsigned int rowSkipFactor, const DimensionDescriptor &startCol, const DimensionDescriptor &stopCol, unsigned int colSkipFactor, const DimensionDescriptor &startBand, const DimensionDescriptor &stopBand, unsigned int bandSkipFactor) |
| RasterElement * | createRasterElement (const std::string &name, unsigned int rows, unsigned int columns, EncodingType encoding, bool inMemory=true, DataElement *pParent=0) |
| RasterElement * | createRasterElement (const std::string &name, unsigned int rows, unsigned int columns, unsigned int bands, EncodingType encoding, InterleaveFormatType interleave=BIP, bool inMemory=true, DataElement *pParent=0) |
| size_t | bytesInEncoding (EncodingType encoding) |
| std::vector< std::string > | getBandNames (const RasterDataDescriptor *pDescriptor) |
| std::string | getBandName (const RasterDataDescriptor *pDescriptor, DimensionDescriptor band) |
| bool | isSubcube (const RasterDataDescriptor *pDescriptor, bool checkBands) |
| bool | findColorCompositeDimensionDescriptors (const RasterDataDescriptor *pDescriptor, const std::string &name, DimensionDescriptor &redBand, DimensionDescriptor &greenBand, DimensionDescriptor &blueBand) |
| int | findBandWavelengthMatch (double lowTarget, double highTarget, const std::vector< double > &lowWavelengths, const std::vector< double > &highWavelengths=std::vector< double >(), bool allowPartialMatch=true) |
| std::vector< unsigned int > | findBandWavelengthMatches (double lowTarget, double highTarget, const std::vector< double > &lowWavelengths, const std::vector< double > &highWavelengths=std::vector< double >(), bool allowPartialMatch=true) |
| DimensionDescriptor | findBandWavelengthMatch (double lowTarget, double highTarget, const RasterDataDescriptor *pDescriptor, bool allowPartialMatch=true) |
| int | findBestMatch (const std::vector< double > &values, double value, double tolerance, int startAt=0) |
| std::vector< RasterChannelType > | getVisibleRasterChannels () |
| bool | chipMetadata (DynamicObject *pMetadata, const std::vector< DimensionDescriptor > &selectedRows, const std::vector< DimensionDescriptor > &selectedColumns, const std::vector< DimensionDescriptor > &selectedBands) |
| template<typename T> | |
| bool | isBad (T value) |
| template<> | |
| bool | isBad< double > (double value) |
| template<> | |
| bool | isBad< float > (float value) |
| template<typename T> | |
| uint64_t | sanitizeData (T *pData, uint64_t count, double value=0.0) |
| uint64_t | sanitizeData (void *pData, uint64_t count, EncodingType type, double value=0.0) |
| int64_t | calculateFileSize (const RasterFileDescriptor *pDescriptor) |
| bool | rotate (RasterElement *pDst, const RasterElement *pSrc, double angle, int defaultValue, InterpolationType interp=NEAREST_NEIGHBOR, Progress *pProgress=NULL, bool *pAbort=NULL) |
This includes creation of DataDescriptors, FileDescriptors, and DataElements.
| typedef EnumWrapper<InterpolationTypeEnum> RasterUtilities::InterpolationType |
The EnumWrapper contains a given enum value and provides a isValid() method which returns true if the contained enum value is valid.
Please see How To Use EnumWrapper for more information. The wrapped enum values are RasterUtilities::InterpolationTypeEnum.
Definition at line 990 of file RasterUtilities.h.
Types of interpolation.
| NEAREST_NEIGHBOR | Duplicate the nearest neighbor. |
| BILINEAR | Bilinear interpolation. |
| BICUBIC | Bicubic interpolation. |
Definition at line 980 of file RasterUtilities.h.
| size_t RasterUtilities::bytesInEncoding | ( | EncodingType | encoding | ) |
Determine the number of bytes in a single element of a given EncodingType.
| encoding | EncodingType to find the size of. |
| int64_t RasterUtilities::calculateFileSize | ( | const RasterFileDescriptor * | pDescriptor | ) |
Calculate size of data file.
This function will calculate the size of the file described in the given RasterFileDescriptor. For a BSQ multiple file data set, it will calculate the required size for an individual file, not the total of all the files.
| pDescriptor | The RasterFileDescriptor to use in calculation of file size. |
| bool RasterUtilities::chipMetadata | ( | DynamicObject * | pMetadata, | |
| const std::vector< DimensionDescriptor > & | selectedRows, | |||
| const std::vector< DimensionDescriptor > & | selectedColumns, | |||
| const std::vector< DimensionDescriptor > & | selectedBands | |||
| ) |
Chip the metadata in-place.
The vector metadata with the SPECIAL_METADATA_NAME / BAND_METADATA_NAME, ROW_METADATA_NAME, and COLUMN_METADATA_NAME DynamicObjects will be chipped such that they can still be indexed with active numbers.
This method will automatically be called when using one of the standard ways to chip (RasterElement::createChip, chipping on import using the default behavior in RasterElementImporterShell). Plug-ins should only call it when implementing their own chipping behavior.
Metadata chipping is supported for vectors of the signed and unsigned variants of char, int, long, int64_t, as well as float, double, bool, and std::string.
| pMetadata | The DynamicObject that contains SPECIAL_METADATA_NAME / BAND_METADATA_NAME, ROW_METADATA_NAME, and COLUMN_METADATA_NAME that will be chipped by this method. This DynamicObject will be modified in-place. This DynamicObject will most likely come from DataDescriptor::getMetadata(). | |
| selectedRows | The DimensionDescriptors (unmodified from the RasterElement) for the rows which should be included in this chip. | |
| selectedColumns | The DimensionDescriptors (unmodified from the RasterElement) for the columns which should be included in this chip. | |
| selectedBands | The DimensionDescriptors (unmodified from the RasterElement) for the bands which should be included in this chip. |
| RasterElement* RasterUtilities::createRasterElement | ( | const std::string & | name, | |
| unsigned int | rows, | |||
| unsigned int | columns, | |||
| unsigned int | bands, | |||
| EncodingType | encoding, | |||
| InterleaveFormatType | interleave = BIP, |
|||
| bool | inMemory = true, |
|||
| DataElement * | pParent = 0 | |||
| ) |
Creates a RasterElement with the given parameters that can be immediately used.
This method should only be used by plug-ins that need to programmatically create a RasterElement to store results of an algorithm. It should NOT be used by importers or exporters to create a RasterElement. It should also NOT be used to create a RasterElement that corresponds to a data file on the filesystem. The created element will inherit the parent's classification unless the parent is NULL, in which case the classification will be set to the system's highest level of classification. Use the DataElement convenience method copyClassification or setClassification if the parent is NULL or if you require different classification settings.
| name | The name for the new RasterDataDescriptor. | |
| rows | The number of rows for the new RasterDataDescriptor. | |
| columns | The number of columns for the new RasterDataDescriptor. | |
| bands | The number of bands for the new RasterDataDescriptor. | |
| encoding | The encoding for the new RasterDataDescriptor. | |
| interleave | The interleave for the new RasterDataDescriptor. | |
| inMemory | If true, the data for the RasterElement will be fully contained in RAM. If false, the data for the RasterElement will be fully contained on the filesystem and will be paged into memory as required. | |
| pParent | The parent element for the new RasterDataDescriptor. |
| RasterElement* RasterUtilities::createRasterElement | ( | const std::string & | name, | |
| unsigned int | rows, | |||
| unsigned int | columns, | |||
| EncodingType | encoding, | |||
| bool | inMemory = true, |
|||
| DataElement * | pParent = 0 | |||
| ) |
Creates a RasterElement with the given parameters and that assumes a single band that can be immediately used.
This method should only be used by plug-ins that need to programmatically create a RasterElement to store results of an algorithm. It should NOT be used by importers or exporters to create a RasterElement. It should also NOT be used to create a RasterElement that corresponds to a data file on the filesystem. The created element will inherit the parent's classification unless the parent is NULL, in which case the classification will be set to the system's highest level of classification. Use the DataElement convenience method copyClassification or setClassification if the parent is NULL or if you require different classification settings.
| name | The name for the new RasterDataDescriptor. | |
| rows | The number of rows for the new RasterDataDescriptor. | |
| columns | The number of columns for the new RasterDataDescriptor. | |
| encoding | The encoding for the new RasterDataDescriptor. | |
| inMemory | If true, the data for the RasterElement will be fully contained in RAM. If false, the data for the RasterElement will be fully contained on the filesystem and will be paged into memory as required. | |
| pParent | The parent element for the new RasterDataDescriptor. |
| bool RasterUtilities::determineExportSkipFactor | ( | const std::vector< DimensionDescriptor > & | values, | |
| unsigned int & | skipFactor | |||
| ) |
Determine the export skip factor if any between each DimensionDescriptor.
This function will determine the uniform skip factor between each DimensionDescriptor::getActiveNumber() which represents any skip factor used when exporting the data.
| values | The DimensionDescriptors to determine the skip factor of. | |
| skipFactor | This will be set to the calculated skip factor. A skipFactor of 0, indicates the active numbers are the following: 0, 1, 2, 3, 4, 5, 6. A skip factor of 1, indicates the active numbers are the following: 0, 2, 4, 6. |
| bool RasterUtilities::determineSkipFactor | ( | const std::vector< DimensionDescriptor > & | values, | |
| unsigned int & | skipFactor | |||
| ) |
Determine the load skip factor if any between each DimensionDescriptor.
This function will determine the uniform skip factor between each DimensionDescriptor::getOnDiskNumber() which represents any skip factor used to load the data.
| values | The DimensionDescriptors to determine the skip factor of. | |
| skipFactor | This will be set to the calculated skip factor. A skipFactor of 0, indicates the on-disk numbers are the following: 0, 1, 2, 3, 4, 5, 6. A skip factor of 1, indicates the on-disk numbers are the following: 0, 2, 4, 6. |
| DimensionDescriptor RasterUtilities::findBandWavelengthMatch | ( | double | lowTarget, | |
| double | highTarget, | |||
| const RasterDataDescriptor * | pDescriptor, | |||
| bool | allowPartialMatch = true | |||
| ) |
Find the band which matches a wavelength region.
This searches the wavelengths stored in the metadata for all bands which fall within the (lowTarget, highTarget) region. The preferred order of the wavelengths to use is:
The allowPartialMatch variable determines if the entire band must fall in the region or if a partial overlap is allowed. Both lowTarget and highTarget must be in microns.
| lowTarget | The lower bound of the wavelength region. | |
| highTarget | The upper bound of the wavelength region. | |
| pDescriptor | The RasterDataDescriptor to search for wavelength regions. | |
| allowPartialMatch | Set to false to require entire band range to fall within requested wavelength region. Set to true to allow partial inclusion. |
| int RasterUtilities::findBandWavelengthMatch | ( | double | lowTarget, | |
| double | highTarget, | |||
| const std::vector< double > & | lowWavelengths, | |||
| const std::vector< double > & | highWavelengths = std::vector< double >(), |
|||
| bool | allowPartialMatch = true | |||
| ) |
Find the band which matches a wavelength region.
This searches the wavelengths vectors for all bands which fall within the (lowTarget, highTarget) region. The allowPartialMatch variable determines if the entire band must fall in the region or if a partial overlap is allowed. Once all the bands have been found, they are sorted by lower wavelength and the index of the median value is returned. The parameters lowTarget, highTarget, lowWavelengths, and highWavelengths must all have the same units. If highWavelengths is empty, lowWavelengths should contain wave centers which will be matched instead of a continuous region.
| lowTarget | The lower bound of the wavelength region. | |
| highTarget | The upper bound of the wavelength region. | |
| lowWavelengths | The lower bound of the wavelengths for each band. | |
| highWavelengths | The upper bound of the wavelengths for each band. Must be either empty of the same length as lowWavelengths. | |
| allowPartialMatch | Set to false to require entire band range to fall within requested wavelength region. Set to true to allow partial inclusion. |
| std::vector<unsigned int> RasterUtilities::findBandWavelengthMatches | ( | double | lowTarget, | |
| double | highTarget, | |||
| const std::vector< double > & | lowWavelengths, | |||
| const std::vector< double > & | highWavelengths = std::vector< double >(), |
|||
| bool | allowPartialMatch = true | |||
| ) |
Find the bands which match a wavelength region.
This searches the wavelengths vectors for all bands which fall within the (lowTarget, highTarget) region. The allowPartialMatch variable determines if the entire band must fall in the region or if a partial overlap is allowed. Once all the bands have been found, they are sorted by lower wavelength. The parameters lowTarget, highTarget, lowWavelengths, and highWavelengths must all have the same units. If highWavelengths is empty, lowWavelengths should contain wave centers which will be matched instead of a continuous region.
| lowTarget | The lower bound of the wavelength region. | |
| highTarget | The upper bound of the wavelength region. | |
| lowWavelengths | The lower bound of the wavelengths for each band. | |
| highWavelengths | The upper bound of the wavelengths for each band. Must be either empty of the same length as lowWavelengths. | |
| allowPartialMatch | Set to false to require entire band range to fall within requested wavelength region. Set to true to allow partial inclusion. |
| int RasterUtilities::findBestMatch | ( | const std::vector< double > & | values, | |
| double | value, | |||
| double | tolerance, | |||
| int | startAt = 0 | |||
| ) |
Finds the closest match in vector of values to a value within the tolerance specified.
This method will return the index in vector of the closest match. If there is no match within the tolerance, the method will return -1.
| values | the list of values to search for the closest match. | |
| value | the value for which to find the closest match. | |
| tolerance | the maximum difference allowed to consider as a valid match. | |
| startAt | the index at which to start search. Defaults to first element. |
| bool RasterUtilities::findColorCompositeDimensionDescriptors | ( | const RasterDataDescriptor * | pDescriptor, | |
| const std::string & | name, | |||
| DimensionDescriptor & | redBand, | |||
| DimensionDescriptor & | greenBand, | |||
| DimensionDescriptor & | blueBand | |||
| ) |
Find the appropriate red, green, and blue bands for a color composite.
| pDescriptor | RasterDataDescriptor containing the band and wavelength information. | |
| name | The name of the user-defined color composite to set. This is typically chosen from a menu. | |
| redBand | The band to be displayed in the red channel. | |
| greenBand | The band to be displayed in the green channel. | |
| blueBand | The band to be displayed in the blue channel. |
True if red, green, and blue bands are successfully set and are valid, false otherwise.| FileDescriptor* RasterUtilities::generateAndSetFileDescriptor | ( | DataDescriptor * | pDd, | |
| const std::string & | filename, | |||
| const std::string & | datasetLocation, | |||
| EndianType | endian | |||
| ) |
Returns a FileDescriptor to go with a passed in DataDescriptor and sets the FileDescriptor onto the provided DataDescriptor.
| pDd | The DataDescriptor to generate a FileDescriptor for. If a RasterDataDescriptor, the DimensionDescriptors will be modified to set on-disk numbers. | |
| filename | The filename for the FileDescriptor | |
| datasetLocation | The location within the file which contains the dataset. | |
| endian | The endianness of the file. |
| std::vector<DimensionDescriptor> RasterUtilities::generateDimensionVector | ( | unsigned int | count, | |
| bool | setOriginalNumbers = true, |
|||
| bool | setActiveNumbers = false, |
|||
| bool | setOnDiskNumbers = false | |||
| ) |
Returns a vector of DimensionDescriptors, suitable for use in a RasterDataDescriptor or RasterFileDescriptor.
| count | The number of DimensionDescriptors to generate. | |
| setOriginalNumbers | if true, the original numbers will be set from 0 to count-1 matching their index location within the vector. | |
| setActiveNumbers | if true, the active numbers will be set from 0 to count-1 matching their index location within the vector. | |
| setOnDiskNumbers | if true, the on-disk numbers will be set from 0 to count-1 matching their index location within the vector. |
| FileDescriptor* RasterUtilities::generateFileDescriptor | ( | DataDescriptor * | pDd, | |
| const std::string & | filename, | |||
| const std::string & | datasetLocation, | |||
| EndianType | endian | |||
| ) |
Returns a FileDescriptor to go with a passed in DataDescriptor.
| pDd | The DataDescriptor to generate a FileDescriptor for. If a RasterDataDescriptor, the DimensionDescriptors will be modified to set on-disk numbers. | |
| filename | The filename for the FileDescriptor | |
| datasetLocation | The location within the file which contains the dataset. | |
| endian | The endianness of the file. |
| FileDescriptor* RasterUtilities::generateFileDescriptorForExport | ( | const DataDescriptor * | pDd, | |
| const std::string & | filename, | |||
| const DimensionDescriptor & | startRow, | |||
| const DimensionDescriptor & | stopRow, | |||
| unsigned int | rowSkipFactor, | |||
| const DimensionDescriptor & | startCol, | |||
| const DimensionDescriptor & | stopCol, | |||
| unsigned int | colSkipFactor, | |||
| const DimensionDescriptor & | startBand, | |||
| const DimensionDescriptor & | stopBand, | |||
| unsigned int | bandSkipFactor | |||
| ) |
Returns a FileDescriptor that can be provided to an exporter to export the data that is some subset of the given DataDescriptor.
| pDd | The DataDescriptor to generate a suitable FileDescriptor necessary for export of. | |
| filename | The name of the file that the data should be exported to. | |
| startRow | The DimensionDescriptor that specifies the starting row of the subset. The DimensionDescriptor::getOriginalNumber() will be used to determine the start of the row subset in the vector. A default constructed DimensionDescriptor can be provided, in which case the first row will be used. | |
| stopRow | The DimensionDescriptor that specifies the ending row of the subset. The DimensionDescriptor::getOriginalNumber() will be used to determine the end of the row subset in the vector. A default constructed DimensionDescriptor can be provided, in which case the last row will be used. | |
| rowSkipFactor | Specifies the number of rows that should be skipped while creating the subset. For example, a skipFactor of 0 would include the following row positions: 0, 1, 2, 3, 4, 5, 6. For example, a skipFactor of 1 would include the following row positions: 0, 2, 4, 6. | |
| startCol | The DimensionDescriptor that specifies the starting column of the subset. The DimensionDescriptor::getOriginalNumber() will be used to determine the start of the column subset in the vector. A default constructed DimensionDescriptor can be provided, in which case the first column will be used. | |
| stopCol | The DimensionDescriptor that specifies the ending column of the subset. The DimensionDescriptor::getOriginalNumber() will be used to determine the end of the column subset in the vector. A default constructed DimensionDescriptor can be provided, in which case the last column will be used. | |
| colSkipFactor | Specifies the number of columns that should be skipped while creating the subset. For example, a skipFactor of 0 would include the following column positions: 0, 1, 2, 3, 4, 5, 6. For example, a skipFactor of 1 would include the following column positions: 0, 2, 4, 6. | |
| startBand | The DimensionDescriptor that specifies the starting band of the subset. The DimensionDescriptor::getOriginalNumber() will be used to determine the start of the band subset in the vector. A default constructed DimensionDescriptor can be provided, in which case the first band will be used. | |
| stopBand | The DimensionDescriptor that specifies the ending band of the subset. The DimensionDescriptor::getOriginalNumber() will be used to determine the end of the band subset in the vector. A default constructed DimensionDescriptor can be provided, in which case the last band will be used. | |
| bandSkipFactor | Specifies the number of band that should be skipped while creating the subset. For example, a skipFactor of 0 would include the following band positions: 0, 1, 2, 3, 4, 5, 6. For example, a skipFactor of 1 would include the following band positions: 0, 2, 4, 6. |
| FileDescriptor* RasterUtilities::generateFileDescriptorForExport | ( | const DataDescriptor * | pDd, | |
| const std::string & | filename, | |||
| const DimensionDescriptor & | startRow, | |||
| const DimensionDescriptor & | stopRow, | |||
| unsigned int | rowSkipFactor, | |||
| const DimensionDescriptor & | startCol, | |||
| const DimensionDescriptor & | stopCol, | |||
| unsigned int | colSkipFactor, | |||
| const std::vector< DimensionDescriptor > & | subsetBands = std::vector< DimensionDescriptor >() | |||
| ) |
Returns a FileDescriptor that can be provided to an exporter to export the data that is some subset of the given DataDescriptor.
| pDd | The DataDescriptor to generate a suitable FileDescriptor necessary for export of. | |
| filename | The name of the file that the data should be exported to. | |
| startRow | The DimensionDescriptor that specifies the starting row of the subset. The DimensionDescriptor::getOriginalNumber() will be used to determine the start of the row subset in the vector. A default constructed DimensionDescriptor can be provided, in which case the first row will be used. | |
| stopRow | The DimensionDescriptor that specifies the ending row of the subset. The DimensionDescriptor::getOriginalNumber() will be used to determine the end of the row subset in the vector. A default constructed DimensionDescriptor can be provided, in which case the last row will be used. | |
| rowSkipFactor | Specifies the number of rows that should be skipped while creating the subset. For example, a skipFactor of 0 would include the following row positions: 0, 1, 2, 3, 4, 5, 6. For example, a skipFactor of 1 would include the following row positions: 0, 2, 4, 6. | |
| startCol | The DimensionDescriptor that specifies the starting column of the subset. The DimensionDescriptor::getOriginalNumber() will be used to determine the start of the column subset in the vector. A default constructed DimensionDescriptor can be provided, in which case the first column will be used. | |
| stopCol | The DimensionDescriptor that specifies the ending column of the subset. The DimensionDescriptor::getOriginalNumber() will be used to determine the end of the column subset in the vector. A default constructed DimensionDescriptor can be provided, in which case the last column will be used. | |
| colSkipFactor | Specifies the number of columns that should be skipped while creating the subset. For example, a skipFactor of 0 would include the following column positions: 0, 1, 2, 3, 4, 5, 6. For example, a skipFactor of 1 would include the following column positions: 0, 2, 4, 6. | |
| subsetBands | Specifies the list of bands that should be included in the subset. The vector must be a subset of the DataDescriptor::getBands() value. An empty vector can be provided, in which case no bands will be removed during the subset. |
| FileDescriptor* RasterUtilities::generateFileDescriptorForExport | ( | const DataDescriptor * | pDd, | |
| const std::string & | filename | |||
| ) |
Returns a FileDescriptor that can be provided to an exporter to export the data represented by the given DataDescriptor.
| pDd | The DataDescriptor to generate a suitable FileDescriptor necessary for export of. | |
| filename | The name of the file that the data should be exported to. |
| RasterDataDescriptor* RasterUtilities::generateRasterDataDescriptor | ( | const std::string & | name, | |
| DataElement * | pParent, | |||
| unsigned int | rows, | |||
| unsigned int | columns, | |||
| EncodingType | encoding, | |||
| ProcessingLocation | location | |||
| ) |
Generate a populated RasterDataDescriptor to match the given parameters assuming the data only has one band.
The new RasterDataDescriptor will inherit the classification settings of the parent DataElement unless the parent element is NULL, in which case the classification will be set to the system's highest level.
| name | The name for the new RasterDataDescriptor. | |
| pParent | The parent element for the new RasterDataDescriptor. | |
| rows | The number of rows for the new RasterDataDescriptor. | |
| columns | The number of columns for the new RasterDataDescriptor. | |
| encoding | The encoding for the new RasterDataDescriptor. | |
| location | The processing location for the new RasterDataDescriptor. |
| RasterDataDescriptor* RasterUtilities::generateRasterDataDescriptor | ( | const std::string & | name, | |
| DataElement * | pParent, | |||
| unsigned int | rows, | |||
| unsigned int | columns, | |||
| unsigned int | bands, | |||
| InterleaveFormatType | interleave, | |||
| EncodingType | encoding, | |||
| ProcessingLocation | location | |||
| ) |
Generate a populated RasterDataDescriptor to match the given parameters.
The new RasterDataDescriptor will inherit the classification settings of the parent DataElement unless the parent element is NULL, in which case the classification will be set to the system's highest level.
| name | The name for the new RasterDataDescriptor. | |
| pParent | The parent element for the new RasterDataDescriptor. | |
| rows | The number of rows for the new RasterDataDescriptor. | |
| columns | The number of columns for the new RasterDataDescriptor. | |
| bands | The number of bands for the new RasterDataDescriptor. | |
| interleave | The interleave for the new RasterDataDescriptor. | |
| encoding | The encoding for the new RasterDataDescriptor. | |
| location | The processing location for the new RasterDataDescriptor. |
| RasterDataDescriptor* RasterUtilities::generateUnchippedRasterDataDescriptor | ( | const RasterElement * | pOrigElement | ) |
Generate a populated RasterDataDescriptor with RasterFileDescriptor to match the given RasterElement without any chipping.
This method will retain any interesting original DimensionDescriptor numbers, inherit the classification from the original element but not copy any metadata.
| pOrigElement | The RasterElement to copy. There must be a valid RasterFileDescriptor attached to this element. |
| std::string RasterUtilities::getBandName | ( | const RasterDataDescriptor * | pDescriptor, | |
| DimensionDescriptor | band | |||
| ) |
Returns the band name for the given descriptor and band.
This method will query the SPECIAL_METADATA_NAME / BAND_METADATA_NAME / NAMES_METADATA_NAME and SPECIAL_METADATA_NAME / BAND_NAME_PREFIX_METADATA_NAME keys of the metadata to determine the correct band name. This method should not be called for every band in a RasterDataDescriptor, for that please call getBandNames().
| pDescriptor | the descriptor to return the band name for. | |
| band | the individual band to return the band name for. |
| std::vector<std::string> RasterUtilities::getBandNames | ( | const RasterDataDescriptor * | pDescriptor | ) |
Returns the band names for the given descriptor.
This method will query the SPECIAL_METADATA_NAME / BAND_METADATA_NAME / NAMES_METADATA_NAME and SPECIAL_METADATA_NAME / BAND_NAME_PREFIX_METADATA_NAME keys of the metadata to determine the correct band names.
| pDescriptor | the descriptor to return the band names for. |
| std::vector<RasterChannelType> RasterUtilities::getVisibleRasterChannels | ( | ) |
Returns a vector of RasterChannelType enum values.
| bool RasterUtilities::isBad | ( | T | value | ) |
Checks whether a floating-point value is a NaN.
| value | The value to test. |
Definition at line 852 of file RasterUtilities.h.
| bool RasterUtilities::isBad< double > | ( | double | value | ) |
Checks whether a floating-point value is a NaN.
| value | The value to test. |
| bool RasterUtilities::isBad< float > | ( | float | value | ) |
Checks whether a floating-point value is a NaN.
| value | The value to test. |
| bool RasterUtilities::isSubcube | ( | const RasterDataDescriptor * | pDescriptor, | |
| bool | checkBands | |||
| ) |
Returns whether or not raster image is a subcube.
| pDescriptor | the descriptor of the raster image to be checked. | |
| checkBands | If true, include the bands in the comparison. If false, don't include the bands |
| bool RasterUtilities::rotate | ( | RasterElement * | pDst, | |
| const RasterElement * | pSrc, | |||
| double | angle, | |||
| int | defaultValue, | |||
| InterpolationType | interp = NEAREST_NEIGHBOR, |
|||
| Progress * | pProgress = NULL, |
|||
| bool * | pAbort = NULL | |||
| ) |
Rotate a data set.
The original dimensions of the data set are maintained. This means that data clipping and padding may occur.
| pDst | Destination RasterElement. Must be initialized to the same params as pSrc. | |
| pSrc | RasterElement to rotate. | |
| angle | Rotate by this angle. In radians. | |
| defaultValue | Pixels which do not map to anything in the original data set will be set to this value. This value will be added to the bad values list if it is not already there. | |
| interp | Interpolation type. Only NEAREST_NEIGHBOR is currently supported. | |
| pProgress | Report progress. | |
| pAbort | If not NULL, check this value during the rotation. If the value becomes true, abort. |
True if successful, false on error. | uint64_t RasterUtilities::sanitizeData | ( | void * | pData, | |
| uint64_t | count, | |||
| EncodingType | type, | |||
| double | value = 0.0 | |||
| ) |
Sanitize the given data.
This method will iterate over the given data and replace all instances of floating point NaNs with the specified value.
| pData | Pointer to the data to be sanitized. | |
| count | The number of data values to be sanitized. | |
| type | The EncodingType of pData. | |
| value | The value to use for all instances of floating point NaNs. This value will be cast (via static_cast) to the given EncodingType. |
Definition at line 944 of file RasterUtilities.h.
| uint64_t RasterUtilities::sanitizeData | ( | T * | pData, | |
| uint64_t | count, | |||
| double | value = 0.0 | |||
| ) |
Sanitize the given data.
This method will iterate over the given data and replace all instances of floating point NaNs with the specified value.
| pData | Pointer to the data to be sanitized. | |
| count | The number of data values to be sanitized. | |
| value | The value to use for all instances of floating point NaNs. This value will be cast (via static_cast) to T. |
Definition at line 904 of file RasterUtilities.h.
| void RasterUtilities::subsetDataDescriptor | ( | DataDescriptor * | pDd, | |
| const DimensionDescriptor & | startRow, | |||
| const DimensionDescriptor & | stopRow, | |||
| unsigned int | rowSkipFactor, | |||
| const DimensionDescriptor & | startCol, | |||
| const DimensionDescriptor & | stopCol, | |||
| unsigned int | colSkipFactor, | |||
| const DimensionDescriptor & | startBand, | |||
| const DimensionDescriptor & | stopBand, | |||
| unsigned int | bandSkipFactor | |||
| ) |
Modifies the provided DataDescriptor to include only the subset specified.
| pDd | The DataDescriptor that should be modified to only include the specified subset. | |
| startRow | The DimensionDescriptor that specifies the starting row of the subset. The DimensionDescriptor::getOriginalNumber() will be used to determine the start of the row subset in the vector. A default constructed DimensionDescriptor can be provided, in which case the first row will be used. | |
| stopRow | The DimensionDescriptor that specifies the ending row of the subset. The DimensionDescriptor::getOriginalNumber() will be used to determine the end of the row subset in the vector. A default constructed DimensionDescriptor can be provided, in which case the last row will be used. | |
| rowSkipFactor | Specifies the number of rows that should be skipped while creating the subset. For example, a skipFactor of 0 would include the following row positions: 0, 1, 2, 3, 4, 5, 6. For example, a skipFactor of 1 would include the following row positions: 0, 2, 4, 6. | |
| startCol | The DimensionDescriptor that specifies the starting column of the subset. The DimensionDescriptor::getOriginalNumber() will be used to determine the start of the column subset in the vector. A default constructed DimensionDescriptor can be provided, in which case the first column will be used. | |
| stopCol | The DimensionDescriptor that specifies the ending column of the subset. The DimensionDescriptor::getOriginalNumber() will be used to determine the end of the column subset in the vector. A default constructed DimensionDescriptor can be provided, in which case the last column will be used. | |
| colSkipFactor | Specifies the number of columns that should be skipped while creating the subset. For example, a skipFactor of 0 would include the following column positions: 0, 1, 2, 3, 4, 5, 6. For example, a skipFactor of 1 would include the following column positions: 0, 2, 4, 6. | |
| startBand | The DimensionDescriptor that specifies the starting band of the subset. The DimensionDescriptor::getOriginalNumber() will be used to determine the start of the band subset in the vector. A default constructed DimensionDescriptor can be provided, in which case the first band will be used. | |
| stopBand | The DimensionDescriptor that specifies the ending band of the subset. The DimensionDescriptor::getOriginalNumber() will be used to determine the end of the band subset in the vector. A default constructed DimensionDescriptor can be provided, in which case the last band will be used. | |
| bandSkipFactor | Specifies the number of band that should be skipped while creating the subset. For example, a skipFactor of 0 would include the following band positions: 0, 1, 2, 3, 4, 5, 6. For example, a skipFactor of 1 would include the following band positions: 0, 2, 4, 6. |
| void RasterUtilities::subsetDataDescriptor | ( | DataDescriptor * | pDd, | |
| const DimensionDescriptor & | startRow, | |||
| const DimensionDescriptor & | stopRow, | |||
| unsigned int | rowSkipFactor, | |||
| const DimensionDescriptor & | startCol, | |||
| const DimensionDescriptor & | stopCol, | |||
| unsigned int | colSkipFactor, | |||
| const std::vector< DimensionDescriptor > & | subsetBands = std::vector< DimensionDescriptor >() | |||
| ) |
Modifies the provided DataDescriptor to include only the subset specified.
| pDd | The DataDescriptor that should be modified to only include the specified subset. | |
| startRow | The DimensionDescriptor that specifies the starting row of the subset. The DimensionDescriptor::getOriginalNumber() will be used to determine the start of the row subset in the vector. A default constructed DimensionDescriptor can be provided, in which case the first row will be used. | |
| stopRow | The DimensionDescriptor that specifies the ending row of the subset. The DimensionDescriptor::getOriginalNumber() will be used to determine the end of the row subset in the vector. A default constructed DimensionDescriptor can be provided, in which case the last row will be used. | |
| rowSkipFactor | Specifies the number of rows that should be skipped while creating the subset. For example, a skipFactor of 0 would include the following row positions: 0, 1, 2, 3, 4, 5, 6. For example, a skipFactor of 1 would include the following row positions: 0, 2, 4, 6. | |
| startCol | The DimensionDescriptor that specifies the starting column of the subset. The DimensionDescriptor::getOriginalNumber() will be used to determine the start of the column subset in the vector. A default constructed DimensionDescriptor can be provided, in which case the first column will be used. | |
| stopCol | The DimensionDescriptor that specifies the ending column of the subset. The DimensionDescriptor::getOriginalNumber() will be used to determine the end of the column subset in the vector. A default constructed DimensionDescriptor can be provided, in which case the last column will be used. | |
| colSkipFactor | Specifies the number of columns that should be skipped while creating the subset. For example, a skipFactor of 0 would include the following column positions: 0, 1, 2, 3, 4, 5, 6. For example, a skipFactor of 1 would include the following column positions: 0, 2, 4, 6. | |
| subsetBands | Specifies the list of bands that should be included in the subset. The vector must be a subset of the DataDescriptor::getBands() value. An empty vector can be provided, in which case no bands will be removed during the subset. |
| std::vector<DimensionDescriptor> RasterUtilities::subsetDimensionVector | ( | const std::vector< DimensionDescriptor > & | origValues, | |
| const DimensionDescriptor & | start, | |||
| const DimensionDescriptor & | stop, | |||
| unsigned int | skipFactor = 0 | |||
| ) |
Returns a subset DimensionDescriptor vector.
| origValues | The DimensionDescriptor vector that should be subset. | |
| start | The DimensionDescriptor that specifies the start of the subset. The DimensionDescriptor::getOriginalNumber() will be used to determine the start of the subset in the vector. A default constructed DimensionDescriptor can be provided, in which case the beginning of the origVector will be used. | |
| stop | The DimensionDescriptor that specifies the end of the subset. The DimensionDescriptor::getOriginalNumber() will be used to determine the end of the subset in the vector. A default constructed DimensionDescriptor can be provided, in which case the end of the origVector will be used. | |
| skipFactor | Specifies the number of DimensionDescriptors that should be skipped while creating the subset. For example, a skipFactor of 0 would include the following entries of the vector: 0, 1, 2, 3, 4, 5, 6. For example, a skipFactor of 1 would include the following entries of the vector: 0, 2, 4, 6. |