Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] add GEOM_WKB and GEOM_WKT types to python API #1895

Merged
merged 2 commits into from
Feb 12, 2024
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
4 changes: 4 additions & 0 deletions tiledb/cc/common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ std::unordered_map<tiledb_datatype_t, std::string> _tdb_to_np_name_dtype = {
#if TILEDB_VERSION_MAJOR >= 2 && TILEDB_VERSION_MINOR >= 10
{TILEDB_BOOL, "bool"},
#endif
#if TILEDB_VERSION_MAJOR >= 2 && TILEDB_VERSION_MINOR >= 21
{TILEDB_GEOM_WKB, "byte"},
{TILEDB_GEOM_WKT, "S1"},
#endif
};

std::unordered_map<std::string, tiledb_datatype_t> _np_name_to_tdb_dtype = {
Expand Down
7 changes: 6 additions & 1 deletion tiledb/cc/enum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@ void init_enums(py::module &m) {
.value("TIME_PS", TILEDB_TIME_PS)
.value("TIME_FS", TILEDB_TIME_FS)
.value("TIME_AS", TILEDB_TIME_AS)
.value("BLOB", TILEDB_BLOB);
.value("BLOB", TILEDB_BLOB)
#if TILEDB_VERSION_MAJOR >= 2 && TILEDB_VERSION_MINOR >= 21
.value("GEOM_WKB", TILEDB_GEOM_WKB)
.value("GEOM_WKT", TILEDB_GEOM_WKT)
#endif
; // line continuation for ifdef

py::enum_<tiledb_array_type_t>(m, "ArrayType")
.value("DENSE", TILEDB_DENSE)
Expand Down
6 changes: 6 additions & 0 deletions tiledb/core.cc
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,12 @@ py::dtype tiledb_dtype(tiledb_datatype_t type, uint32_t cell_val_num) {
case TILEDB_BOOL:
return py::dtype("bool");
#endif
#if TILEDB_VERSION_MAJOR >= 2 && TILEDB_VERSION_MINOR >= 21
case TILEDB_GEOM_WKB:
return py::dtype("byte");
case TILEDB_GEOM_WKT:
return py::dtype("S1");
#endif

case TILEDB_ANY:
break;
Expand Down
Loading