27 class OGRCoordinateTransformation;
29 namespace Geospatial {
39 : std::runtime_error(
"Geo" + type +
42 : std::runtime_error(
"Geo" + type +
" Error: " + err) {}
48 class GeoTypesFactory;
56 bool getWkb(std::vector<uint8_t>&)
const;
83 bool transform(int32_t srid0, int32_t srid1);
85 static std::shared_ptr<OGRCoordinateTransformation>
getTransformation(int32_t srid0,
94 std::unique_ptr<GeoBase>
run(
GeoOp op,
double param)
const;
97 virtual std::unique_ptr<GeoBase>
clone()
const = 0;
100 GeoBase(OGRGeometry* geom,
const bool owns_geom_obj)
113 GeoPoint(
const std::vector<double>& coords);
116 void getColumns(std::vector<double>& coords)
const;
119 std::unique_ptr<GeoBase>
clone()
const override;
122 GeoPoint(OGRGeometry* geom,
const bool owns_geom_obj) :
GeoBase(geom, owns_geom_obj) {}
132 void getColumns(std::vector<double>& coords, std::vector<double>& bounds)
const;
135 std::unique_ptr<GeoBase>
clone() const final;
139 :
GeoBase(geom, owns_geom_obj) {}
149 void getColumns(std::vector<double>& coords, std::vector<double>& bounds)
const;
152 std::unique_ptr<GeoBase>
clone() const final;
156 :
GeoBase(geom, owns_geom_obj) {}
164 const std::vector<int32_t>& linestring_sizes);
168 std::vector<int32_t>& linestring_sizes,
169 std::vector<double>& bounds)
const;
172 std::unique_ptr<GeoBase>
clone() const final;
176 :
GeoBase(geom, owns_geom_obj) {}
183 GeoPolygon(
const std::vector<double>& coords,
const std::vector<int32_t>& ring_sizes);
187 std::vector<int32_t>& ring_sizes,
188 std::vector<double>& bounds)
const;
193 std::unique_ptr<GeoBase>
clone() const final;
197 :
GeoBase(geom, owns_geom_obj) {}
205 const std::vector<int32_t>& ring_sizes,
206 const std::vector<int32_t>& poly_rings);
210 std::vector<int32_t>& ring_sizes,
211 std::vector<int32_t>& poly_rings,
212 std::vector<double>& bounds)
const;
215 std::unique_ptr<GeoBase>
clone() const final;
219 :
GeoBase(geom, owns_geom_obj) {}
238 const std::vector<int32_t>& ring_sizes,
239 const std::vector<int32_t>& poly_rings,
240 const std::vector<int32_t>& geo_kinds){};
244 std::vector<int32_t>& ring_sizes,
245 std::vector<int32_t>& poly_rings,
246 std::vector<int32_t>& geo_kinds,
247 std::vector<double>& bounds)
const {};
250 std::unique_ptr<GeoBase>
clone() const final;
254 :
GeoBase(geom, owns_geom_obj) {
256 throw GeoTypesError(
"GeoTypesFactory",
"Non-empty GEOMETRY");
266 const std::vector<int32_t>& ring_sizes,
267 const std::vector<int32_t>& poly_rings,
268 const std::vector<int32_t>& geo_kinds){};
272 std::vector<int32_t>& ring_sizes,
273 std::vector<int32_t>& poly_rings,
274 std::vector<int32_t>& geo_kinds,
275 std::vector<double>& bounds)
const {};
278 std::unique_ptr<GeoBase>
clone() const final;
282 :
GeoBase(geom, owns_geom_obj) {
284 throw GeoTypesError(
"GeoTypesFactory",
"Non-empty GEOMETRYCOLLECTION");
294 const bool validate_with_geos_if_available);
297 const std::string& wkt_or_wkb_hex,
298 const bool validate_with_geos_if_available);
301 const bool validate_with_geos_if_available);
304 const bool validate_with_geos_if_available);
308 std::vector<double>& coords,
309 std::vector<double>& bounds,
310 std::vector<int>& ring_sizes,
311 std::vector<int>& poly_rings,
312 const bool validate_with_geos_if_available);
316 std::vector<double>& coords,
317 std::vector<double>& bounds,
318 std::vector<int>& ring_sizes,
319 std::vector<int>& poly_rings,
320 const bool validate_with_geos_if_available);
324 std::vector<double>& coords,
325 std::vector<double>& bounds,
326 std::vector<int>& ring_sizes,
327 std::vector<int>& poly_rings,
328 const bool validate_with_geos_if_available);
330 static bool getGeoColumns(
const std::vector<std::string>* wkt_or_wkb_hex_column,
332 std::vector<std::vector<double>>& coords_column,
333 std::vector<std::vector<double>>& bounds_column,
334 std::vector<std::vector<int>>& ring_sizes_column,
335 std::vector<std::vector<int>>& poly_rings_column,
336 const bool validate_with_geos_if_available);
339 std::vector<double>& coords,
340 std::vector<double>& bounds,
341 std::vector<int>& ring_sizes,
342 std::vector<int>& poly_rings);
347 const bool owns_geom_obj =
true);
350 std::vector<double>& coords,
351 std::vector<double>& bounds,
352 std::vector<int>& ring_sizes,
353 std::vector<int>& poly_rings);
std::unique_ptr< GeoBase > clone() const final
GeoGeometry(const std::string &wkt)
std::unique_ptr< GeoBase > optimized_run(GeoOp op, const GeoBase &other) const
GeoTypesError(const std::string &type, const int ogr_err)
int32_t getNumInteriorRings() const
GeoMultiPolygon(const std::vector< double > &coords, const std::vector< int32_t > &ring_sizes, const std::vector< int32_t > &poly_rings)
const OGRGeometry * getOGRGeometry() const
GeoMultiPoint(const std::vector< double > &coords)
GeoGeometryCollection(const std::vector< double > &coords, const std::vector< int32_t > &ring_sizes, const std::vector< int32_t > &poly_rings, const std::vector< int32_t > &geo_kinds)
Constants for Builtin SQL Types supported by HEAVY.AI.
static void getNullGeoColumns(SQLTypeInfo &ti, std::vector< double > &coords, std::vector< double > &bounds, std::vector< int > &ring_sizes, std::vector< int > &poly_rings)
static std::unique_ptr< Geospatial::GeoBase > createGeoTypeImpl(OGRGeometry *geom, const bool owns_geom_obj=true)
bool getWkb(std::vector< uint8_t > &) const
void getColumns(std::vector< double > &coords) const
static std::shared_ptr< OGRCoordinateTransformation > getTransformation(int32_t srid0, int32_t srid1)
std::unique_ptr< GeoBase > clone() const final
GeoMultiLineString(const std::vector< double > &coords, const std::vector< int32_t > &linestring_sizes)
GeoTypesError(const std::string &type, const std::string &err)
std::unique_ptr< GeoBase > clone() const final
GeoType getType() const final
static int createFromWkbView(OGRGeometry **geom, WkbView const)
virtual std::unique_ptr< GeoBase > clone() const =0
static void getGeoColumnsImpl(const std::unique_ptr< GeoBase > &geospatial_base, SQLTypeInfo &ti, std::vector< double > &coords, std::vector< double > &bounds, std::vector< int > &ring_sizes, std::vector< int > &poly_rings)
void getColumns(std::vector< double > &coords, std::vector< double > &bounds) const
GeoType getType() const final
static bool getGeoColumns(const std::string &wkt_or_wkb_hex, SQLTypeInfo &ti, std::vector< double > &coords, std::vector< double > &bounds, std::vector< int > &ring_sizes, std::vector< int > &poly_rings, const bool validate_with_geos_if_available)
GeoType getType() const final
void getColumns(std::vector< double > &coords, std::vector< int32_t > &ring_sizes, std::vector< int32_t > &poly_rings, std::vector< int32_t > &geo_kinds, std::vector< double > &bounds) const
static std::string OGRErrorToStr(const int ogr_err)
GeoGeometry(const std::vector< double > &coords, const std::vector< int32_t > &ring_sizes, const std::vector< int32_t > &poly_rings, const std::vector< int32_t > &geo_kinds)
bool g_enable_smem_group_by true
void getColumns(std::vector< double > &coords, std::vector< int32_t > &ring_sizes, std::vector< int32_t > &poly_rings, std::vector< int32_t > &geo_kinds, std::vector< double > &bounds) const
void getColumns(std::vector< double > &coords, std::vector< int32_t > &ring_sizes, std::vector< int32_t > &poly_rings, std::vector< double > &bounds) const
std::unique_ptr< GeoBase > clone() const override
GeoPoint(OGRGeometry *geom, const bool owns_geom_obj)
void getColumns(std::vector< double > &coords, std::vector< double > &bounds) const
virtual bool operator==(const GeoBase &other) const
std::unique_ptr< GeoBase > clone() const final
static std::unique_ptr< GeoBase > createGeoType(const std::string &wkt_or_wkb_hex, const bool validate_with_geos_if_available)
std::unique_ptr< GeoBase > clone() const final
static int createFromWktString(const std::string &wkt, OGRGeometry **geom)
void getColumns(std::vector< double > &coords, std::vector< int32_t > &linestring_sizes, std::vector< double > &bounds) const
static OGRGeometry * createOGRGeometry(const std::string &wkt_or_wkb_hex, const bool validate_with_geos_if_available)
GeoType getType() const final
std::unique_ptr< GeoBase > clone() const final
bool transform(int32_t srid0, int32_t srid1)
GeoType getType() const final
std::string getWktString() const
GeoPoint(const std::vector< double > &coords)
GeoBase(OGRGeometry *geom, const bool owns_geom_obj)
std::unique_ptr< GeoBase > run(GeoOp op, const GeoBase &other) const
std::unique_ptr< GeoBase > clone() const final
void getColumns(std::vector< double > &coords, std::vector< int32_t > &ring_sizes, std::vector< double > &bounds) const
int32_t getBestPlanarSRID() const
GeoPolygon(const std::vector< double > &coords, const std::vector< int32_t > &ring_sizes)
GeoType getType() const final
GeoType getType() const final
virtual GeoType getType() const =0
GeoLineString(const std::vector< double > &coords)
GeoType getType() const final