OmniSciDB  2c44a3935d
GeoWktSerializer< kMULTIPOLYGON > Struct Template Reference

#include <ResultSetGeoSerialization.h>

Static Public Member Functions

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

Detailed Description

template<>
struct GeoWktSerializer< kMULTIPOLYGON >

Definition at line 228 of file ResultSetGeoSerialization.h.

Member Function Documentation

◆ serialize()

static TargetValue GeoWktSerializer< kMULTIPOLYGON >::serialize ( const SQLTypeInfo geo_ti,
std::array< VarlenDatumPtr, 3 > &  vals 
)
inlinestatic

Definition at line 229 of file ResultSetGeoSerialization.h.

References geospatial::decompress_coords< double, SQLTypeInfo >(), SQLTypeInfo::get_notnull(), Geo_namespace::GeoBase::getWktString(), and geospatial::unpack_geo_vector().

230  {
231  if (!geo_ti.get_notnull() &&
232  (vals[0]->is_null || vals[1]->is_null || vals[2]->is_null)) {
233  // May need to generate "MULTIPOLYGON EMPTY" instead of NULL
234  return NullableString("NULL");
235  }
236  std::vector<int32_t> ring_sizes_vec;
237  unpack_geo_vector(ring_sizes_vec, vals[1]->pointer, vals[1]->length);
238  std::vector<int32_t> poly_rings_vec;
239  unpack_geo_vector(poly_rings_vec, vals[2]->pointer, vals[2]->length);
241  geo_ti, vals[0]->pointer, vals[0]->length),
242  ring_sizes_vec,
243  poly_rings_vec);
244  return NullableString(mpoly.getWktString());
245  }
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:264
void unpack_geo_vector(std::vector< T > &output, const int8_t *input_ptr, const size_t sz)
boost::variant< std::string, void * > NullableString
Definition: TargetValue.h:155
std::shared_ptr< std::vector< double > > decompress_coords< double, SQLTypeInfo >(const SQLTypeInfo &geo_ti, const int8_t *coords, const size_t coords_sz)
+ Here is the call graph for this function:

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