wgtmac commented on code in PR #2269: URL: https://github.com/apache/orc/pull/2269#discussion_r2184132367
########## c++/include/orc/Geospatial.hh: ########## @@ -0,0 +1,198 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * This file contains code adapted from the Apache Arrow project. + * + * Original source: + * https://github.com/apache/arrow/blob/main/cpp/src/parquet/geospatial/statistics.h + * + * The original code is licensed under the Apache License, Version 2.0. + * + * Modifications may have been made from the original source. + */ + +#ifndef ORC_GEOSPATIAL_HH +#define ORC_GEOSPATIAL_HH + +#include <array> +#include <cmath> +#include <ostream> +#include <string> + +namespace orc { Review Comment: nit: we can use `namespace orc::geospatial {` ########## c++/include/orc/Type.hh: ########## @@ -25,6 +25,19 @@ namespace orc { + namespace geospatial { + enum EdgeInterpolationAlgorithm { + SPHERICAL = 0, + VINCENTY = 1, + THOMAS = 2, + ANDOYER = 3, + KARNEY = 4 + }; + using EIAlgo = EdgeInterpolationAlgorithm; Review Comment: I don't think this acronym is clear. Can we use its full name instead? ########## c++/src/Geospatial.cc: ########## @@ -0,0 +1,307 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * This file contains code adapted from the Apache Arrow project. + * + * Original source: + * https://github.com/apache/arrow/blob/main/cpp/src/parquet/geospatial/statistics.cc + * + * The original code is licensed under the Apache License, Version 2.0. + * + * Modifications may have been made from the original source. + */ + +#include "orc/Geospatial.hh" +#include "orc/Exceptions.hh" + +#include "Geospatial.hh" + +#include <algorithm> +#include <cstring> +#include <optional> +#include <sstream> + +namespace orc::geospatial { + + template <typename T> + inline std::enable_if_t<std::is_trivially_copyable_v<T>, T> SafeLoadAs(const uint8_t* unaligned) { Review Comment: Should we fix the function names in this file to have lowercased initials? ########## c++/src/Geospatial.cc: ########## @@ -0,0 +1,307 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * This file contains code adapted from the Apache Arrow project. + * + * Original source: + * https://github.com/apache/arrow/blob/main/cpp/src/parquet/geospatial/statistics.cc + * + * The original code is licensed under the Apache License, Version 2.0. + * + * Modifications may have been made from the original source. + */ + +#include "orc/Geospatial.hh" +#include "orc/Exceptions.hh" + +#include "Geospatial.hh" + +#include <algorithm> +#include <cstring> +#include <optional> +#include <sstream> + +namespace orc::geospatial { + + template <typename T> + inline std::enable_if_t<std::is_trivially_copyable_v<T>, T> SafeLoadAs(const uint8_t* unaligned) { + std::remove_const_t<T> ret; + std::memcpy(&ret, unaligned, sizeof(T)); + return ret; + } + + template <typename U, typename T> + inline std::enable_if_t<std::is_trivially_copyable_v<T> && std::is_trivially_copyable_v<U> && + sizeof(T) == sizeof(U), + U> + SafeCopy(T value) { + std::remove_const_t<U> ret; + std::memcpy(&ret, static_cast<const void*>(&value), sizeof(T)); + return ret; + } + + static bool isLittleEndian() { + static union { + uint32_t i; + char c[4]; + } num = {0x01020304}; + return num.c[0] == 4; + } + +#if defined(_MSC_VER) +#include <intrin.h> // IWYU pragma: keep +#define ORC_BYTE_SWAP64 _byteswap_uint64 +#define ORC_BYTE_SWAP32 _byteswap_ulong +#else +#define ORC_BYTE_SWAP64 __builtin_bswap64 +#define ORC_BYTE_SWAP32 __builtin_bswap32 +#endif + + // Swap the byte order (i.e. endianness) + static inline uint32_t ByteSwap(uint32_t value) { + return static_cast<uint32_t>(ORC_BYTE_SWAP32(value)); + } + static inline double ByteSwap(double value) { + const uint64_t swapped = ORC_BYTE_SWAP64(SafeCopy<uint64_t>(value)); + return SafeCopy<double>(swapped); + } + + std::string BoundingBox::toString() const { + std::stringstream ss; + ss << "BoundingBox{xMin=" << min[0] << ", xMax=" << max[0] << ", yMin=" << min[1] + << ", yMax=" << max[1] << ", zMin=" << min[2] << ", zMax=" << max[2] << ", mMin=" << min[3] + << ", mMax=" << max[3] << "}"; + return ss.str(); + } + + /// \brief Object to keep track of the low-level consumption of a well-known binary + /// geometry + /// + /// Briefly, ISO well-known binary supported by the Parquet spec is an endian byte + /// (0x01 or 0x00), followed by geometry type + dimensions encoded as a (uint32_t), + /// followed by geometry-specific data. Coordinate sequences are represented by a + /// uint32_t (the number of coordinates) plus a sequence of doubles (number of coordinates + /// multiplied by the number of dimensions). + class WKBBuffer { + public: + WKBBuffer() : data_(nullptr), size_(0) {} + WKBBuffer(const uint8_t* data, int64_t size) : data_(data), size_(size) {} + + uint8_t ReadUInt8() { + return ReadChecked<uint8_t>(); + } + + uint32_t ReadUInt32(bool swap) { + auto value = ReadChecked<uint32_t>(); + return swap ? ByteSwap(value) : value; + } + + template <typename Coord, typename Visit> + void ReadCoords(uint32_t nCoords, bool swap, Visit&& visit) { + size_t total_bytes = nCoords * sizeof(Coord); + if (size_ < total_bytes) { + } + + if (swap) { + Coord coord; + for (uint32_t i = 0; i < nCoords; i++) { + coord = ReadUnchecked<Coord>(); + for (auto& c : coord) { + c = ByteSwap(c); + } + + std::forward<Visit>(visit)(coord); + } + } else { + for (uint32_t i = 0; i < nCoords; i++) { + std::forward<Visit>(visit)(ReadUnchecked<Coord>()); + } + } + } + + size_t size() const { + return size_; + } + + private: + const uint8_t* data_; + size_t size_; + + template <typename T> + T ReadChecked() { + if (size_ < sizeof(T)) { + std::stringstream ss; + ss << "Can't read" << sizeof(T) << " bytes from WKBBuffer with " << size_ << " remaining"; + throw ParseError(ss.str()); + } + + return ReadUnchecked<T>(); + } + + template <typename T> + T ReadUnchecked() { + T out = SafeLoadAs<T>(data_); + data_ += sizeof(T); + size_ -= sizeof(T); + return out; + } + }; + + using GeometryTypeAndDimensions = std::pair<GeometryType, Dimensions>; + + namespace { + + std::optional<GeometryTypeAndDimensions> ParseGeometryType(uint32_t wkbGeometryType) { + // The number 1000 can be used because WKB geometry types are constructed + // on purpose such that this relationship is true (e.g., LINESTRING ZM maps + // to 3002). + uint32_t geometryTypeComponent = wkbGeometryType % 1000; + uint32_t dimensionsComponent = wkbGeometryType / 1000; + + auto minGeometryTypeValue = static_cast<uint32_t>(GeometryType::VALUE_MIN); + auto maxGeometryTypeValue = static_cast<uint32_t>(GeometryType::VALUE_MAX); + auto minDimensionValue = static_cast<uint32_t>(Dimensions::VALUE_MIN); + auto maxDimensionValue = static_cast<uint32_t>(Dimensions::VALUE_MAX); + + if (geometryTypeComponent < minGeometryTypeValue || + geometryTypeComponent > maxGeometryTypeValue || dimensionsComponent < minDimensionValue || + dimensionsComponent > maxDimensionValue) { + return std::nullopt; + } + + return std::make_optional( + GeometryTypeAndDimensions{static_cast<GeometryType>(geometryTypeComponent), + static_cast<Dimensions>(dimensionsComponent)}); + } + + } // namespace + + std::vector<int32_t> WKBGeometryBounder::geometryTypes() const { + std::vector<int32_t> out(geospatialTypes_.begin(), geospatialTypes_.end()); + std::sort(out.begin(), out.end()); + return out; + } + + void WKBGeometryBounder::mergeGeometry(std::string_view bytesWkb) { + if (!isValid_) { + return; + } + mergeGeometry(reinterpret_cast<const uint8_t*>(bytesWkb.data()), bytesWkb.size()); + } + + void WKBGeometryBounder::mergeGeometry(const uint8_t* bytesWkb, size_t bytesSize) { + if (!isValid_) { + return; + } + WKBBuffer src{bytesWkb, static_cast<int64_t>(bytesSize)}; + try { + mergeGeometryInternal(&src, /*record_wkb_type=*/true); + } catch (const ParseError&) { + invalidate(); + return; + } + if (src.size() != 0) { + // "Exepcted zero bytes after consuming WKB + invalidate(); + } + } + + void WKBGeometryBounder::mergeGeometryInternal(WKBBuffer* src, bool recordWkbType) { + uint8_t endian = src->ReadUInt8(); + bool swap = endian != 0x00; + if (isLittleEndian()) { Review Comment: Perhaps we can use `if constexpr (std::endian::native == std::endian::little)` ########## c++/src/ColumnWriter.cc: ########## @@ -2871,6 +2874,62 @@ namespace orc { } } + class GeospatialColumnWriter : public BinaryColumnWriter { + public: + GeospatialColumnWriter(const Type& type, const StreamsFactory& factory, + const WriterOptions& options) + : BinaryColumnWriter(type, factory, options), + isGeometry_(type.getKind() == TypeKind::GEOMETRY) {} + + virtual void add(ColumnVectorBatch& rowBatch, uint64_t offset, uint64_t numValues, + const char* incomingMask) override { + ColumnWriter::add(rowBatch, offset, numValues, incomingMask); + + const StringVectorBatch& strBatch = dynamic_cast<const StringVectorBatch&>(rowBatch); Review Comment: Should we provide a clear exception message if it fails? ########## c++/include/orc/Type.hh: ########## @@ -25,6 +25,19 @@ namespace orc { + namespace geospatial { + enum EdgeInterpolationAlgorithm { Review Comment: ```suggestion enum class EdgeInterpolationAlgorithm { ``` ########## c++/src/Geospatial.hh: ########## @@ -0,0 +1,86 @@ + +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ORC_GEOSPATIAL_IMPL_HH +#define ORC_GEOSPATIAL_IMPL_HH + +#include "orc/Geospatial.hh" + +#include <unordered_set> +#include <vector> + +namespace orc { + namespace geospatial { + class WKBBuffer; + + class WKBGeometryBounder { + public: + void mergeGeometry(std::string_view bytesWkb); + void mergeGeometry(const uint8_t* bytesWkb, size_t bytesSize); + + void mergeBox(const BoundingBox& box) { + box_.merge(box); + } + void mergeGeometryTypes(const std::vector<int>& geospatialTypes) { + geospatialTypes_.insert(geospatialTypes.begin(), geospatialTypes.end()); + } + void merge(const WKBGeometryBounder& other) { + if (!isValid() || !other.isValid()) { + invalidate(); + return; + } + box_.merge(other.box_); + geospatialTypes_.insert(other.geospatialTypes_.begin(), other.geospatialTypes_.end()); + } + + // Get the bounding box for the merged geometries. + const BoundingBox& bounds() const { + return box_; + } + + // Get the set of geometry types encountered during merging. + // Returns a sorted vector of geometry type IDs. + std::vector<int32_t> geometryTypes() const; + + void reset() { + isValid_ = true; + box_.reset(); + geospatialTypes_.clear(); + } + bool isValid() const { + return isValid_; + } + void invalidate() { + isValid_ = false; + box_.invalidate(); + geospatialTypes_.clear(); + } + + private: + BoundingBox box_; + std::unordered_set<int32_t> geospatialTypes_; + bool isValid_ = true; + + void mergeGeometryInternal(WKBBuffer* src, bool recordWkbType); + void mergeSequence(WKBBuffer* src, Dimensions dimensions, uint32_t nCoords, bool swap); + }; + } // namespace geospatial +} // namespace orc + +#endif Review Comment: Please add a blank line ########## c++/src/Geospatial.cc: ########## @@ -0,0 +1,307 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * This file contains code adapted from the Apache Arrow project. + * + * Original source: + * https://github.com/apache/arrow/blob/main/cpp/src/parquet/geospatial/statistics.cc + * + * The original code is licensed under the Apache License, Version 2.0. + * + * Modifications may have been made from the original source. + */ + +#include "orc/Geospatial.hh" +#include "orc/Exceptions.hh" + +#include "Geospatial.hh" + +#include <algorithm> +#include <cstring> +#include <optional> +#include <sstream> + +namespace orc::geospatial { + + template <typename T> + inline std::enable_if_t<std::is_trivially_copyable_v<T>, T> SafeLoadAs(const uint8_t* unaligned) { + std::remove_const_t<T> ret; + std::memcpy(&ret, unaligned, sizeof(T)); + return ret; + } + + template <typename U, typename T> + inline std::enable_if_t<std::is_trivially_copyable_v<T> && std::is_trivially_copyable_v<U> && + sizeof(T) == sizeof(U), + U> + SafeCopy(T value) { + std::remove_const_t<U> ret; + std::memcpy(&ret, static_cast<const void*>(&value), sizeof(T)); + return ret; + } + + static bool isLittleEndian() { + static union { + uint32_t i; + char c[4]; + } num = {0x01020304}; + return num.c[0] == 4; + } + +#if defined(_MSC_VER) +#include <intrin.h> // IWYU pragma: keep +#define ORC_BYTE_SWAP64 _byteswap_uint64 +#define ORC_BYTE_SWAP32 _byteswap_ulong +#else +#define ORC_BYTE_SWAP64 __builtin_bswap64 +#define ORC_BYTE_SWAP32 __builtin_bswap32 +#endif + + // Swap the byte order (i.e. endianness) + static inline uint32_t ByteSwap(uint32_t value) { + return static_cast<uint32_t>(ORC_BYTE_SWAP32(value)); + } + static inline double ByteSwap(double value) { + const uint64_t swapped = ORC_BYTE_SWAP64(SafeCopy<uint64_t>(value)); + return SafeCopy<double>(swapped); + } + + std::string BoundingBox::toString() const { + std::stringstream ss; + ss << "BoundingBox{xMin=" << min[0] << ", xMax=" << max[0] << ", yMin=" << min[1] + << ", yMax=" << max[1] << ", zMin=" << min[2] << ", zMax=" << max[2] << ", mMin=" << min[3] + << ", mMax=" << max[3] << "}"; + return ss.str(); + } + + /// \brief Object to keep track of the low-level consumption of a well-known binary + /// geometry + /// + /// Briefly, ISO well-known binary supported by the Parquet spec is an endian byte + /// (0x01 or 0x00), followed by geometry type + dimensions encoded as a (uint32_t), + /// followed by geometry-specific data. Coordinate sequences are represented by a + /// uint32_t (the number of coordinates) plus a sequence of doubles (number of coordinates + /// multiplied by the number of dimensions). + class WKBBuffer { + public: + WKBBuffer() : data_(nullptr), size_(0) {} + WKBBuffer(const uint8_t* data, int64_t size) : data_(data), size_(size) {} + + uint8_t ReadUInt8() { + return ReadChecked<uint8_t>(); + } + + uint32_t ReadUInt32(bool swap) { + auto value = ReadChecked<uint32_t>(); + return swap ? ByteSwap(value) : value; + } + + template <typename Coord, typename Visit> + void ReadCoords(uint32_t nCoords, bool swap, Visit&& visit) { + size_t total_bytes = nCoords * sizeof(Coord); + if (size_ < total_bytes) { + } + + if (swap) { + Coord coord; + for (uint32_t i = 0; i < nCoords; i++) { + coord = ReadUnchecked<Coord>(); + for (auto& c : coord) { + c = ByteSwap(c); + } + + std::forward<Visit>(visit)(coord); + } + } else { + for (uint32_t i = 0; i < nCoords; i++) { + std::forward<Visit>(visit)(ReadUnchecked<Coord>()); + } + } + } + + size_t size() const { + return size_; + } + + private: + const uint8_t* data_; + size_t size_; + + template <typename T> + T ReadChecked() { + if (size_ < sizeof(T)) { + std::stringstream ss; + ss << "Can't read" << sizeof(T) << " bytes from WKBBuffer with " << size_ << " remaining"; + throw ParseError(ss.str()); + } + + return ReadUnchecked<T>(); + } + + template <typename T> + T ReadUnchecked() { + T out = SafeLoadAs<T>(data_); + data_ += sizeof(T); + size_ -= sizeof(T); + return out; + } + }; + + using GeometryTypeAndDimensions = std::pair<GeometryType, Dimensions>; + + namespace { + + std::optional<GeometryTypeAndDimensions> ParseGeometryType(uint32_t wkbGeometryType) { + // The number 1000 can be used because WKB geometry types are constructed + // on purpose such that this relationship is true (e.g., LINESTRING ZM maps + // to 3002). + uint32_t geometryTypeComponent = wkbGeometryType % 1000; + uint32_t dimensionsComponent = wkbGeometryType / 1000; + + auto minGeometryTypeValue = static_cast<uint32_t>(GeometryType::VALUE_MIN); + auto maxGeometryTypeValue = static_cast<uint32_t>(GeometryType::VALUE_MAX); + auto minDimensionValue = static_cast<uint32_t>(Dimensions::VALUE_MIN); + auto maxDimensionValue = static_cast<uint32_t>(Dimensions::VALUE_MAX); + + if (geometryTypeComponent < minGeometryTypeValue || + geometryTypeComponent > maxGeometryTypeValue || dimensionsComponent < minDimensionValue || + dimensionsComponent > maxDimensionValue) { + return std::nullopt; + } + + return std::make_optional( + GeometryTypeAndDimensions{static_cast<GeometryType>(geometryTypeComponent), + static_cast<Dimensions>(dimensionsComponent)}); + } + + } // namespace + + std::vector<int32_t> WKBGeometryBounder::geometryTypes() const { + std::vector<int32_t> out(geospatialTypes_.begin(), geospatialTypes_.end()); + std::sort(out.begin(), out.end()); + return out; + } + + void WKBGeometryBounder::mergeGeometry(std::string_view bytesWkb) { + if (!isValid_) { + return; + } + mergeGeometry(reinterpret_cast<const uint8_t*>(bytesWkb.data()), bytesWkb.size()); + } + + void WKBGeometryBounder::mergeGeometry(const uint8_t* bytesWkb, size_t bytesSize) { + if (!isValid_) { + return; + } + WKBBuffer src{bytesWkb, static_cast<int64_t>(bytesSize)}; + try { + mergeGeometryInternal(&src, /*record_wkb_type=*/true); + } catch (const ParseError&) { + invalidate(); + return; + } + if (src.size() != 0) { + // "Exepcted zero bytes after consuming WKB + invalidate(); + } + } + + void WKBGeometryBounder::mergeGeometryInternal(WKBBuffer* src, bool recordWkbType) { + uint8_t endian = src->ReadUInt8(); + bool swap = endian != 0x00; + if (isLittleEndian()) { + swap = endian != 0x01; + } + + uint32_t wkbGeometryType = src->ReadUInt32(swap); + auto geometryTypeAndDimensions = ParseGeometryType(wkbGeometryType); + if (!geometryTypeAndDimensions.has_value()) { + invalidate(); + return; + } + auto& [geometry_type, dimensions] = geometryTypeAndDimensions.value(); + + // Keep track of geometry types encountered if at the top level + if (recordWkbType) { + geospatialTypes_.insert(static_cast<int32_t>(wkbGeometryType)); + } + + switch (geometry_type) { + case GeometryType::POINT: + mergeSequence(src, dimensions, 1, swap); + break; + + case GeometryType::LINESTRING: { + uint32_t nCoords = src->ReadUInt32(swap); + mergeSequence(src, dimensions, nCoords, swap); + break; + } + case GeometryType::POLYGON: { + uint32_t n_parts = src->ReadUInt32(swap); + for (uint32_t i = 0; i < n_parts; i++) { + uint32_t nCoords = src->ReadUInt32(swap); + mergeSequence(src, dimensions, nCoords, swap); + } + break; + } + + // These are all encoded the same in WKB, even though this encoding would + // allow for parts to be of a different geometry type or different dimensions. + // For the purposes of bounding, this does not cause us problems. We pass + // record_wkb_type = false because we do not want the child geometry to be + // added to the geometry_types list (e.g., for a MultiPoint, we only want + // the code for MultiPoint to be added, not the code for Point). + case GeometryType::MULTIPOINT: + case GeometryType::MULTILINESTRING: + case GeometryType::MULTIPOLYGON: + case GeometryType::GEOMETRYCOLLECTION: { + uint32_t n_parts = src->ReadUInt32(swap); + for (uint32_t i = 0; i < n_parts; i++) { + mergeGeometryInternal(src, /*record_wkb_type*/ false); + } + break; + } + } + } + + void WKBGeometryBounder::mergeSequence(WKBBuffer* src, Dimensions dimensions, uint32_t nCoords, + bool swap) { + switch (dimensions) { + case Dimensions::XY: + src->ReadCoords<BoundingBox::XY>(nCoords, swap, + [&](BoundingBox::XY coord) { box_.updateXY(coord); }); + break; + case Dimensions::XYZ: + src->ReadCoords<BoundingBox::XYZ>(nCoords, swap, + [&](BoundingBox::XYZ coord) { box_.updateXYZ(coord); }); + break; + case Dimensions::XYM: + src->ReadCoords<BoundingBox::XYM>(nCoords, swap, + [&](BoundingBox::XYM coord) { box_.updateXYM(coord); }); + break; + case Dimensions::XYZM: + src->ReadCoords<BoundingBox::XYZM>( + nCoords, swap, [&](BoundingBox::XYZM coord) { box_.updateXYZM(coord); }); + break; + default: + invalidate(); + } + } + +} // namespace orc::geospatial Review Comment: Please add a blank line ########## c++/include/orc/Type.hh: ########## @@ -59,6 +74,8 @@ namespace orc { virtual uint64_t getMaximumLength() const = 0; virtual uint64_t getPrecision() const = 0; virtual uint64_t getScale() const = 0; + virtual const std::string& getCRS() const = 0; + virtual geospatial::EIAlgo getEIAlgo() const = 0; Review Comment: ```suggestion virtual const std::string& getCrs() const = 0; virtual geospatial::EdgeInterpolationAlgorithm getAlgorithm() const = 0; ``` It would be good to add comment to say these two functions are for geometry & geography types only. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
