Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ set(EXTENSION_SOURCES
src/geo/tgeography.cpp
src/geo/tgeography_in_out.cpp
src/geo/tgeography_ops.cpp
src/pointcloud/tpcpoint.cpp
src/pointcloud/tpcpoint_in_out.cpp
src/geo/tgeogpoint.cpp
src/geo/tgeogpoint_in_out.cpp
src/geo/tgeogpoint_ops.cpp
Expand Down
29 changes: 29 additions & 0 deletions src/include/pointcloud/tpcpoint.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#pragma once

#include <tydef.hpp>
#include "duckdb/common/exception.hpp"
#include "duckdb/common/string_util.hpp"
#include "duckdb/function/scalar_function.hpp"
#include "duckdb/main/extension/extension_loader.hpp"
#include <duckdb/parser/parsed_data/create_scalar_function_info.hpp>

namespace duckdb {


struct TPcpointTypes {
static LogicalType TPCPOINT();
static LogicalType GEOMETRY();
static void RegisterTypes(ExtensionLoader &loader);
static void RegisterScalarFunctions(ExtensionLoader &loader);
static void RegisterCastFunctions(ExtensionLoader &loader);
static void RegisterScalarInOutFunctions(ExtensionLoader &loader);
};

struct TpcpointFunctions {
static bool StringToTpcpoint(Vector &source, Vector &result, idx_t count, CastParameters &parameters);
static bool TpcpointToString(Vector &source, Vector &result, idx_t count, CastParameters &parameters);
static bool WkbBlobToGeometry(Vector &source, Vector &result, idx_t count, CastParameters &parameters);
};


} // namespace duckdb
7 changes: 7 additions & 0 deletions src/mobilityduck_extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "geo/tgeometry_ops.hpp"
#include "geo/tgeography.hpp"
#include "geo/tgeography_ops.hpp"
#include "pointcloud/tpcpoint.hpp"
#include "geo/tgeogpoint.hpp"
#include "geo/tgeogpoint_ops.hpp"
#include "temporal/span.hpp"
Expand Down Expand Up @@ -406,6 +407,12 @@ static void LoadInternal(ExtensionLoader &loader) {
TRGeometryTypes::RegisterScalarInOutFunctions(loader);
#endif

// Extended temporal type tpcpoint (requires the MEOS POINTCLOUD module).
TPcpointTypes::RegisterScalarFunctions(loader);
TPcpointTypes::RegisterTypes(loader);
TPcpointTypes::RegisterCastFunctions(loader);
TPcpointTypes::RegisterScalarInOutFunctions(loader);

SetTypes::RegisterTypes(loader);
SetTypes::RegisterCastFunctions(loader);
SetTypes::RegisterScalarFunctions(loader);
Expand Down
Loading
Loading