Skip to content

Commit 56e7cff

Browse files
authored
Add GEOM_WKB and GEOM_WKT enum types to python API (#1895)
* Add TILEDB_GEOM_WKB and WKT types to python API * Also ifdef the enum
1 parent a355893 commit 56e7cff

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

tiledb/cc/common.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ std::unordered_map<tiledb_datatype_t, std::string> _tdb_to_np_name_dtype = {
4747
#if TILEDB_VERSION_MAJOR >= 2 && TILEDB_VERSION_MINOR >= 10
4848
{TILEDB_BOOL, "bool"},
4949
#endif
50+
#if TILEDB_VERSION_MAJOR >= 2 && TILEDB_VERSION_MINOR >= 21
51+
{TILEDB_GEOM_WKB, "byte"},
52+
{TILEDB_GEOM_WKT, "S1"},
53+
#endif
5054
};
5155

5256
std::unordered_map<std::string, tiledb_datatype_t> _np_name_to_tdb_dtype = {

tiledb/cc/enum.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,12 @@ void init_enums(py::module &m) {
6262
.value("TIME_PS", TILEDB_TIME_PS)
6363
.value("TIME_FS", TILEDB_TIME_FS)
6464
.value("TIME_AS", TILEDB_TIME_AS)
65-
.value("BLOB", TILEDB_BLOB);
65+
.value("BLOB", TILEDB_BLOB)
66+
#if TILEDB_VERSION_MAJOR >= 2 && TILEDB_VERSION_MINOR >= 21
67+
.value("GEOM_WKB", TILEDB_GEOM_WKB)
68+
.value("GEOM_WKT", TILEDB_GEOM_WKT)
69+
#endif
70+
; // line continuation for ifdef
6671

6772
py::enum_<tiledb_array_type_t>(m, "ArrayType")
6873
.value("DENSE", TILEDB_DENSE)

tiledb/core.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,12 @@ py::dtype tiledb_dtype(tiledb_datatype_t type, uint32_t cell_val_num) {
230230
case TILEDB_BOOL:
231231
return py::dtype("bool");
232232
#endif
233+
#if TILEDB_VERSION_MAJOR >= 2 && TILEDB_VERSION_MINOR >= 21
234+
case TILEDB_GEOM_WKB:
235+
return py::dtype("byte");
236+
case TILEDB_GEOM_WKT:
237+
return py::dtype("S1");
238+
#endif
233239

234240
case TILEDB_ANY:
235241
break;

0 commit comments

Comments
 (0)