OmniSciDB  c07336695a
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)
 
 ~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_
 
Importer_NS::RenderGroupAnalyzer render_group_analyzer_
 
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< GeoPolyTargetValueGEO_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< GeoPointTargetValueGEO_POINT_VALUE_ACCESSOR
 
- Public Attributes inherited from TargetValueConverter
const ColumnDescriptorcolumn_descriptor_
 
boost_variant_accessor< ScalarTargetValueSCALAR_TARGET_VALUE_ACCESSOR
 
boost_variant_accessor< ArrayTargetValueARRAY_TARGET_VALUE_ACCESSOR
 
boost_variant_accessor< GeoTargetValueGEO_TARGET_VALUE_ACCESSOR
 
boost_variant_accessor< NullableStringNULLABLE_STRING_ACCESSOR
 
boost_variant_accessor< std::string > STRING_ACCESSOR
 

Detailed Description

Definition at line 661 of file TargetValueConvertersImpl.h.

Constructor & Destructor Documentation

◆ GeoPolygonValueConverter()

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

Definition at line 671 of file TargetValueConvertersImpl.h.

References CHECK, and Catalog_Namespace::Catalog::getMetadataForColumn().

674  : GeoPointValueConverter(cat, num_rows, logicalColumnDescriptor) {
684 
685  if (num_rows) {
687  }
688  }
const int8_t const int64_t * num_rows
const ColumnDescriptor * bounds_column_descriptor_
const ColumnDescriptor * column_descriptor_
const ColumnDescriptor * getMetadataForColumn(int tableId, const std::string &colName) const
GeoPointValueConverter(const Catalog_Namespace::Catalog &cat, size_t num_rows, const ColumnDescriptor *logicalColumnDescriptor)
const ColumnDescriptor * ring_sizes_column_descriptor_
const ColumnDescriptor * render_group_column_descriptor_
void allocateColumnarData(size_t num_rows) override
#define CHECK(condition)
Definition: Logger.h:187
+ Here is the call graph for this function:

◆ ~GeoPolygonValueConverter()

GeoPolygonValueConverter::~GeoPolygonValueConverter ( )
inlineoverride

Definition at line 690 of file TargetValueConvertersImpl.h.

690 {}

Member Function Documentation

◆ addDataBlocksToInsertData()

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

Reimplemented from GeoPointValueConverter.

Definition at line 715 of file TargetValueConvertersImpl.h.

References GeoPointValueConverter::addDataBlocksToInsertData(), DataBlockPtr::arraysPtr, ColumnDescriptor::columnId, Fragmenter_Namespace::InsertData::columnIds, Fragmenter_Namespace::InsertData::data, and DataBlockPtr::numbersPtr.

715  {
717 
718  DataBlockPtr ringSizes, bounds, renderGroup;
719 
720  ringSizes.arraysPtr = ring_sizes_data_.get();
721  bounds.arraysPtr = bounds_data_.get();
722  renderGroup.numbersPtr = reinterpret_cast<int8_t*>(render_group_data_.get());
723 
724  insertData.data.emplace_back(ringSizes);
725  insertData.columnIds.emplace_back(ring_sizes_column_descriptor_->columnId);
726 
727  insertData.data.emplace_back(bounds);
728  insertData.columnIds.emplace_back(bounds_column_descriptor_->columnId);
729 
730  insertData.data.emplace_back(renderGroup);
731  insertData.columnIds.emplace_back(render_group_column_descriptor_->columnId);
732  }
std::vector< ArrayDatum > * arraysPtr
Definition: sqltypes.h:139
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:64
const ColumnDescriptor * render_group_column_descriptor_
void addDataBlocksToInsertData(Fragmenter_Namespace::InsertData &insertData) override
int8_t * numbersPtr
Definition: sqltypes.h:137
std::vector< int > columnIds
identifies the table into which the data is being inserted
Definition: Fragmenter.h:62
+ Here is the call graph for this function:

◆ allocateColumnarData()

void GeoPolygonValueConverter::allocateColumnarData ( size_t  num_rows)
inlineoverridevirtual

Reimplemented from GeoPointValueConverter.

Definition at line 692 of file TargetValueConvertersImpl.h.

References GeoPointValueConverter::allocateColumnarData(), and num_rows.

692  {
694  ring_sizes_data_ = std::make_unique<std::vector<ArrayDatum>>(num_rows);
695  bounds_data_ = std::make_unique<std::vector<ArrayDatum>>(num_rows);
696  render_group_data_ = std::make_unique<int32_t[]>(num_rows);
697  }
const int8_t const int64_t * num_rows
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:

◆ convertToColumnarFormat()

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

Reimplemented from GeoPointValueConverter.

Definition at line 701 of file TargetValueConvertersImpl.h.

References compute_bounds_of_coords(), Importer_NS::RenderGroupAnalyzer::insertBoundsAndReturnRenderGroup(), and to_array_datum().

701  {
702  auto geoValue = checked_get<GeoTargetValue>(row, value, GEO_TARGET_VALUE_ACCESSOR);
703  auto geoPoly =
704  checked_get<GeoPolyTargetValue>(row, geoValue, GEO_POLY_VALUE_ACCESSOR);
705 
706  (*column_data_)[row] = "";
707  (*signed_compressed_coords_data_)[row] = toCompressedCoords(geoPoly->coords);
708  (*ring_sizes_data_)[row] = to_array_datum(geoPoly->ring_sizes);
709  auto bounds = compute_bounds_of_coords(geoPoly->coords);
710  (*bounds_data_)[row] = to_array_datum(bounds);
711  render_group_data_[row] =
713  }
ArrayDatum to_array_datum(const std::vector< ELEM_TYPE > &vector)
int insertBoundsAndReturnRenderGroup(const std::vector< double > &bounds)
Definition: Importer.cpp:4896
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)
boost_variant_accessor< GeoPolyTargetValue > GEO_POLY_VALUE_ACCESSOR
std::unique_ptr< int32_t[]> render_group_data_
Importer_NS::RenderGroupAnalyzer render_group_analyzer_
boost_variant_accessor< GeoTargetValue > GEO_TARGET_VALUE_ACCESSOR
+ Here is the call graph for this function:

Member Data Documentation

◆ bounds_column_descriptor_

const ColumnDescriptor* GeoPolygonValueConverter::bounds_column_descriptor_

Definition at line 663 of file TargetValueConvertersImpl.h.

◆ bounds_data_

std::unique_ptr<std::vector<ArrayDatum> > GeoPolygonValueConverter::bounds_data_

Definition at line 668 of file TargetValueConvertersImpl.h.

◆ GEO_POLY_VALUE_ACCESSOR

boost_variant_accessor<GeoPolyTargetValue> GeoPolygonValueConverter::GEO_POLY_VALUE_ACCESSOR

Definition at line 699 of file TargetValueConvertersImpl.h.

◆ render_group_analyzer_

Importer_NS::RenderGroupAnalyzer GeoPolygonValueConverter::render_group_analyzer_

Definition at line 665 of file TargetValueConvertersImpl.h.

◆ render_group_column_descriptor_

const ColumnDescriptor* GeoPolygonValueConverter::render_group_column_descriptor_

Definition at line 664 of file TargetValueConvertersImpl.h.

◆ render_group_data_

std::unique_ptr<int32_t[]> GeoPolygonValueConverter::render_group_data_

Definition at line 669 of file TargetValueConvertersImpl.h.

◆ ring_sizes_column_descriptor_

const ColumnDescriptor* GeoPolygonValueConverter::ring_sizes_column_descriptor_

Definition at line 662 of file TargetValueConvertersImpl.h.

◆ ring_sizes_data_

std::unique_ptr<std::vector<ArrayDatum> > GeoPolygonValueConverter::ring_sizes_data_

Definition at line 667 of file TargetValueConvertersImpl.h.


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