MCPcopy Create free account
hub / github.com/PDAL/PDAL / computePDALDimensionTypes

Method computePDALDimensionTypes

pdal/private/gdal/Raster.cpp:505–530  ·  view source on GitHub ↗

Compute a vector of the PDAL datatypes that are stored in the raster bands of a dataset. \return Error code or GDALError::None. */

Source from the content-addressed store, hash-verified

503 \return Error code or GDALError::None.
504*/
505GDALError Raster::computePDALDimensionTypes()
506{
507 if (!m_ds)
508 {
509 m_errorMsg = "Raster not open.";
510 return GDALError::NotOpen;
511 }
512
513 m_types.clear();
514 for (int i = 0; i < m_numBands; ++i)
515 {
516 // Raster bands are numbered from 1.
517 GDALRasterBand *band = m_ds->GetRasterBand(i + 1);
518 if (!band)
519 {
520 std::ostringstream oss;
521
522 oss << "Unable to get band " << (i + 1) <<
523 " from raster data source '" << m_filename << "'.";
524 m_errorMsg = oss.str();
525 return GDALError::InvalidBand;
526 }
527 m_types.push_back(toPdalType(band->GetRasterDataType()));
528 }
529 return GDALError::None;
530}
531
532
533/**

Callers

nothing calls this directly

Calls 3

toPdalTypeFunction · 0.85
strMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected