OmniSciDB  0fdbebe030
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
anonymous_namespace{ResultSetGeoSerialization.h} Namespace Reference

Functions

template<typename T >
void unpack_geo_vector (std::vector< T > &output, const int8_t *input_ptr, const size_t sz)
 
template<typename T >
void decompress_geo_coords_geoint32 (std::vector< T > &dec, const int8_t *enc, const size_t sz)
 
template<typename T >
std::shared_ptr< std::vector< T > > decompress_coords (const SQLTypeInfo &geo_ti, const int8_t *coords, const size_t coords_sz)
 
template<>
std::shared_ptr< std::vector
< double > > 
decompress_coords< double > (const SQLTypeInfo &geo_ti, const int8_t *coords, const size_t coords_sz)
 
bool is_null_point (const SQLTypeInfo &geo_ti, const int8_t *coords, const size_t coords_sz)
 

Function Documentation

template<typename T >
std::shared_ptr<std::vector<T> > anonymous_namespace{ResultSetGeoSerialization.h}::decompress_coords ( const SQLTypeInfo geo_ti,
const int8_t *  coords,
const size_t  coords_sz 
)
template<>
std::shared_ptr<std::vector<double> > anonymous_namespace{ResultSetGeoSerialization.h}::decompress_coords< double > ( const SQLTypeInfo geo_ti,
const int8_t *  coords,
const size_t  coords_sz 
)

Definition at line 113 of file ResultSetGeoSerialization.h.

References CHECK_EQ, decompress_geo_coords_geoint32(), kENCODING_GEOINT, kENCODING_NONE, and unpack_geo_vector().

Referenced by GeoTargetValueSerializer< kPOINT >::serialize(), GeoWktSerializer< kPOINT >::serialize(), GeoTargetValueSerializer< kLINESTRING >::serialize(), GeoWktSerializer< kLINESTRING >::serialize(), GeoTargetValueSerializer< kPOLYGON >::serialize(), GeoWktSerializer< kPOLYGON >::serialize(), GeoTargetValueSerializer< kMULTIPOLYGON >::serialize(), and GeoWktSerializer< kMULTIPOLYGON >::serialize().

115  {
116  auto decompressed_coords_ptr = std::make_shared<std::vector<double>>();
117  if (geo_ti.get_compression() == kENCODING_GEOINT) {
118  if (geo_ti.get_comp_param() == 32) {
119  decompress_geo_coords_geoint32(*decompressed_coords_ptr, coords, coords_sz);
120  }
121  } else {
123  unpack_geo_vector(*decompressed_coords_ptr, coords, coords_sz);
124  }
125  return decompressed_coords_ptr;
126 }
#define CHECK_EQ(x, y)
Definition: Logger.h:205
void unpack_geo_vector(std::vector< T > &output, const int8_t *input_ptr, const size_t sz)
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:256
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:257
void decompress_geo_coords_geoint32(std::vector< T > &dec, const int8_t *enc, const size_t sz)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void anonymous_namespace{ResultSetGeoSerialization.h}::decompress_geo_coords_geoint32 ( std::vector< T > &  dec,
const int8_t *  enc,
const size_t  sz 
)

Definition at line 91 of file ResultSetGeoSerialization.h.

References Geo_namespace::decompress_lattitude_coord_geoint32(), and Geo_namespace::decompress_longitude_coord_geoint32().

Referenced by decompress_coords< double >().

93  {
94  if (sz == 0) {
95  return;
96  }
97  const auto compressed_coords = reinterpret_cast<const int32_t*>(enc);
98  const auto num_coords = sz / sizeof(int32_t);
99  dec.resize(num_coords);
100  for (size_t i = 0; i < num_coords; i += 2) {
101  dec[i] = Geo_namespace::decompress_longitude_coord_geoint32(compressed_coords[i]);
102  dec[i + 1] =
103  Geo_namespace::decompress_lattitude_coord_geoint32(compressed_coords[i + 1]);
104  }
105 }
DEVICE double decompress_lattitude_coord_geoint32(const int32_t compressed)
DEVICE double decompress_longitude_coord_geoint32(const int32_t compressed)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool anonymous_namespace{ResultSetGeoSerialization.h}::is_null_point ( const SQLTypeInfo geo_ti,
const int8_t *  coords,
const size_t  coords_sz 
)

Definition at line 128 of file ResultSetGeoSerialization.h.

References CHECK_EQ, SQLTypeInfo::get_comp_param(), SQLTypeInfo::get_compression(), SQLTypeInfo::get_notnull(), SQLTypeInfo::get_type(), Geo_namespace::is_null_point_longitude_geoint32(), kENCODING_GEOINT, kENCODING_NONE, kPOINT, and NULL_ARRAY_DOUBLE.

Referenced by geospatial::compress_coords(), anonymous_namespace{ResultSetIteration.cpp}::GeoLazyFetchHandler::fetch(), anonymous_namespace{ResultSetIteration.cpp}::GeoQueryOutputFetchHandler::fetch(), Importer_NS::Importer::set_geo_physical_import_buffer(), and Importer_NS::Importer::set_geo_physical_import_buffer_columnar().

130  {
131  if (geo_ti.get_type() == kPOINT && !geo_ti.get_notnull()) {
132  if (geo_ti.get_compression() == kENCODING_GEOINT) {
133  if (geo_ti.get_comp_param() == 32) {
134  return Geo_namespace::is_null_point_longitude_geoint32(*((int32_t*)coords));
135  }
136  } else {
138  return *((double*)coords) == NULL_ARRAY_DOUBLE;
139  }
140  }
141  return false;
142 }
#define CHECK_EQ(x, y)
Definition: Logger.h:205
#define NULL_ARRAY_DOUBLE
Definition: sqltypes.h:183
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:248
DEVICE bool is_null_point_longitude_geoint32(const int32_t compressed)
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:256
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:257
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:255

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void anonymous_namespace{ResultSetGeoSerialization.h}::unpack_geo_vector ( std::vector< T > &  output,
const int8_t *  input_ptr,
const size_t  sz 
)

Definition at line 77 of file ResultSetGeoSerialization.h.

References CHECK_EQ.

Referenced by decompress_coords< double >(), GeoTargetValueSerializer< kPOLYGON >::serialize(), GeoWktSerializer< kPOLYGON >::serialize(), GeoTargetValueSerializer< kMULTIPOLYGON >::serialize(), and GeoWktSerializer< kMULTIPOLYGON >::serialize().

77  {
78  if (sz == 0) {
79  return;
80  }
81  auto elems = reinterpret_cast<const T*>(input_ptr);
82  CHECK_EQ(size_t(0), sz % sizeof(T));
83  const size_t num_elems = sz / sizeof(T);
84  output.resize(num_elems);
85  for (size_t i = 0; i < num_elems; i++) {
86  output[i] = elems[i];
87  }
88 }
#define CHECK_EQ(x, y)
Definition: Logger.h:205

+ Here is the caller graph for this function: