Skip to content
Merged
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 @@ -77,6 +77,7 @@ include_directories(SYSTEM duckdb-spatial/src/spatial)

set(EXTENSION_SOURCES
src/spatial_ref_sys_csv.inc
src/ways_csv.inc
src/mobilityduck_extension.cpp
src/generated/generated_temporal_udfs.cpp
src/generated/generated_type_registration.cpp
Expand Down Expand Up @@ -121,6 +122,7 @@ set(EXTENSION_SOURCES
src/json/tjsonb_in_out.cpp
src/h3/th3index.cpp
src/cbuffer/tcbuffer.cpp
src/npoint/tnpoint.cpp
src/index/rtree_module.cpp
src/single_tile_getters.cpp
src/index/rtree_index_create_physical.cpp
Expand Down
255 changes: 254 additions & 1 deletion src/generated/generated_temporal_udfs.cpp

Large diffs are not rendered by default.

104 changes: 0 additions & 104 deletions src/include/index/rtree_module.hpp.merged

This file was deleted.

46 changes: 46 additions & 0 deletions src/include/npoint/tnpoint.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#pragma once

#include "meos_wrapper_simple.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 {

/* npoint is a network point (a route identifier + a fractional position); a
* varlena value surfaced as a BLOB. nsegment is a network segment (route +
* two positions). tnpoint is the temporal network point, stored as a
* Temporal* blob. Canonical names per meos_catalog.c ([T_NPOINT]="npoint" :138,
* [T_NSEGMENT]="nsegment" :140, [T_TNPOINT]="tnpoint" :141). npoint is the
* 2D-planar twin of cbuffer: both are Spatial<T> base values, non-geodetic.
* npoint carries NO SRID of its own — npoint_srid() returns get_srid_ways(), so
* the `ways` network CSV must be loaded (meos_set_ways_csv) for construction and
* geometry ops to resolve. This binding registers only the type + text I/O
* boundary; the operation surface (constructors, accessors, predicates,
* distance, …) is generated from the MEOS-API catalog into src/generated/. */
struct NpointTypes {
static LogicalType npoint();
static LogicalType nsegment();
static LogicalType tnpoint();

static void RegisterTypes(ExtensionLoader &loader);
static void RegisterCastFunctions(ExtensionLoader &loader);
};

struct NpointFunctions {
/* In/out — static npoint value */
static bool Npoint_in_cast(Vector &source, Vector &result, idx_t count, CastParameters &parameters);
static bool Npoint_out_cast(Vector &source, Vector &result, idx_t count, CastParameters &parameters);

/* In/out — static nsegment value */
static bool Nsegment_in_cast(Vector &source, Vector &result, idx_t count, CastParameters &parameters);
static bool Nsegment_out_cast(Vector &source, Vector &result, idx_t count, CastParameters &parameters);

/* In/out — tnpoint temporal value */
static bool Tnpoint_in_cast(Vector &source, Vector &result, idx_t count, CastParameters &parameters);
static bool Tnpoint_out_cast(Vector &source, Vector &result, idx_t count, CastParameters &parameters);
};

} // namespace duckdb
Loading
Loading