OmniSciDB
a5dc49c757
|
#include <RasterImporter.h>
Classes | |
struct | ImportBandInfo |
Public Types | |
enum | PointType { PointType::kNone, PointType::kAuto, PointType::kSmallInt, PointType::kInt, PointType::kFloat, PointType::kDouble, PointType::kPoint } |
enum | PointTransform { PointTransform::kNone, PointTransform::kAuto, PointTransform::kFile, PointTransform::kWorld } |
using | NamesAndSQLTypes = std::vector< std::pair< std::string, SQLTypes >> |
using | RawPixels = std::vector< std::byte > |
using | NullValue = std::pair< double, bool > |
using | Coords = std::vector< std::tuple< double, double, float >> |
Public Member Functions | |
RasterImporter ()=default | |
~RasterImporter ()=default | |
void | detect (const std::string &file_name, const std::string &specified_band_names, const std::string &specified_band_dimensions, const PointType point_type, const PointTransform point_transform, const bool point_compute_angle, const bool throw_on_error, const MetadataColumnInfos &metadata_column_infos) |
void | import (size_t &max_threads, const bool max_threads_using_default) |
const uint32_t | getNumBands () const |
const PointTransform | getPointTransform () const |
const NamesAndSQLTypes | getPointNamesAndSQLTypes () const |
const NamesAndSQLTypes | getBandNamesAndSQLTypes () const |
const int | getBandsWidth () const |
const int | getBandsHeight () const |
const NullValue | getBandNullValue (const int band_idx) const |
const Coords | getProjectedPixelCoords (const uint32_t thread_idx, const int y) const |
void | getRawPixels (const uint32_t thread_idx, const uint32_t band_idx, const int y_start, const int num_rows, const SQLTypes column_sql_type, RawPixels &raw_pixel_bytes) |
Private Member Functions | |
void | getRawBandNamesForFormat (const Geospatial::GDAL::DataSourceUqPtr &datasource) |
void | initializeFiltering (const std::string &specified_band_names, const std::string &specified_band_dimensions, const MetadataColumnInfos &metadata_column_infos) |
bool | shouldImportBandWithName (const std::string &name) |
bool | shouldImportBandWithDimensions (const int width, const int height) |
std::string | getBandName (const uint32_t datasource_idx, const int band_idx) |
void | checkSpecifiedBandNamesFound () const |
Private Attributes | |
std::vector< std::string > | datasource_names_ |
std::vector< std::vector < std::string > > | raw_band_names_ |
std::map< std::string, bool > | specified_band_names_map_ |
std::map< std::string, int > | column_name_repeats_map_ |
std::vector< ImportBandInfo > | import_band_infos_ |
std::array< double, 6 > | affine_transform_matrix_ |
std::vector< std::vector < Geospatial::GDAL::DataSourceUqPtr > > | datasource_handles_ |
int | specified_band_width_ {-1} |
int | specified_band_height_ {-1} |
int | bands_width_ {-1} |
int | bands_height_ {-1} |
PointType | point_type_ {PointType::kNone} |
PointTransform | point_transform_ {PointTransform::kNone} |
std::vector < Geospatial::GDAL::CoordinateTransformationUqPtr > | coordinate_transformations_ |
std::vector< std::unique_ptr < GCPTransformer > > | gcp_transformers_ |
bool | point_compute_angle_ {false} |
Definition at line 55 of file RasterImporter.h.
using import_export::RasterImporter::Coords = std::vector<std::tuple<double, double, float>> |
Definition at line 77 of file RasterImporter.h.
using import_export::RasterImporter::NamesAndSQLTypes = std::vector<std::pair<std::string, SQLTypes>> |
Definition at line 74 of file RasterImporter.h.
using import_export::RasterImporter::NullValue = std::pair<double, bool> |
Definition at line 76 of file RasterImporter.h.
using import_export::RasterImporter::RawPixels = std::vector<std::byte> |
Definition at line 75 of file RasterImporter.h.
|
strong |
Enumerator | |
---|---|
kNone | |
kAuto | |
kFile | |
kWorld |
Definition at line 61 of file RasterImporter.h.
|
strong |
Enumerator | |
---|---|
kNone | |
kAuto | |
kSmallInt | |
kInt | |
kFloat | |
kDouble | |
kPoint |
Definition at line 60 of file RasterImporter.h.
|
default |
|
default |
|
private |
Definition at line 1051 of file RasterImporter.cpp.
References specified_band_names_map_.
Referenced by detect().
void import_export::RasterImporter::detect | ( | const std::string & | file_name, |
const std::string & | specified_band_names, | ||
const std::string & | specified_band_dimensions, | ||
const PointType | point_type, | ||
const PointTransform | point_transform, | ||
const bool | point_compute_angle, | ||
const bool | throw_on_error, | ||
const MetadataColumnInfos & | metadata_column_infos | ||
) |
Definition at line 276 of file RasterImporter.cpp.
References bands_height_, bands_width_, CHECK, checkSpecifiedBandNamesFound(), datasource_names_, DEBUG_RASTER_IMPORT, logger::ERROR, import_export::anonymous_namespace{RasterImporter.cpp}::gdal_data_type_to_sql_type(), getBandName(), getRawBandNamesForFormat(), import_band_infos_, logger::INFO, initializeFiltering(), kAuto, kDouble, kInt, kNone, kPoint, import_export::kRasterFile, kSmallInt, kWorld, LOG, LOG_IF, Geospatial::GDAL::logMetadata(), Geospatial::GDAL::openDataSource(), point_compute_angle_, point_transform_, point_type_, shouldImportBandWithDimensions(), shouldImportBandWithName(), specified_band_names_map_, to_string(), Geospatial::GDAL::unpackMetadata(), and logger::WARNING.
Referenced by import_export::Importer::gdalToColumnDescriptorsRaster(), and import_export::Importer::importGDALRaster().
|
private |
Definition at line 1019 of file RasterImporter.cpp.
References column_name_repeats_map_, raw_band_names_, ImportHelpers::sanitize_name(), spatial_type::suffix(), and to_string().
Referenced by detect().
const RasterImporter::NamesAndSQLTypes import_export::RasterImporter::getBandNamesAndSQLTypes | ( | ) | const |
Definition at line 696 of file RasterImporter.cpp.
References import_band_infos_.
Referenced by import_export::Importer::gdalToColumnDescriptorsRaster(), and import_export::Importer::importGDALRaster().
const RasterImporter::NullValue import_export::RasterImporter::getBandNullValue | ( | const int | band_idx | ) | const |
Definition at line 705 of file RasterImporter.cpp.
References CHECK_LT, and import_band_infos_.
Referenced by import_export::Importer::importGDALRaster().
|
inline |
Definition at line 84 of file RasterImporter.h.
References bands_height_.
Referenced by import_export::Importer::importGDALRaster().
|
inline |
Definition at line 83 of file RasterImporter.h.
References bands_width_.
Referenced by import_export::Importer::importGDALRaster().
const uint32_t import_export::RasterImporter::getNumBands | ( | ) | const |
Definition at line 666 of file RasterImporter.cpp.
References import_band_infos_.
Referenced by import_export::Importer::importGDALRaster().
const RasterImporter::NamesAndSQLTypes import_export::RasterImporter::getPointNamesAndSQLTypes | ( | ) | const |
Definition at line 670 of file RasterImporter.cpp.
References kFLOAT, kNone, kPoint, kWorld, point_compute_angle_, point_transform_, point_type_, and import_export::anonymous_namespace{RasterImporter.cpp}::point_type_to_sql_type().
Referenced by import_export::Importer::gdalToColumnDescriptorsRaster(), import_export::Importer::importGDALRaster(), and initializeFiltering().
const RasterImporter::PointTransform import_export::RasterImporter::getPointTransform | ( | ) | const |
Definition at line 692 of file RasterImporter.cpp.
References point_transform_.
const RasterImporter::Coords import_export::RasterImporter::getProjectedPixelCoords | ( | const uint32_t | thread_idx, |
const int | y | ||
) | const |
Definition at line 712 of file RasterImporter.cpp.
References affine_transform_matrix_, bands_width_, conv_4326_900913_x(), conv_4326_900913_y(), coordinate_transformations_, gcp_transformers_, kNone, kWorld, M_PI, point_compute_angle_, and point_transform_.
Referenced by import_export::Importer::importGDALRaster().
|
private |
Definition at line 832 of file RasterImporter.cpp.
References CHECK, datasource_names_, import_export::anonymous_namespace{RasterImporter.cpp}::get_ome_tiff_band_names(), Geospatial::GDAL::getMetadataString(), logger::INFO, LOG, setup::name, raw_band_names_, split(), and logger::WARNING.
Referenced by detect().
void import_export::RasterImporter::getRawPixels | ( | const uint32_t | thread_idx, |
const uint32_t | band_idx, | ||
const int | y_start, | ||
const int | num_rows, | ||
const SQLTypes | column_sql_type, | ||
RawPixels & | raw_pixel_bytes | ||
) |
Definition at line 783 of file RasterImporter.cpp.
References bands_width_, CHECK, CHECK_LT, datasource_handles_, import_band_infos_, run_benchmark_import::result, import_export::anonymous_namespace{RasterImporter.cpp}::sql_type_to_gdal_data_type(), and to_string().
Referenced by import_export::Importer::importGDALRaster().
void import_export::RasterImporter::import | ( | size_t & | max_threads, |
const bool | max_threads_using_default | ||
) |
Definition at line 547 of file RasterImporter.cpp.
References affine_transform_matrix_, CHECK, CHECK_GE, coordinate_transformations_, datasource_handles_, datasource_names_, import_export::anonymous_namespace{RasterImporter.cpp}::datasource_requires_libhdf(), gcp_transformers_, import_export::anonymous_namespace{RasterImporter.cpp}::get_datasource_driver_name(), shared::get_from_map(), import_band_infos_, kAuto, kDouble, kFloat, kInt, kNone, kPoint, import_export::kRasterFile, kSmallInt, kWorld, Geospatial::GDAL::openDataSource(), point_transform_, point_type_, and to_string().
Referenced by import_export::Importer::importGDALRaster().
|
private |
Definition at line 918 of file RasterImporter.cpp.
References column_name_repeats_map_, getPointNamesAndSQLTypes(), import_band_infos_, kNULLT, setup::name, specified_band_height_, specified_band_names_map_, specified_band_width_, split(), and strip().
Referenced by detect().
|
private |
Definition at line 1010 of file RasterImporter.cpp.
References specified_band_height_, and specified_band_width_.
Referenced by detect().
|
private |
Definition at line 996 of file RasterImporter.cpp.
References specified_band_names_map_.
Referenced by detect().
|
private |
Definition at line 110 of file RasterImporter.h.
Referenced by getProjectedPixelCoords(), and import().
|
private |
Definition at line 116 of file RasterImporter.h.
Referenced by detect(), and getBandsHeight().
|
private |
Definition at line 115 of file RasterImporter.h.
Referenced by detect(), getBandsWidth(), getProjectedPixelCoords(), and getRawPixels().
|
private |
Definition at line 108 of file RasterImporter.h.
Referenced by getBandName(), and initializeFiltering().
|
private |
Definition at line 120 of file RasterImporter.h.
Referenced by getProjectedPixelCoords(), and import().
|
private |
Definition at line 111 of file RasterImporter.h.
Referenced by getRawPixels(), and import().
|
private |
Definition at line 105 of file RasterImporter.h.
Referenced by detect(), getRawBandNamesForFormat(), and import().
|
private |
Definition at line 121 of file RasterImporter.h.
Referenced by getProjectedPixelCoords(), and import().
|
private |
Definition at line 109 of file RasterImporter.h.
Referenced by detect(), getBandNamesAndSQLTypes(), getBandNullValue(), getNumBands(), getRawPixels(), import(), and initializeFiltering().
|
private |
Definition at line 122 of file RasterImporter.h.
Referenced by detect(), getPointNamesAndSQLTypes(), and getProjectedPixelCoords().
|
private |
Definition at line 118 of file RasterImporter.h.
Referenced by detect(), getPointNamesAndSQLTypes(), getPointTransform(), getProjectedPixelCoords(), and import().
|
private |
Definition at line 117 of file RasterImporter.h.
Referenced by detect(), getPointNamesAndSQLTypes(), and import().
|
private |
Definition at line 106 of file RasterImporter.h.
Referenced by getBandName(), and getRawBandNamesForFormat().
|
private |
Definition at line 113 of file RasterImporter.h.
Referenced by initializeFiltering(), and shouldImportBandWithDimensions().
|
private |
Definition at line 107 of file RasterImporter.h.
Referenced by checkSpecifiedBandNamesFound(), detect(), initializeFiltering(), and shouldImportBandWithName().
|
private |
Definition at line 112 of file RasterImporter.h.
Referenced by initializeFiltering(), and shouldImportBandWithDimensions().