OmniSciDB  4201147b46
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GeoPolygonValueConverter Struct Reference

#include <TargetValueConvertersImpl.h>

+ Inheritance diagram for GeoPolygonValueConverter:
+ Collaboration diagram for GeoPolygonValueConverter:

Public Member Functions

 GeoPolygonValueConverter (const Catalog_Namespace::Catalog &cat, size_t num_rows, const ColumnDescriptor *logicalColumnDescriptor, RenderGroupAnalyzerMap *render_group_analyzer_map)
 
 ~GeoPolygonValueConverter () override
 
void allocateColumnarData (size_t num_rows) override
 
void convertToColumnarFormat (size_t row, const TargetValue *value) override
 
void addDataBlocksToInsertData (Fragmenter_Namespace::InsertData &insertData) override
 
- Public Member Functions inherited from GeoPointValueConverter
 GeoPointValueConverter (const Catalog_Namespace::Catalog &cat, size_t num_rows, const ColumnDescriptor *logicalColumnDescriptor)
 
 ~GeoPointValueConverter () override
 
ArrayDatum toCompressedCoords (const std::shared_ptr< std::vector< double >> &coords)
 
- Public Member Functions inherited from TargetValueConverter
 TargetValueConverter (const ColumnDescriptor *cd)
 
virtual ~TargetValueConverter ()
 
virtual void finalizeDataBlocksForInsertData ()
 

Public Attributes

const ColumnDescriptorring_sizes_column_descriptor_
 
const ColumnDescriptorbounds_column_descriptor_
 
const ColumnDescriptorrender_group_column_descriptor_
 
std::unique_ptr< std::vector
< ArrayDatum > > 
ring_sizes_data_
 
std::unique_ptr< std::vector
< ArrayDatum > > 
bounds_data_
 
std::unique_ptr< int32_t[]> render_group_data_
 
boost_variant_accessor
< GeoPolyTargetValue
GEO_POLY_VALUE_ACCESSOR
 
- Public Attributes inherited from GeoPointValueConverter
const ColumnDescriptorcoords_column_descriptor_
 
std::unique_ptr< std::vector
< std::string > > 
column_data_
 
std::unique_ptr< std::vector
< ArrayDatum > > 
signed_compressed_coords_data_
 
boost_variant_accessor
< GeoTargetValue
GEO_VALUE_ACCESSOR
 
boost_variant_accessor
< GeoPointTargetValue
GEO_POINT_VALUE_ACCESSOR
 
- Public Attributes inherited from TargetValueConverter
const ColumnDescriptorcolumn_descriptor_
 
boost_variant_accessor
< ScalarTargetValue
SCALAR_TARGET_VALUE_ACCESSOR
 
boost_variant_accessor
< ArrayTargetValue
ARRAY_TARGET_VALUE_ACCESSOR
 
boost_variant_accessor
< GeoTargetValue
GEO_TARGET_VALUE_ACCESSOR
 
boost_variant_accessor
< NullableString
NULLABLE_STRING_ACCESSOR
 
boost_variant_accessor
< std::string > 
STRING_ACCESSOR
 

Additional Inherited Members

- Protected Member Functions inherited from GeoPolygonRenderGroupManager
 GeoPolygonRenderGroupManager (RenderGroupAnalyzerMap *render_group_analyzer_map, const int column_id)
 
- Protected Attributes inherited from GeoPolygonRenderGroupManager
import_export::RenderGroupAnalyzerrender_group_analyzer_
 

Detailed Description

Definition at line 817 of file TargetValueConvertersImpl.h.

Constructor & Destructor Documentation

GeoPolygonValueConverter::GeoPolygonValueConverter ( const Catalog_Namespace::Catalog cat,
size_t  num_rows,
const ColumnDescriptor logicalColumnDescriptor,
RenderGroupAnalyzerMap render_group_analyzer_map 
)
inline

Definition at line 827 of file TargetValueConvertersImpl.h.

References allocateColumnarData(), bounds_column_descriptor_, CHECK, TargetValueConverter::column_descriptor_, ColumnDescriptor::columnId, Catalog_Namespace::Catalog::getMetadataForColumn(), render_group_column_descriptor_, ring_sizes_column_descriptor_, and ColumnDescriptor::tableId.

831  : GeoPointValueConverter(cat, num_rows, logicalColumnDescriptor)
832  , GeoPolygonRenderGroupManager(render_group_analyzer_map,
833  logicalColumnDescriptor->columnId) {
843 
844  if (num_rows) {
845  allocateColumnarData(num_rows);
846  }
847  }
const ColumnDescriptor * bounds_column_descriptor_
const ColumnDescriptor * column_descriptor_
GeoPointValueConverter(const Catalog_Namespace::Catalog &cat, size_t num_rows, const ColumnDescriptor *logicalColumnDescriptor)
const ColumnDescriptor * ring_sizes_column_descriptor_
const ColumnDescriptor * getMetadataForColumn(int tableId, const std::string &colName) const
GeoPolygonRenderGroupManager(RenderGroupAnalyzerMap *render_group_analyzer_map, const int column_id)
const ColumnDescriptor * render_group_column_descriptor_
void allocateColumnarData(size_t num_rows) override
#define CHECK(condition)
Definition: Logger.h:222

+ Here is the call graph for this function:

GeoPolygonValueConverter::~GeoPolygonValueConverter ( )
inlineoverride

Definition at line 849 of file TargetValueConvertersImpl.h.

849 {}

Member Function Documentation

void GeoPolygonValueConverter::addDataBlocksToInsertData ( Fragmenter_Namespace::InsertData insertData)
inlineoverridevirtual

Reimplemented from GeoPointValueConverter.

Definition at line 894 of file TargetValueConvertersImpl.h.

References GeoPointValueConverter::addDataBlocksToInsertData(), DataBlockPtr::arraysPtr, bounds_column_descriptor_, bounds_data_, ColumnDescriptor::columnId, Fragmenter_Namespace::InsertData::columnIds, Fragmenter_Namespace::InsertData::data, DataBlockPtr::numbersPtr, render_group_column_descriptor_, render_group_data_, ring_sizes_column_descriptor_, and ring_sizes_data_.

894  {
896 
897  DataBlockPtr ringSizes, bounds, renderGroup;
898 
899  ringSizes.arraysPtr = ring_sizes_data_.get();
900  bounds.arraysPtr = bounds_data_.get();
901  renderGroup.numbersPtr = reinterpret_cast<int8_t*>(render_group_data_.get());
902 
903  insertData.data.emplace_back(ringSizes);
904  insertData.columnIds.emplace_back(ring_sizes_column_descriptor_->columnId);
905 
906  insertData.data.emplace_back(bounds);
907  insertData.columnIds.emplace_back(bounds_column_descriptor_->columnId);
908 
909  insertData.data.emplace_back(renderGroup);
910  insertData.columnIds.emplace_back(render_group_column_descriptor_->columnId);
911  }
std::vector< ArrayDatum > * arraysPtr
Definition: sqltypes.h:228
const ColumnDescriptor * bounds_column_descriptor_
std::unique_ptr< std::vector< ArrayDatum > > bounds_data_
const ColumnDescriptor * ring_sizes_column_descriptor_
std::unique_ptr< std::vector< ArrayDatum > > ring_sizes_data_
std::unique_ptr< int32_t[]> render_group_data_
std::vector< DataBlockPtr > data
the number of rows being inserted
Definition: Fragmenter.h:73
const ColumnDescriptor * render_group_column_descriptor_
void addDataBlocksToInsertData(Fragmenter_Namespace::InsertData &insertData) override
int8_t * numbersPtr
Definition: sqltypes.h:226
std::vector< int > columnIds
identifies the table into which the data is being inserted
Definition: Fragmenter.h:71

+ Here is the call graph for this function:

void GeoPolygonValueConverter::allocateColumnarData ( size_t  num_rows)
inlineoverridevirtual

Reimplemented from GeoPointValueConverter.

Definition at line 851 of file TargetValueConvertersImpl.h.

References GeoPointValueConverter::allocateColumnarData(), bounds_data_, render_group_data_, and ring_sizes_data_.

Referenced by GeoPolygonValueConverter().

851  {
853  ring_sizes_data_ = std::make_unique<std::vector<ArrayDatum>>(num_rows);
854  bounds_data_ = std::make_unique<std::vector<ArrayDatum>>(num_rows);
855  render_group_data_ = std::make_unique<int32_t[]>(num_rows);
856  }
void allocateColumnarData(size_t num_rows) override
std::unique_ptr< std::vector< ArrayDatum > > bounds_data_
std::unique_ptr< std::vector< ArrayDatum > > ring_sizes_data_
std::unique_ptr< int32_t[]> render_group_data_

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void GeoPolygonValueConverter::convertToColumnarFormat ( size_t  row,
const TargetValue value 
)
inlineoverridevirtual

Reimplemented from GeoPointValueConverter.

Definition at line 860 of file TargetValueConvertersImpl.h.

References CHECK, compute_bounds_of_coords(), GEO_POLY_VALUE_ACCESSOR, TargetValueConverter::GEO_TARGET_VALUE_ACCESSOR, import_export::RenderGroupAnalyzer::insertBoundsAndReturnRenderGroup(), NULL_ARRAY_DOUBLE, NULL_DOUBLE, NULL_INT, GeoPolygonRenderGroupManager::render_group_analyzer_, render_group_data_, to_array_datum(), and GeoPointValueConverter::toCompressedCoords().

860  {
861  const auto geoValue =
862  checked_get<GeoTargetValue>(row, value, GEO_TARGET_VALUE_ACCESSOR);
863  CHECK(geoValue);
864  if (geoValue->is_initialized()) {
865  const auto geo = geoValue->get();
866  const auto geoPoly =
867  checked_get<GeoPolyTargetValue>(row, &geo, GEO_POLY_VALUE_ACCESSOR);
868 
869  (*column_data_)[row] = "";
870  (*signed_compressed_coords_data_)[row] = toCompressedCoords(geoPoly->coords);
871  (*ring_sizes_data_)[row] = to_array_datum(geoPoly->ring_sizes);
872  auto bounds = compute_bounds_of_coords(geoPoly->coords);
873  (*bounds_data_)[row] = to_array_datum(bounds);
875  render_group_data_[row] =
877  } else {
878  render_group_data_[row] = 0;
879  }
880  } else {
881  // NULL Polygon
882  (*column_data_)[row] = "";
883  (*signed_compressed_coords_data_)[row] = ArrayDatum(0, nullptr, true);
884  (*ring_sizes_data_)[row] = ArrayDatum(0, nullptr, true);
885  std::vector<double> bounds = {
886  NULL_ARRAY_DOUBLE, NULL_DOUBLE, NULL_DOUBLE, NULL_DOUBLE};
887  auto bounds_datum = to_array_datum(bounds);
888  bounds_datum.is_null = true;
889  (*bounds_data_)[row] = bounds_datum;
891  }
892  }
ArrayDatum to_array_datum(const std::vector< ELEM_TYPE > &vector)
#define NULL_DOUBLE
import_export::RenderGroupAnalyzer * render_group_analyzer_
ArrayDatum toCompressedCoords(const std::shared_ptr< std::vector< double >> &coords)
std::vector< double > compute_bounds_of_coords(const std::shared_ptr< std::vector< double >> &coords)
#define NULL_INT
std::conditional_t< is_cuda_compiler(), DeviceArrayDatum, HostArrayDatum > ArrayDatum
Definition: sqltypes.h:208
boost_variant_accessor< GeoPolyTargetValue > GEO_POLY_VALUE_ACCESSOR
std::unique_ptr< int32_t[]> render_group_data_
#define NULL_ARRAY_DOUBLE
#define CHECK(condition)
Definition: Logger.h:222
boost_variant_accessor< GeoTargetValue > GEO_TARGET_VALUE_ACCESSOR
int insertBoundsAndReturnRenderGroup(const std::vector< double > &bounds)

+ Here is the call graph for this function:

Member Data Documentation

const ColumnDescriptor* GeoPolygonValueConverter::bounds_column_descriptor_
std::unique_ptr<std::vector<ArrayDatum> > GeoPolygonValueConverter::bounds_data_

Definition at line 824 of file TargetValueConvertersImpl.h.

Referenced by addDataBlocksToInsertData(), and allocateColumnarData().

boost_variant_accessor<GeoPolyTargetValue> GeoPolygonValueConverter::GEO_POLY_VALUE_ACCESSOR

Definition at line 858 of file TargetValueConvertersImpl.h.

Referenced by convertToColumnarFormat().

const ColumnDescriptor* GeoPolygonValueConverter::render_group_column_descriptor_
std::unique_ptr<int32_t[]> GeoPolygonValueConverter::render_group_data_
const ColumnDescriptor* GeoPolygonValueConverter::ring_sizes_column_descriptor_
std::unique_ptr<std::vector<ArrayDatum> > GeoPolygonValueConverter::ring_sizes_data_

Definition at line 823 of file TargetValueConvertersImpl.h.

Referenced by addDataBlocksToInsertData(), and allocateColumnarData().


The documentation for this struct was generated from the following file: