OmniSciDB  06b3bd477c
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GeoTargetValueSerializer< kPOINT > Struct Template Reference

#include <ResultSetGeoSerialization.h>

Static Public Member Functions

static TargetValue serialize (const SQLTypeInfo &geo_ti, std::array< VarlenDatumPtr, 1 > &vals)

Detailed Description

struct GeoTargetValueSerializer< kPOINT >

Definition at line 78 of file ResultSetGeoSerialization.h.

Member Function Documentation

static TargetValue GeoTargetValueSerializer< kPOINT >::serialize ( const SQLTypeInfo geo_ti,
std::array< VarlenDatumPtr, 1 > &  vals 

Definition at line 79 of file ResultSetGeoSerialization.h.

References geospatial::decompress_coords< double, SQLTypeInfo >(), and SQLTypeInfo::get_notnull().

80  {
81  if (!geo_ti.get_notnull() && vals[0]->is_null) {
82  // Alternatively, could decompress vals[0] and check for NULL array sentinel
83  return GeoTargetValue(boost::optional<GeoPointTargetValue>{});
84  }
85  return GeoTargetValue(
86  boost::optional<GeoPointTargetValue>{*decompress_coords<double, SQLTypeInfo>(
87  geo_ti, vals[0]->pointer, vals[0]->length)});
88  }
boost::optional< boost::variant< GeoPointTargetValue, GeoLineStringTargetValue, GeoPolyTargetValue, GeoMultiPolyTargetValue >> GeoTargetValue
Definition: TargetValue.h:161
std::shared_ptr< std::vector< double > > decompress_coords< double, SQLTypeInfo >(const SQLTypeInfo &geo_ti, const int8_t *coords, const size_t coords_sz)
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:265

+ Here is the call graph for this function:

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