wgtmac commented on code in PR #752:
URL: https://github.com/apache/iceberg-cpp/pull/752#discussion_r3432559815


##########
src/iceberg/type.h:
##########
@@ -518,11 +542,59 @@ class ICEBERG_EXPORT UnknownType : public PrimitiveType {
   bool Equals(const Type& other) const override;
 };
 
+/// \brief A data type representing OGC geometry in WKB format.
+class ICEBERG_EXPORT GeometryType : public PrimitiveType {
+ public:
+  constexpr static const TypeId kTypeId = TypeId::kGeometry;
+  constexpr static std::string_view kDefaultCrs = "OGC:CRS84";
+
+  GeometryType() = default;
+  explicit GeometryType(std::string crs);
+  ~GeometryType() override = default;
+
+  [[nodiscard]] std::string_view crs() const;

Review Comment:
   ```suggestion
     std::string_view crs() const;
   ```



##########
src/iceberg/type.h:
##########
@@ -518,11 +542,59 @@ class ICEBERG_EXPORT UnknownType : public PrimitiveType {
   bool Equals(const Type& other) const override;
 };
 
+/// \brief A data type representing OGC geometry in WKB format.
+class ICEBERG_EXPORT GeometryType : public PrimitiveType {
+ public:
+  constexpr static const TypeId kTypeId = TypeId::kGeometry;
+  constexpr static std::string_view kDefaultCrs = "OGC:CRS84";
+
+  GeometryType() = default;
+  explicit GeometryType(std::string crs);
+  ~GeometryType() override = default;
+
+  [[nodiscard]] std::string_view crs() const;
+
+  TypeId type_id() const override;
+  std::string ToString() const override;
+
+ protected:
+  bool Equals(const Type& other) const override;
+
+ private:
+  std::optional<std::string> crs_;
+};
+
+/// \brief A data type representing OGC geography in WKB format.
+class ICEBERG_EXPORT GeographyType : public PrimitiveType {
+ public:
+  constexpr static const TypeId kTypeId = TypeId::kGeography;
+  constexpr static std::string_view kDefaultCrs = "OGC:CRS84";
+  constexpr static EdgeAlgorithm kDefaultAlgorithm = EdgeAlgorithm::kSpherical;
+
+  GeographyType() = default;
+  explicit GeographyType(std::string crs);
+  GeographyType(std::string crs, EdgeAlgorithm algorithm);
+  ~GeographyType() override = default;
+
+  [[nodiscard]] std::string_view crs() const;
+  [[nodiscard]] EdgeAlgorithm algorithm() const;
+
+  TypeId type_id() const override;
+  std::string ToString() const override;
+
+ protected:
+  bool Equals(const Type& other) const override;
+
+ private:
+  std::optional<std::string> crs_;

Review Comment:
   ditto



##########
src/iceberg/type.h:
##########
@@ -518,11 +542,59 @@ class ICEBERG_EXPORT UnknownType : public PrimitiveType {
   bool Equals(const Type& other) const override;
 };
 
+/// \brief A data type representing OGC geometry in WKB format.
+class ICEBERG_EXPORT GeometryType : public PrimitiveType {
+ public:
+  constexpr static const TypeId kTypeId = TypeId::kGeometry;
+  constexpr static std::string_view kDefaultCrs = "OGC:CRS84";
+
+  GeometryType() = default;
+  explicit GeometryType(std::string crs);
+  ~GeometryType() override = default;
+
+  [[nodiscard]] std::string_view crs() const;
+
+  TypeId type_id() const override;
+  std::string ToString() const override;
+
+ protected:
+  bool Equals(const Type& other) const override;
+
+ private:
+  std::optional<std::string> crs_;
+};
+
+/// \brief A data type representing OGC geography in WKB format.
+class ICEBERG_EXPORT GeographyType : public PrimitiveType {
+ public:
+  constexpr static const TypeId kTypeId = TypeId::kGeography;
+  constexpr static std::string_view kDefaultCrs = "OGC:CRS84";
+  constexpr static EdgeAlgorithm kDefaultAlgorithm = EdgeAlgorithm::kSpherical;
+
+  GeographyType() = default;
+  explicit GeographyType(std::string crs);
+  GeographyType(std::string crs, EdgeAlgorithm algorithm);
+  ~GeographyType() override = default;
+
+  [[nodiscard]] std::string_view crs() const;
+  [[nodiscard]] EdgeAlgorithm algorithm() const;

Review Comment:
   ```suggestion
     std::string_view crs() const;
     EdgeAlgorithm algorithm() const;
   ```



##########
src/iceberg/type.h:
##########
@@ -518,11 +542,59 @@ class ICEBERG_EXPORT UnknownType : public PrimitiveType {
   bool Equals(const Type& other) const override;
 };
 
+/// \brief A data type representing OGC geometry in WKB format.
+class ICEBERG_EXPORT GeometryType : public PrimitiveType {
+ public:
+  constexpr static const TypeId kTypeId = TypeId::kGeometry;
+  constexpr static std::string_view kDefaultCrs = "OGC:CRS84";
+
+  GeometryType() = default;
+  explicit GeometryType(std::string crs);
+  ~GeometryType() override = default;
+
+  [[nodiscard]] std::string_view crs() const;
+
+  TypeId type_id() const override;
+  std::string ToString() const override;
+
+ protected:
+  bool Equals(const Type& other) const override;
+
+ private:
+  std::optional<std::string> crs_;

Review Comment:
   Empty thing is enough to represent a missing crs.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to