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

#include <TargetValueConvertersImpl.h>

+ Inheritance diagram for GeoMultiPolygonValueConverter:
+ Collaboration diagram for GeoMultiPolygonValueConverter:

Public Member Functions

 GeoMultiPolygonValueConverter (const Catalog_Namespace::Catalog &cat, size_t num_rows, const ColumnDescriptor *logicalColumnDescriptor, RenderGroupAnalyzerMap *render_group_analyzer_map)
 
 ~GeoMultiPolygonValueConverter () 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 ColumnDescriptorring_sizes_solumn_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 > > 
poly_rings_data_
 
std::unique_ptr< std::vector
< ArrayDatum > > 
bounds_data_
 
std::unique_ptr< int32_t[]> render_group_data_
 
boost_variant_accessor
< GeoMultiPolyTargetValue
GEO_MULTI_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 914 of file TargetValueConvertersImpl.h.

Constructor & Destructor Documentation

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

Definition at line 926 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_, ring_sizes_solumn_descriptor_, and ColumnDescriptor::tableId.

930  : GeoPointValueConverter(cat, num_rows, logicalColumnDescriptor)
931  , GeoPolygonRenderGroupManager(render_group_analyzer_map,
932  logicalColumnDescriptor->columnId) {
945 
946  if (num_rows) {
947  allocateColumnarData(num_rows);
948  }
949  }
const ColumnDescriptor * ring_sizes_solumn_descriptor_
void allocateColumnarData(size_t num_rows) override
const ColumnDescriptor * column_descriptor_
GeoPointValueConverter(const Catalog_Namespace::Catalog &cat, size_t num_rows, const ColumnDescriptor *logicalColumnDescriptor)
const ColumnDescriptor * bounds_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_
#define CHECK(condition)
Definition: Logger.h:222
const ColumnDescriptor * ring_sizes_column_descriptor_

+ Here is the call graph for this function:

GeoMultiPolygonValueConverter::~GeoMultiPolygonValueConverter ( )
inlineoverride

Definition at line 951 of file TargetValueConvertersImpl.h.

951 {}

Member Function Documentation

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

Reimplemented from GeoPointValueConverter.

Definition at line 999 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, poly_rings_data_, render_group_column_descriptor_, render_group_data_, ring_sizes_column_descriptor_, ring_sizes_data_, and ring_sizes_solumn_descriptor_.

999  {
1001 
1002  DataBlockPtr ringSizes, polyRings, bounds, renderGroup;
1003 
1004  ringSizes.arraysPtr = ring_sizes_data_.get();
1005  polyRings.arraysPtr = poly_rings_data_.get();
1006  bounds.arraysPtr = bounds_data_.get();
1007  renderGroup.numbersPtr = reinterpret_cast<int8_t*>(render_group_data_.get());
1008 
1009  insertData.data.emplace_back(ringSizes);
1010  insertData.columnIds.emplace_back(ring_sizes_column_descriptor_->columnId);
1011 
1012  insertData.data.emplace_back(polyRings);
1013  insertData.columnIds.emplace_back(ring_sizes_solumn_descriptor_->columnId);
1014 
1015  insertData.data.emplace_back(bounds);
1016  insertData.columnIds.emplace_back(bounds_column_descriptor_->columnId);
1017 
1018  insertData.data.emplace_back(renderGroup);
1019  insertData.columnIds.emplace_back(render_group_column_descriptor_->columnId);
1020  }
std::unique_ptr< std::vector< ArrayDatum > > ring_sizes_data_
std::unique_ptr< std::vector< ArrayDatum > > bounds_data_
const ColumnDescriptor * ring_sizes_solumn_descriptor_
std::vector< ArrayDatum > * arraysPtr
Definition: sqltypes.h:228
std::unique_ptr< int32_t[]> render_group_data_
std::unique_ptr< std::vector< ArrayDatum > > poly_rings_data_
const ColumnDescriptor * bounds_column_descriptor_
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
const ColumnDescriptor * ring_sizes_column_descriptor_
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 GeoMultiPolygonValueConverter::allocateColumnarData ( size_t  num_rows)
inlineoverridevirtual

Reimplemented from GeoPointValueConverter.

Definition at line 953 of file TargetValueConvertersImpl.h.

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

Referenced by GeoMultiPolygonValueConverter().

953  {
955  ring_sizes_data_ = std::make_unique<std::vector<ArrayDatum>>(num_rows);
956  poly_rings_data_ = std::make_unique<std::vector<ArrayDatum>>(num_rows);
957  bounds_data_ = std::make_unique<std::vector<ArrayDatum>>(num_rows);
958  render_group_data_ = std::make_unique<int32_t[]>(num_rows);
959  }
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_
void allocateColumnarData(size_t num_rows) override
std::unique_ptr< std::vector< ArrayDatum > > poly_rings_data_

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Reimplemented from GeoPointValueConverter.

Definition at line 963 of file TargetValueConvertersImpl.h.

References CHECK, compute_bounds_of_coords(), GEO_MULTI_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().

963  {
964  const auto geoValue =
965  checked_get<GeoTargetValue>(row, value, GEO_TARGET_VALUE_ACCESSOR);
966  CHECK(geoValue);
967  if (geoValue->is_initialized()) {
968  const auto geo = geoValue->get();
969  const auto geoMultiPoly =
970  checked_get<GeoMultiPolyTargetValue>(row, &geo, GEO_MULTI_POLY_VALUE_ACCESSOR);
971 
972  (*column_data_)[row] = "";
973  (*signed_compressed_coords_data_)[row] = toCompressedCoords(geoMultiPoly->coords);
974  (*ring_sizes_data_)[row] = to_array_datum(geoMultiPoly->ring_sizes);
975  (*poly_rings_data_)[row] = to_array_datum(geoMultiPoly->poly_rings);
976  auto bounds = compute_bounds_of_coords(geoMultiPoly->coords);
977  (*bounds_data_)[row] = to_array_datum(bounds);
979  render_group_data_[row] =
981  } else {
982  render_group_data_[row] = 0;
983  }
984  } else {
985  // NULL MultiPolygon
986  (*column_data_)[row] = "";
987  (*signed_compressed_coords_data_)[row] = ArrayDatum(0, nullptr, true);
988  (*ring_sizes_data_)[row] = ArrayDatum(0, nullptr, true);
989  (*poly_rings_data_)[row] = ArrayDatum(0, nullptr, true);
990  std::vector<double> bounds = {
991  NULL_ARRAY_DOUBLE, NULL_DOUBLE, NULL_DOUBLE, NULL_DOUBLE};
992  auto bounds_datum = to_array_datum(bounds);
993  bounds_datum.is_null = true;
994  (*bounds_data_)[row] = bounds_datum;
996  }
997  }
ArrayDatum to_array_datum(const std::vector< ELEM_TYPE > &vector)
#define NULL_DOUBLE
import_export::RenderGroupAnalyzer * render_group_analyzer_
std::unique_ptr< int32_t[]> render_group_data_
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< GeoMultiPolyTargetValue > GEO_MULTI_POLY_VALUE_ACCESSOR
#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* GeoMultiPolygonValueConverter::bounds_column_descriptor_
std::unique_ptr<std::vector<ArrayDatum> > GeoMultiPolygonValueConverter::bounds_data_

Definition at line 923 of file TargetValueConvertersImpl.h.

Referenced by addDataBlocksToInsertData(), and allocateColumnarData().

boost_variant_accessor<GeoMultiPolyTargetValue> GeoMultiPolygonValueConverter::GEO_MULTI_POLY_VALUE_ACCESSOR

Definition at line 961 of file TargetValueConvertersImpl.h.

Referenced by convertToColumnarFormat().

std::unique_ptr<std::vector<ArrayDatum> > GeoMultiPolygonValueConverter::poly_rings_data_

Definition at line 922 of file TargetValueConvertersImpl.h.

Referenced by addDataBlocksToInsertData(), and allocateColumnarData().

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

Definition at line 921 of file TargetValueConvertersImpl.h.

Referenced by addDataBlocksToInsertData(), and allocateColumnarData().

const ColumnDescriptor* GeoMultiPolygonValueConverter::ring_sizes_solumn_descriptor_

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