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
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@ if(POSE)
src/geo/tpose_in_out.cpp)
endif()

option(RGEO "Build the trgeometry temporal type" ON)
if(RGEO)
add_definitions(-DRGEO=1)
list(APPEND EXTENSION_SOURCES
src/rgeo/trgeometry.cpp
src/rgeo/trgeometry_in_out.cpp)
endif()

build_static_extension(${TARGET_NAME} ${EXTENSION_SOURCES})
build_loadable_extension(${TARGET_NAME} "" ${EXTENSION_SOURCES})

Expand Down
29 changes: 29 additions & 0 deletions src/include/rgeo/trgeometry.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 TRGeometryTypes {
static LogicalType TRGEOMETRY();
static LogicalType GEOMETRY();
static void RegisterTypes(ExtensionLoader &loader);
static void RegisterScalarFunctions(ExtensionLoader &loader);
static void RegisterCastFunctions(ExtensionLoader &loader);
static void RegisterScalarInOutFunctions(ExtensionLoader &loader);
};

struct TrgeometryFunctions {
static bool StringToTrgeometry(Vector &source, Vector &result, idx_t count, CastParameters &parameters);
static bool TrgeometryToString(Vector &source, Vector &result, idx_t count, CastParameters &parameters);
static bool WkbBlobToGeometry(Vector &source, Vector &result, idx_t count, CastParameters &parameters);
};


} // namespace duckdb
11 changes: 11 additions & 0 deletions src/mobilityduck_extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
#if POSE
#include "geo/tpose.hpp"
#endif
#if RGEO
#include "rgeo/trgeometry.hpp"
#endif
#include "geo/tgeometry.hpp"
#include "geo/tgeometry_ops.hpp"
#include "geo/tgeography.hpp"
Expand Down Expand Up @@ -395,6 +398,14 @@ static void LoadInternal(ExtensionLoader &loader) {
TPoseTypes::RegisterScalarInOutFunctions(loader);
#endif

// Extended temporal type trgeometry (requires the MEOS RGEO module).
#if RGEO
TRGeometryTypes::RegisterTypes(loader);
TRGeometryTypes::RegisterCastFunctions(loader);
TRGeometryTypes::RegisterScalarFunctions(loader);
TRGeometryTypes::RegisterScalarInOutFunctions(loader);
#endif

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