OmniSciDB  21ac014ffc
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Geospatial Namespace Reference

Namespaces

 anonymous_namespace{GDAL.cpp}
 
 anonymous_namespace{Types.cpp}
 

Classes

class  GDAL
 
class  GeoTypesError
 
class  GeoBase
 
class  GeoPoint
 
class  GeoLineString
 
class  GeoPolygon
 
class  GeoMultiPolygon
 
class  GeoGeometry
 
class  GeoGeometryCollection
 
class  GeoTypesFactory
 

Functions

int32_t get_compression_scheme (const SQLTypeInfo &ti)
 
uint64_t compress_coord (double coord, const SQLTypeInfo &ti, bool x)
 
uint64_t compress_null_point (const SQLTypeInfo &ti, bool x)
 
std::vector< uint8_t > compress_coords (const std::vector< double > &coords, const SQLTypeInfo &ti)
 
template<typename T >
void unpack_geo_vector (std::vector< T > &output, const int8_t *input_ptr, const size_t sz)
 
template<>
void unpack_geo_vector< int32_t > (std::vector< int32_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<>
std::shared_ptr< std::vector
< double > > 
decompress_coords< double, SQLTypeInfo > (const SQLTypeInfo &geo_ti, const int8_t *coords, const size_t coords_sz)
 
template<>
std::shared_ptr< std::vector
< double > > 
decompress_coords< double, int32_t > (const int32_t &ic, 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)
 
template<typename T , typename C >
std::shared_ptr< std::vector< T > > decompress_coords (const C &compression, const int8_t *coords, const size_t coords_sz)
 
DEVICE double decompress_longitude_coord_geoint32 (const int32_t compressed)
 
DEVICE double decompress_lattitude_coord_geoint32 (const int32_t compressed)
 
DEVICE bool is_null_point_longitude_geoint32 (const int32_t compressed)
 
DEVICE bool is_null_point_lattitude_geoint32 (const int32_t compressed)
 
DEVICE uint64_t compress_longitude_coord_geoint32 (const double coord)
 
DEVICE uint64_t compress_lattitude_coord_geoint32 (const double coord)
 
DEVICE constexpr uint64_t compress_null_point_longitude_geoint32 ()
 
DEVICE constexpr uint64_t compress_null_point_lattitude_geoint32 ()
 
std::shared_ptr
< Analyzer::Constant
convert_coords (const std::vector< double > &coords, const SQLTypeInfo &ti)
 
std::shared_ptr
< Analyzer::Constant
convert_rings (const std::vector< int > &rings)
 

Variables

std::mutex transformation_map_mutex_
 
std::map< std::tuple< int32_t,
int32_t >, std::shared_ptr
< OGRCoordinateTransformation > > 
transformation_map_
 

Function Documentation

uint64_t Geospatial::compress_coord ( double  coord,
const SQLTypeInfo ti,
bool  x 
)

Definition at line 33 of file Compression.cpp.

References compress_lattitude_coord_geoint32(), compress_longitude_coord_geoint32(), SQLTypeInfo::get_comp_param(), SQLTypeInfo::get_compression(), and kENCODING_GEOINT.

Referenced by compress_coords().

33  {
34  if (ti.get_compression() == kENCODING_GEOINT && ti.get_comp_param() == 32) {
36  : Geospatial::compress_lattitude_coord_geoint32(coord);
37  }
38  return *reinterpret_cast<uint64_t*>(may_alias_ptr(&coord));
39 }
DEVICE uint64_t compress_longitude_coord_geoint32(const double coord)
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:331
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:332
DEVICE uint64_t compress_lattitude_coord_geoint32(const double coord)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::vector< uint8_t > Geospatial::compress_coords ( const std::vector< double > &  coords,
const SQLTypeInfo ti 
)

Definition at line 52 of file Compression.cpp.

References CHECK, compress_coord(), compress_null_point(), SQLTypeInfo::get_comp_param(), SQLTypeInfo::get_compression(), SQLTypeInfo::get_notnull(), SQLTypeInfo::get_output_srid(), SQLTypeInfo::get_type(), i, is_null_point(), kENCODING_GEOINT, kPOINT, NULL_ARRAY_DOUBLE, and to_string().

Referenced by Parser::InsertValuesStmt::analyze(), import_export::ImporterUtils::composeNullPointCoords(), convert_coords(), import_export::import_thread_shapefile(), foreign_storage::GeospatialEncoder::processGeoElement(), foreign_storage::GeospatialEncoder::processNullGeoElement(), import_export::Importer::set_geo_physical_import_buffer(), import_export::Importer::set_geo_physical_import_buffer_columnar(), GeoPointValueConverter::toCompressedCoords(), and RelAlgTranslator::translateGeoLiteral().

53  {
54  CHECK(!coords.empty()) << "Coord compression received no data";
55  bool is_null_point = false;
56  if (!ti.get_notnull()) {
57  is_null_point = (ti.get_type() == kPOINT && coords[0] == NULL_ARRAY_DOUBLE);
58  }
59 
60  bool x = true;
61  bool is_geoint32 =
62  (ti.get_compression() == kENCODING_GEOINT && ti.get_comp_param() == 32);
63  size_t coord_data_size = (is_geoint32) ? (ti.get_comp_param() / 8) : sizeof(double);
64  std::vector<uint8_t> compressed_coords;
65  compressed_coords.reserve(coords.size() * coord_data_size);
66  for (auto coord : coords) {
67  uint64_t coord_data;
68  if (is_null_point) {
69  coord_data = compress_null_point(ti, x);
70  } else {
71  if (ti.get_output_srid() == 4326) {
72  if (x) {
73  if (coord < -180.0 || coord > 180.0) {
74  throw std::runtime_error("WGS84 longitude " + std::to_string(coord) +
75  " is out of bounds");
76  }
77  } else {
78  if (coord < -90.0 || coord > 90.0) {
79  throw std::runtime_error("WGS84 latitude " + std::to_string(coord) +
80  " is out of bounds");
81  }
82  }
83  }
84  if (is_geoint32) {
85  coord_data = compress_coord(coord, ti, x);
86  } else {
87  auto coord_data_ptr = reinterpret_cast<uint64_t*>(&coord);
88  coord_data = *coord_data_ptr;
89  }
90  }
91  for (size_t i = 0; i < coord_data_size; i++) {
92  compressed_coords.push_back(coord_data & 0xFF);
93  coord_data >>= 8;
94  }
95  x = !x;
96  }
97  return compressed_coords;
98 }
bool is_null_point(const SQLTypeInfo &geo_ti, const int8_t *coords, const size_t coords_sz)
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:323
std::string to_string(char const *&&v)
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:331
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:332
#define NULL_ARRAY_DOUBLE
#define CHECK(condition)
Definition: Logger.h:206
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:330
HOST DEVICE int get_output_srid() const
Definition: sqltypes.h:329
uint64_t compress_coord(double coord, const SQLTypeInfo &ti, bool x)
Definition: Compression.cpp:33
uint64_t compress_null_point(const SQLTypeInfo &ti, bool x)
Definition: Compression.cpp:41

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DEVICE uint64_t Geospatial::compress_lattitude_coord_geoint32 ( const double  coord)
inline

Definition at line 69 of file CompressionRuntime.h.

References compressed_coord().

Referenced by compress_coord().

69  {
70  // compress latitude: -90..90 ---> -2,147,483,647..2,147,483,647
71  int32_t compressed_coord = static_cast<int32_t>(coord * (2147483647.0 / 90.0));
72  return static_cast<uint64_t>(*reinterpret_cast<uint32_t*>(&compressed_coord));
73 }
DEVICE ALWAYS_INLINE int32_t compressed_coord(const int8_t *data, const int32_t index)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DEVICE uint64_t Geospatial::compress_longitude_coord_geoint32 ( const double  coord)
inline

Definition at line 63 of file CompressionRuntime.h.

References compressed_coord().

Referenced by compress_coord().

63  {
64  // compress longitude: -180..180 ---> -2,147,483,647..2,147,483,647
65  int32_t compressed_coord = static_cast<int32_t>(coord * (2147483647.0 / 180.0));
66  return static_cast<uint64_t>(*reinterpret_cast<uint32_t*>(&compressed_coord));
67 }
DEVICE ALWAYS_INLINE int32_t compressed_coord(const int8_t *data, const int32_t index)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint64_t Geospatial::compress_null_point ( const SQLTypeInfo ti,
bool  x 
)

Definition at line 41 of file Compression.cpp.

References compress_null_point_lattitude_geoint32(), compress_null_point_longitude_geoint32(), SQLTypeInfo::get_comp_param(), SQLTypeInfo::get_compression(), kENCODING_GEOINT, NULL_ARRAY_DOUBLE, and NULL_DOUBLE.

Referenced by compress_coords().

41  {
42  if (ti.get_compression() == kENCODING_GEOINT && ti.get_comp_param() == 32) {
45  }
46  double n = x ? NULL_ARRAY_DOUBLE : NULL_DOUBLE;
47  auto u = *reinterpret_cast<uint64_t*>(may_alias_ptr(&n));
48  return u;
49 }
#define NULL_DOUBLE
DEVICE constexpr uint64_t compress_null_point_lattitude_geoint32()
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:331
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:332
#define NULL_ARRAY_DOUBLE
DEVICE constexpr uint64_t compress_null_point_longitude_geoint32()

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DEVICE constexpr uint64_t Geospatial::compress_null_point_lattitude_geoint32 ( )

Definition at line 80 of file CompressionRuntime.h.

Referenced by compress_null_point().

80  {
81  // compress null point latitude: NULL ---> -2,147,483,648
82  return 0x0000000080000000ULL;
83 }

+ Here is the caller graph for this function:

DEVICE constexpr uint64_t Geospatial::compress_null_point_longitude_geoint32 ( )

Definition at line 75 of file CompressionRuntime.h.

Referenced by compress_null_point().

75  {
76  // compress null point longitude: NULL ---> -2,147,483,648
77  return 0x0000000080000000ULL;
78 }

+ Here is the caller graph for this function:

std::shared_ptr<Analyzer::Constant> Geospatial::convert_coords ( const std::vector< double > &  coords,
const SQLTypeInfo ti 
)

Definition at line 26 of file Conversion.h.

References compress_coords(), test_fsi::d, SQLTypeInfo::get_compression(), kARRAY, kENCODING_GEOINT, kTINYINT, SQLTypeInfo::set_comp_param(), SQLTypeInfo::set_compression(), SQLTypeInfo::set_size(), SQLTypeInfo::set_subtype(), and Datum::tinyintval.

Referenced by Analyzer::GeoConstant::makePhysicalConstant().

27  {
28  std::vector<uint8_t> compressed_coords = Geospatial::compress_coords(coords, ti);
29  std::list<std::shared_ptr<Analyzer::Expr>> compressed_coords_exprs;
30  for (auto cc : compressed_coords) {
31  Datum d;
32  d.tinyintval = cc;
33  auto e = makeExpr<Analyzer::Constant>(kTINYINT, false, d);
34  compressed_coords_exprs.push_back(e);
35  }
36  SQLTypeInfo arr_ti = SQLTypeInfo(kARRAY, true);
37  arr_ti.set_subtype(kTINYINT);
38  arr_ti.set_size(compressed_coords.size() * sizeof(int8_t));
39  arr_ti.set_compression(ti.get_compression());
40  arr_ti.set_comp_param((ti.get_compression() == kENCODING_GEOINT) ? 32 : 64);
41  return makeExpr<Analyzer::Constant>(arr_ti, false, compressed_coords_exprs);
42 }
int8_t tinyintval
Definition: sqltypes.h:206
void set_compression(EncodingType c)
Definition: sqltypes.h:423
void set_size(int s)
Definition: sqltypes.h:421
tuple d
Definition: test_fsi.py:9
HOST DEVICE void set_subtype(SQLTypes st)
Definition: sqltypes.h:414
std::vector< uint8_t > compress_coords(const std::vector< double > &coords, const SQLTypeInfo &ti)
Definition: Compression.cpp:52
void set_comp_param(int p)
Definition: sqltypes.h:424
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:331

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::shared_ptr<Analyzer::Constant> Geospatial::convert_rings ( const std::vector< int > &  rings)

Definition at line 44 of file Conversion.h.

References test_fsi::d, Datum::intval, kARRAY, kINT, SQLTypeInfo::set_size(), and SQLTypeInfo::set_subtype().

Referenced by Analyzer::GeoConstant::makePhysicalConstant().

44  {
45  std::list<std::shared_ptr<Analyzer::Expr>> ring_size_exprs;
46  for (auto c : rings) {
47  Datum d;
48  d.intval = c;
49  auto e = makeExpr<Analyzer::Constant>(kINT, false, d);
50  ring_size_exprs.push_back(e);
51  }
52  SQLTypeInfo arr_ti = SQLTypeInfo(kARRAY, true);
53  arr_ti.set_subtype(kINT);
54  arr_ti.set_size(rings.size() * sizeof(int32_t));
55  return makeExpr<Analyzer::Constant>(arr_ti, false, ring_size_exprs);
56 }
void set_size(int s)
Definition: sqltypes.h:421
tuple d
Definition: test_fsi.py:9
HOST DEVICE void set_subtype(SQLTypes st)
Definition: sqltypes.h:414
int32_t intval
Definition: sqltypes.h:208
Definition: sqltypes.h:44

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T , typename C >
std::shared_ptr<std::vector<T> > Geospatial::decompress_coords ( const C &  compression,
const int8_t *  coords,
const size_t  coords_sz 
)
template<>
std::shared_ptr<std::vector<double> > Geospatial::decompress_coords< double, int32_t > ( const int32_t &  ic,
const int8_t *  coords,
const size_t  coords_sz 
)

Definition at line 165 of file Compression.cpp.

References CHECK_EQ, COMPRESSION_GEOINT32, COMPRESSION_NONE, decompress_geo_coords_geoint32(), and unpack_geo_vector().

168  {
169  auto decompressed_coords_ptr = std::make_shared<std::vector<double>>();
170  if (ic == COMPRESSION_GEOINT32) {
171  decompress_geo_coords_geoint32(*decompressed_coords_ptr, coords, coords_sz);
172  } else {
174  unpack_geo_vector(*decompressed_coords_ptr, coords, coords_sz);
175  }
176  return decompressed_coords_ptr;
177 }
#define CHECK_EQ(x, y)
Definition: Logger.h:214
#define COMPRESSION_NONE
void decompress_geo_coords_geoint32(std::vector< T > &dec, const int8_t *enc, const size_t sz)
#define COMPRESSION_GEOINT32
void unpack_geo_vector(std::vector< T > &output, const int8_t *input_ptr, const size_t sz)

+ Here is the call graph for this function:

template<>
std::shared_ptr<std::vector<double> > Geospatial::decompress_coords< double, SQLTypeInfo > ( const SQLTypeInfo geo_ti,
const int8_t *  coords,
const size_t  coords_sz 
)

Definition at line 148 of file Compression.cpp.

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().

151  {
152  auto decompressed_coords_ptr = std::make_shared<std::vector<double>>();
153  if (geo_ti.get_compression() == kENCODING_GEOINT) {
154  if (geo_ti.get_comp_param() == 32) {
155  decompress_geo_coords_geoint32(*decompressed_coords_ptr, coords, coords_sz);
156  }
157  } else {
159  unpack_geo_vector(*decompressed_coords_ptr, coords, coords_sz);
160  }
161  return decompressed_coords_ptr;
162 }
#define CHECK_EQ(x, y)
Definition: Logger.h:214
void decompress_geo_coords_geoint32(std::vector< T > &dec, const int8_t *enc, const size_t sz)
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:331
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:332
void unpack_geo_vector(std::vector< T > &output, const int8_t *input_ptr, const size_t sz)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void Geospatial::decompress_geo_coords_geoint32 ( std::vector< T > &  dec,
const int8_t *  enc,
const size_t  sz 
)

Definition at line 131 of file Compression.cpp.

References decompress_lattitude_coord_geoint32(), decompress_longitude_coord_geoint32(), and i.

Referenced by decompress_coords< double, int32_t >(), and decompress_coords< double, SQLTypeInfo >().

133  {
134  if (sz == 0) {
135  return;
136  }
137  const auto compressed_coords = reinterpret_cast<const int32_t*>(enc);
138  const auto num_coords = sz / sizeof(int32_t);
139  dec.resize(num_coords);
140  for (size_t i = 0; i < num_coords; i += 2) {
141  dec[i] = Geospatial::decompress_longitude_coord_geoint32(compressed_coords[i]);
142  dec[i + 1] =
143  Geospatial::decompress_lattitude_coord_geoint32(compressed_coords[i + 1]);
144  }
145 }
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:

DEVICE double Geospatial::decompress_lattitude_coord_geoint32 ( const int32_t  compressed)
inline

Definition at line 47 of file CompressionRuntime.h.

Referenced by decompress_coord(), decompress_geo_coords_geoint32(), and get_bucket_key_for_range_compressed_impl().

47  {
48  // decompress latitude: -2,147,483,647..2,147,483,647 ---> -90..90
49  return static_cast<double>(compressed) *
50  4.1909515877212172e-08; // // (90.0 / 2147483647.0)
51 }

+ Here is the caller graph for this function:

DEVICE double Geospatial::decompress_longitude_coord_geoint32 ( const int32_t  compressed)
inline

Definition at line 41 of file CompressionRuntime.h.

Referenced by decompress_coord(), decompress_geo_coords_geoint32(), and get_bucket_key_for_range_compressed_impl().

41  {
42  // decompress longitude: -2,147,483,647..2,147,483,647 ---> -180..180
43  return static_cast<double>(compressed) *
44  8.3819031754424345e-08; // (180.0 / 2147483647.0)
45 }

+ Here is the caller graph for this function:

int32_t Geospatial::get_compression_scheme ( const SQLTypeInfo ti)

Definition at line 23 of file Compression.cpp.

References COMPRESSION_GEOINT32, COMPRESSION_NONE, SQLTypeInfo::get_comp_param(), SQLTypeInfo::get_compression(), kENCODING_GEOINT, and kENCODING_NONE.

Referenced by CodeGenerator::codegenGeoBinOper(), CodeGenerator::codegenGeoFunctionOperator(), CodeGenerator::codegenGeoUOper(), RelAlgTranslator::translateBinaryGeoFunction(), RelAlgTranslator::translateFunctionWithGeoArg(), RelAlgTranslator::translateTernaryGeoFunction(), and RelAlgTranslator::translateUnaryGeoFunction().

23  {
24  if (ti.get_compression() == kENCODING_GEOINT && ti.get_comp_param() == 32) {
25  return COMPRESSION_GEOINT32;
26  }
27  if (ti.get_compression() != kENCODING_NONE) {
28  throw std::runtime_error("Invalid compression");
29  }
30  return COMPRESSION_NONE;
31 }
#define COMPRESSION_NONE
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:331
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:332
#define COMPRESSION_GEOINT32

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Geospatial::is_null_point ( const SQLTypeInfo geo_ti,
const int8_t *  coords,
const size_t  coords_sz 
)

Definition at line 179 of file Compression.cpp.

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

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

181  {
182  if (geo_ti.get_type() == kPOINT && !geo_ti.get_notnull()) {
183  if (geo_ti.get_compression() == kENCODING_GEOINT) {
184  if (geo_ti.get_comp_param() == 32) {
185  return Geospatial::is_null_point_longitude_geoint32(*((int32_t*)coords));
186  }
187  } else {
189  return *((double*)coords) == NULL_ARRAY_DOUBLE;
190  }
191  }
192  return false;
193 }
#define CHECK_EQ(x, y)
Definition: Logger.h:214
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:323
DEVICE bool is_null_point_longitude_geoint32(const int32_t compressed)
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:331
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:332
#define NULL_ARRAY_DOUBLE
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:330

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DEVICE bool Geospatial::is_null_point_lattitude_geoint32 ( const int32_t  compressed)
inline

Definition at line 58 of file CompressionRuntime.h.

58  {
59  // check compressed null point latitude: -2,147,483,648 ---> NULL
60  return (*reinterpret_cast<const uint32_t*>(&compressed) == 0x80000000U);
61 }
DEVICE bool Geospatial::is_null_point_longitude_geoint32 ( const int32_t  compressed)
inline

Definition at line 53 of file CompressionRuntime.h.

Referenced by is_null_point().

53  {
54  // check compressed null point longitude: -2,147,483,648 ---> NULL
55  return (*reinterpret_cast<const uint32_t*>(&compressed) == 0x80000000U);
56 }

+ Here is the caller graph for this function:

template<typename T >
void Geospatial::unpack_geo_vector ( std::vector< T > &  output,
const int8_t *  input_ptr,
const size_t  sz 
)

Definition at line 101 of file Compression.cpp.

References CHECK_EQ, i, and omnisci.dtypes::T.

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

101  {
102  if (sz == 0) {
103  return;
104  }
105  auto elems = reinterpret_cast<const T*>(input_ptr);
106  CHECK_EQ(size_t(0), sz % sizeof(T));
107  const size_t num_elems = sz / sizeof(T);
108  output.resize(num_elems);
109  for (size_t i = 0; i < num_elems; i++) {
110  output[i] = elems[i];
111  }
112 }
#define CHECK_EQ(x, y)
Definition: Logger.h:214

+ Here is the caller graph for this function:

template<>
void Geospatial::unpack_geo_vector< int32_t > ( std::vector< int32_t > &  output,
const int8_t *  input_ptr,
const size_t  sz 
)

Definition at line 115 of file Compression.cpp.

References CHECK_EQ, and i.

117  {
118  if (sz == 0) {
119  return;
120  }
121  auto elems = reinterpret_cast<const int32_t*>(input_ptr);
122  CHECK_EQ(size_t(0), sz % sizeof(int32_t));
123  const size_t num_elems = sz / sizeof(int32_t);
124  output.resize(num_elems);
125  for (size_t i = 0; i < num_elems; i++) {
126  output[i] = elems[i];
127  }
128 }
#define CHECK_EQ(x, y)
Definition: Logger.h:214

Variable Documentation

std::map<std::tuple<int32_t, int32_t>, std::shared_ptr<OGRCoordinateTransformation> > Geospatial::transformation_map_

Definition at line 116 of file Types.cpp.

Referenced by Geospatial::GeoBase::getTransformation().

std::mutex Geospatial::transformation_map_mutex_

Definition at line 114 of file Types.cpp.

Referenced by Geospatial::GeoBase::getTransformation().