From d9c57b534189f7722cdaa685e8b3be6057957097 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20Zim=C3=A1nyi?= Date: Thu, 12 Nov 2026 16:57:07 +0100 Subject: [PATCH] Hold a grid cell MEOS passes by value in a class of its own The function and object layers are generated from the MEOS-API catalog of MobilityDB c5174b8af1, whose object model gives H3Index, Quadbin and S2Cell a class marked byValue (MEOS-API #273), with cType the typedef MEOS passes the cell as (H3Index, Quadbin, S2CellId, each a uint64_t). The tree also carries what MobilityDB master changed since 78ebe3b7fe, the commit it was generated from, in 37 files. tools/objectgen.py reads byValue and cType from the catalog and nothing else. Such a class is a readonly record struct holding the scalar of its cType, equal where the scalars are equal, with explicit conversions from and to that scalar (#value_head, beside #held_struct_file, which declares a struct of values a record struct). Model.class_for_value answers the class for any slot whose typedef is that cType, as class_for_ctype answers it for a pointer, and the class stays out of wrap_root and of the hierarchy its model parent heads, since a C# value type has no base class. A method of the class receives the value it holds; every parameter, return, out-parameter (#value_out_reader, beside #wrapped_out_reader), counted array and answered array the catalog types with the cType is the class: TH3Index.StartValue answers an H3Index, Geo.ToQuadbinCell a Quadbin, TGeomPoint.S2cellSplit an S2Cell[]. The portable readers and writers come from the catalog's typeEncodings as for every other class, so each cell has AsText, FromText, AsWKB, FromWKB, AsHexWKB and FromHexWKB, and ToString is its text. PortableIoTests reads and writes the three cells through each format, and OutParameterTests and CatalogValueTypeTests read the cells a temporal cell, a cell set and a geometry answer as their classes. Why: the catalog names the cells as classes, and the layer projected them as pointer handles no call ever made, with every member static over a ulong, no AsText and no ToString, and a WrapH3Index, WrapQuadbin and WrapS2Cell in MEOSFactory reading a pointer MEOS never answers. Witness: over the catalog with the cell classes the generators before and after the change emit 155 classes each, and 5259 and 5262 methods, the three more being the cells' AsText; the 24 files they differ in differ in the cell classes, in the cells taken and answered elsewhere and in the three removed MEOSFactory wrappers alone, and the gap ledger is the same. Over the catalog without them the two generators write the same tree, and the changed generator run twice writes the same tree. dotnet build reports 0 warnings and 0 errors, and dotnet test passes 103 of 103, none skipped, against libmeos built from MobilityDB c5174b8af1, the floor CI holds the count to being 103; Quadbin 48427fffffffffff writes 01470000FFFFFFFFFF7F4248 as hex WKB, S2Cell 47c3c444c writes 01550000000000C044C4C347, and H3Index 8a2a1072b59ffff reads back from each format as itself. --- .github/workflows/ci.yml | 2 +- GAP-LEDGER.md | 81 ++++--- MEOS.NET.Tests/CatalogValueTypeTests.cs | 12 +- MEOS.NET.Tests/OutParameterTests.cs | 14 +- MEOS.NET.Tests/PortableIoTests.cs | 44 ++++ MEOS.NET/Enums/MeosOper.g.cs | 6 + MEOS.NET/Functions/Meos.Native.g.cs | 243 ++++++++++--------- MEOS.NET/Functions/Meos.meos.g.cs | 40 ++- MEOS.NET/Functions/Meos.meos_catalog.g.cs | 3 + MEOS.NET/Functions/Meos.meos_cbuffer.g.cs | 12 + MEOS.NET/Functions/Meos.meos_geo.g.cs | 18 ++ MEOS.NET/Functions/Meos.meos_internal.g.cs | 4 +- MEOS.NET/Functions/Meos.meos_json.g.cs | 4 +- MEOS.NET/Functions/Meos.meos_npoint.g.cs | 12 + MEOS.NET/Functions/Meos.meos_pointcloud.g.cs | 12 + MEOS.NET/Functions/Meos.meos_pose.g.cs | 18 ++ MEOS.NET/Functions/Meos.meos_rgeo.g.cs | 156 +----------- MEOS.NET/Types/Geo.g.cs | 12 +- MEOS.NET/Types/Geography.g.cs | 3 - MEOS.NET/Types/Geometry.g.cs | 3 - MEOS.NET/Types/H3Index.g.cs | 141 +++++++++++ MEOS.NET/Types/H3IndexSet.g.cs | 53 ++-- MEOS.NET/Types/Jsonb.g.cs | 2 +- MEOS.NET/Types/Quadbin.g.cs | 180 ++++++++++++++ MEOS.NET/Types/QuadbinSet.g.cs | 53 ++-- MEOS.NET/Types/RaQuet.g.cs | 26 +- MEOS.NET/Types/Raster.g.cs | 4 +- MEOS.NET/Types/S2Cell.g.cs | 186 ++++++++++++++ MEOS.NET/Types/S2CellSet.g.cs | 53 ++-- MEOS.NET/Types/STBox.g.cs | 81 ++++--- MEOS.NET/Types/TAlpha.g.cs | 6 + MEOS.NET/Types/TBigInt.g.cs | 6 + MEOS.NET/Types/TBool.g.cs | 6 + MEOS.NET/Types/TBox.g.cs | 27 +++ MEOS.NET/Types/TCBuffer.g.cs | 6 + MEOS.NET/Types/TFloat.g.cs | 6 + MEOS.NET/Types/TGeo.g.cs | 12 + MEOS.NET/Types/TGeogPoint.g.cs | 18 +- MEOS.NET/Types/TGeography.g.cs | 6 + MEOS.NET/Types/TGeomPoint.g.cs | 18 +- MEOS.NET/Types/TGeometry.g.cs | 6 + MEOS.NET/Types/TH3Index.g.cs | 88 +++---- MEOS.NET/Types/TH3IndexInst.g.cs | 4 +- MEOS.NET/Types/TH3IndexSeq.g.cs | 10 +- MEOS.NET/Types/TH3IndexSeqSet.g.cs | 4 +- MEOS.NET/Types/TInt.g.cs | 6 + MEOS.NET/Types/TNPoint.g.cs | 6 + MEOS.NET/Types/TNumber.g.cs | 6 + MEOS.NET/Types/TPCPatch.g.cs | 6 + MEOS.NET/Types/TPCPoint.g.cs | 6 + MEOS.NET/Types/TPose.g.cs | 12 + MEOS.NET/Types/TQuadbin.g.cs | 88 +++---- MEOS.NET/Types/TQuadbinInst.g.cs | 4 +- MEOS.NET/Types/TQuadbinSeq.g.cs | 10 +- MEOS.NET/Types/TQuadbinSeqSet.g.cs | 4 +- MEOS.NET/Types/TRGeometry.g.cs | 126 +--------- MEOS.NET/Types/TS2Cell.g.cs | 88 +++---- MEOS.NET/Types/TS2CellInst.g.cs | 4 +- MEOS.NET/Types/TS2CellSeq.g.cs | 10 +- MEOS.NET/Types/TS2CellSeqSet.g.cs | 4 +- MEOS.NET/Types/TText.g.cs | 6 + MEOS.NET/Types/Temporal.g.cs | 6 + MEOS.NET/Types/TsTzSpan.g.cs | 18 ++ MEOS.NET/Types/Value.g.cs | 2 +- tools/README.md | 10 + tools/objectgen.py | 158 ++++++++++-- 66 files changed, 1498 insertions(+), 783 deletions(-) create mode 100644 MEOS.NET/Types/H3Index.g.cs create mode 100644 MEOS.NET/Types/Quadbin.g.cs create mode 100644 MEOS.NET/Types/S2Cell.g.cs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4cd8af8..6f82891 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,7 +70,7 @@ jobs: uses: MobilityDB/MEOS-API/.github/actions/check-test-outcome@master with: log: test.log - min-tests: "99" + min-tests: "103" - name: Smoke-test the FFI run: dotnet run --project ExampleApp/ExampleApp.csproj -c Release --no-build diff --git a/GAP-LEDGER.md b/GAP-LEDGER.md index 758638b..9ece7aa 100644 --- a/GAP-LEDGER.md +++ b/GAP-LEDGER.md @@ -10,14 +10,14 @@ A kind with no rows is a site the generators watch and that nothing reached in this run. It prints so that an empty class reads as a measurement rather than as a class nobody looked at. -Generated from `meos-idl.json` at MobilityDB `78ebe3b7fe401f25dc4c0372ef6b8a294abd579c` by `tools/codegen.py` +Generated from `meos-idl.json` at MobilityDB `c5174b8af15d3ef3f38c77ba60cbf5a5d99dd54c` by `tools/codegen.py` and `tools/objectgen.py`. Do not edit. ## The flat surface — `tools/codegen.py` -### parameter nullability — 4335 +### parameter nullability — 4336 `shape.nullable` names the parameters a function accepts NULL for, and the catalog carries no field saying a parameter is required. A pointer parameter named in neither reaches the surface with its contract unstated: the wrapper takes it, and nothing says whether zero is an argument or a fault. @@ -319,6 +319,23 @@ and `tools/objectgen.py`. Do not edit. | always_ne_ts2cell_s2cell | temp | | always_ne_ts2cell_ts2cell | temp1, temp2 | | always_ne_ttext_text | temp, txt | +| always_overlaps_stbox_tcbuffer | box, temp | +| always_overlaps_stbox_tgeo | box, temp | +| always_overlaps_stbox_tnpoint | box, temp | +| always_overlaps_stbox_tpose | box, temp | +| always_overlaps_stbox_trgeometry | box, temp | +| always_overlaps_tbox_tnumber | box, temp | +| always_overlaps_tcbuffer_stbox | temp, box | +| always_overlaps_temporal_temporal | temp1, temp2 | +| always_overlaps_temporal_tstzspan | temp, s | +| always_overlaps_tgeo_stbox | temp, box | +| always_overlaps_tgeo_tgeo | temp1, temp2 | +| always_overlaps_tnpoint_stbox | temp, box | +| always_overlaps_tnumber_tbox | temp, box | +| always_overlaps_tpose_stbox | temp, box | +| always_overlaps_tpose_tpose | temp1, temp2 | +| always_overlaps_trgeometry_stbox | temp, box | +| always_overlaps_tstzspan_temporal | s, temp | | araster_value | traj, rast, vspan | | araster_value_gdal | traj, path, vspan | | atouches_cbuffer_tcbuffer | cb, temp | @@ -927,6 +944,23 @@ and `tools/objectgen.py`. Do not edit. | ever_ne_ts2cell_s2cell | temp | | ever_ne_ts2cell_ts2cell | temp1, temp2 | | ever_ne_ttext_text | temp, txt | +| ever_overlaps_stbox_tcbuffer | box, temp | +| ever_overlaps_stbox_tgeo | box, temp | +| ever_overlaps_stbox_tnpoint | box, temp | +| ever_overlaps_stbox_tpose | box, temp | +| ever_overlaps_stbox_trgeometry | box, temp | +| ever_overlaps_tbox_tnumber | box, temp | +| ever_overlaps_tcbuffer_stbox | temp, box | +| ever_overlaps_temporal_temporal | temp1, temp2 | +| ever_overlaps_temporal_tstzspan | temp, s | +| ever_overlaps_tgeo_stbox | temp, box | +| ever_overlaps_tgeo_tgeo | temp1, temp2 | +| ever_overlaps_tnpoint_stbox | temp, box | +| ever_overlaps_tnumber_tbox | temp, box | +| ever_overlaps_tpose_stbox | temp, box | +| ever_overlaps_tpose_tpose | temp1, temp2 | +| ever_overlaps_trgeometry_stbox | temp, box | +| ever_overlaps_tstzspan_temporal | s, temp | | float4_in | num | | float8_in | str | | float8_out | size_out | @@ -1603,9 +1637,7 @@ and `tools/objectgen.py`. Do not edit. | nad_tbigint_tbigint | temp1, temp2 | | nad_tbigint_tbox | temp, box | | nad_tbox_tbox | box1, box2 | -| nad_tboxbigint_tboxbigint | box1, box2 | -| nad_tboxfloat_tboxfloat | box1, box2 | -| nad_tboxint_tboxint | box1, box2 | +| nad_tbox_tbox_intl | box1, box2 | | nad_tcbuffer_cbuffer | temp, cb | | nad_tcbuffer_geo | temp, gs | | nad_tcbuffer_stbox | temp, box | @@ -3754,12 +3786,14 @@ and `tools/objectgen.py`. Do not edit. | tpcbox_ymin | box, result | | tpcbox_zmax | box, result | | tpcbox_zmin | box, result | +| tpcpatch_at_tpcbox | temp, box | | tpcpatch_at_value | temp, pa | | tpcpatch_end_npoints | temp | | tpcpatch_end_value | temp | | tpcpatch_from_base_temp | pa, temp | | tpcpatch_from_mfjson | mfjson | | tpcpatch_in | str | +| tpcpatch_minus_tpcbox | temp, box | | tpcpatch_minus_value | temp, pa | | tpcpatch_npoints | temp | | tpcpatch_pcid | temp | @@ -3780,11 +3814,13 @@ and `tools/objectgen.py`. Do not edit. | tpcpatchseq_in | str | | tpcpatchseqset_from_base_tstzspanset | pa, ss | | tpcpatchseqset_in | str | +| tpcpoint_at_tpcbox | temp, box | | tpcpoint_at_value | temp, pt | | tpcpoint_end_value | temp | | tpcpoint_from_base_temp | pt, temp | | tpcpoint_from_mfjson | mfjson | | tpcpoint_in | str | +| tpcpoint_minus_tpcbox | temp, box | | tpcpoint_minus_value | temp, pt | | tpcpoint_pcid | temp | | tpcpoint_start_value | temp | @@ -3948,10 +3984,7 @@ and `tools/objectgen.py`. Do not edit. | tquadbinseqset_from_base_tstzspanset | ss | | tquadbinseqset_in | str | | tquadbinseqset_make | sequences | -| trgeometry_after_timestamptz | temp | | trgeometry_angular_speed | temp | -| trgeometry_append_tinstant | temp, inst | -| trgeometry_append_tsequence | temp, seq | | trgeometry_as_ewkt | temp, size_out | | trgeometry_as_text | temp, size_out | | trgeometry_as_tinstant | temp | @@ -3959,65 +3992,33 @@ and `tools/objectgen.py`. Do not edit. | trgeometry_as_tsequenceset | temp | | trgeometry_at_geom | temp, gs | | trgeometry_at_stbox | temp, box | -| trgeometry_at_timestamptz | temp | -| trgeometry_at_tstzset | temp, s | -| trgeometry_at_tstzspan | temp, s | -| trgeometry_at_tstzspanset | temp, ss | | trgeometry_at_value | temp, pose | -| trgeometry_at_values | temp, s | -| trgeometry_before_timestamptz | temp | | trgeometry_body_point_trajectory | temp, gs | | trgeometry_centroid | temp | | trgeometry_convex_hull | temp | | trgeometry_cumulative_length | temp | -| trgeometry_delete_timestamptz | temp | -| trgeometry_delete_tstzset | temp, s | -| trgeometry_delete_tstzspan | temp, s | -| trgeometry_delete_tstzspanset | temp, ss | -| trgeometry_end_instant | temp | -| trgeometry_end_sequence | temp | | trgeometry_end_value | temp | | trgeometry_force2d | temp | | trgeometry_from_mfjson | mfjson | | trgeometry_geom | temp | | trgeometry_in | str | -| trgeometry_instant_n | temp | -| trgeometry_instants | temp, count | | trgeometry_length | temp | -| trgeometry_merge_array | temparr | | trgeometry_minus_geom | temp, gs | | trgeometry_minus_stbox | temp, box | -| trgeometry_minus_timestamptz | temp | -| trgeometry_minus_tstzset | temp, s | -| trgeometry_minus_tstzspan | temp, s | -| trgeometry_minus_tstzspanset | temp, ss | | trgeometry_minus_value | temp, pose | -| trgeometry_minus_values | temp, s | | trgeometry_out | temp, size_out | | trgeometry_pitch | temp | | trgeometry_points | temp | -| trgeometry_restrict_timestamptz | temp | -| trgeometry_restrict_tstzset | temp, s | -| trgeometry_restrict_tstzspan | temp, s | -| trgeometry_restrict_tstzspanset | temp, ss | -| trgeometry_restrict_values | temp, s | | trgeometry_roll | temp | | trgeometry_rotate | temp | | trgeometry_rotate_x | temp | | trgeometry_rotate_y | temp | | trgeometry_rotate_z | temp | -| trgeometry_round | temp | -| trgeometry_segments | temp, count | -| trgeometry_sequence_n | temp | -| trgeometry_sequences | temp, count | -| trgeometry_set_interp | temp | | trgeometry_space_boxes | temp, sorigin, count | | trgeometry_space_time_boxes | temp, duration, sorigin, count | | trgeometry_speed | temp | | trgeometry_split_each_n_stboxes | temp, count | | trgeometry_split_n_stboxes | temp, count | -| trgeometry_start_instant | temp | -| trgeometry_start_sequence | temp | | trgeometry_start_value | temp | | trgeometry_stboxes | temp, count | | trgeometry_time_boxes | temp, duration, count | diff --git a/MEOS.NET.Tests/CatalogValueTypeTests.cs b/MEOS.NET.Tests/CatalogValueTypeTests.cs index e86a24a..0b6db81 100644 --- a/MEOS.NET.Tests/CatalogValueTypeTests.cs +++ b/MEOS.NET.Tests/CatalogValueTypeTests.cs @@ -5,8 +5,9 @@ namespace MEOS.NET.Tests { /// /// Whatever the wrapper already states as a C# value — an enum the catalog - /// names, a scalar behind a MEOS typedef, a struct carried by value — the - /// object layer hands on as that value. + /// names, a struct carried by value — the object layer hands on as that + /// value, and a scalar behind a typedef the catalog gives a class held by + /// value comes back as that class. /// [TestClass] public class CatalogValueTypeTests : MeosTest @@ -25,13 +26,14 @@ public void AnEnumArgumentIsTheTextMeosReadsThroughItsPair() } [TestMethod] - public void AScalarBehindATypedefComesBackAsThatScalar() + public void AScalarBehindACellTypedefComesBackAsItsClass() { Geo point = Geo.FromText("POINT(1 1)", 4326)!; - ulong cell = point.ToS2cellCell(10); + S2Cell cell = point.ToS2cellCell(10); - Assert.AreNotEqual(0UL, cell); + Assert.AreNotEqual(0UL, (ulong)cell); + Assert.AreEqual(10u, cell.GetResolution()); } } } diff --git a/MEOS.NET.Tests/OutParameterTests.cs b/MEOS.NET.Tests/OutParameterTests.cs index e08d12e..ead717c 100644 --- a/MEOS.NET.Tests/OutParameterTests.cs +++ b/MEOS.NET.Tests/OutParameterTests.cs @@ -23,15 +23,17 @@ public void ABoxAnswersTheBoundsItHas() public void ATemporalH3IndexAnswersTheCellsItHolds() { // th3index_value_n and th3index_value_at_timestamptz write an - // H3Index, a uint64_t, through their result pointer. + // H3Index, a uint64_t, through their result pointer, and the + // method answers it as the H3Index it is. TH3Index cells = (TH3Index)TH3Index.In( "[831c02fffffffff@2001-01-01, 831c00fffffffff@2001-01-02]")!; DateTime second = new DateTime(2001, 1, 2, 0, 0, 0, DateTimeKind.Utc); - Assert.AreEqual(0x831c02fffffffffUL, cells.ValueN(1)); - Assert.AreEqual(0x831c00fffffffffUL, cells.ValueN(2)); + Assert.AreEqual(new H3Index(0x831c02fffffffffUL), cells.ValueN(1)); + Assert.AreEqual(new H3Index(0x831c00fffffffffUL), cells.ValueN(2)); Assert.IsNull(cells.ValueN(3)); - Assert.AreEqual(0x831c00fffffffffUL, cells.ValueAtTimestamptz(second, true)); + Assert.AreEqual(new H3Index(0x831c00fffffffffUL), + cells.ValueAtTimestamptz(second, true)); } [TestMethod] @@ -40,8 +42,8 @@ public void AnH3IndexSetAnswersTheCellsItHolds() // h3indexset_value_n, over a set MEOS keeps in ascending order. H3IndexSet set = (H3IndexSet)H3IndexSet.In("{831c02fffffffff, 831c00fffffffff}")!; - Assert.AreEqual(0x831c00fffffffffUL, set.ValueN(1)); - Assert.AreEqual(0x831c02fffffffffUL, set.ValueN(2)); + Assert.AreEqual(new H3Index(0x831c00fffffffffUL), set.ValueN(1)); + Assert.AreEqual(new H3Index(0x831c02fffffffffUL), set.ValueN(2)); } [TestMethod] diff --git a/MEOS.NET.Tests/PortableIoTests.cs b/MEOS.NET.Tests/PortableIoTests.cs index d0177f0..a2a3e2a 100644 --- a/MEOS.NET.Tests/PortableIoTests.cs +++ b/MEOS.NET.Tests/PortableIoTests.cs @@ -65,6 +65,50 @@ public void ATemporalCellIndexAndItsSetHaveTheirClasses() Assert.AreEqual("{\"8a2a1072b59ffff\"}", set.ToString()); } + [TestMethod] + public void AQuadbinCellRoundTripsThroughItsTextAndWkb() + { + Quadbin cell = Quadbin.FromText("48427fffffffffff"); + + Assert.AreEqual("48427fffffffffff", cell.AsText()); + Assert.AreEqual("48427fffffffffff", cell.ToString()); + Assert.AreEqual("01470000FFFFFFFFFF7F4248", cell.AsHexWKB(0)); + Assert.AreEqual(cell, Quadbin.FromHexWKB("01470000FFFFFFFFFF7F4248")); + Assert.AreEqual(cell, Quadbin.FromWKB(cell.AsWKB(0)!)); + } + + [TestMethod] + public void AnS2CellRoundTripsThroughItsTextAndWkb() + { + S2Cell cell = S2Cell.FromText("47c3c444c"); + + Assert.AreEqual("47c3c444c", cell.AsText()); + Assert.AreEqual("47c3c444c", cell.ToString()); + Assert.AreEqual("01550000000000C044C4C347", cell.AsHexWKB(0)); + Assert.AreEqual(cell, S2Cell.FromHexWKB("01550000000000C044C4C347")); + Assert.AreEqual(cell, S2Cell.FromWKB(cell.AsWKB(0)!)); + } + + [TestMethod] + public void AnH3CellRoundTripsThroughItsTextAndWkb() + { + H3Index cell = H3Index.FromText("8a2a1072b59ffff"); + + Assert.AreEqual("8a2a1072b59ffff", cell.AsText()); + Assert.AreEqual("8a2a1072b59ffff", cell.ToString()); + Assert.AreEqual(cell, H3Index.FromHexWKB(cell.AsHexWKB(0))); + Assert.AreEqual(cell, H3Index.FromWKB(cell.AsWKB(0)!)); + } + + [TestMethod] + public void ATemporalCellAnswersItsValueAsTheCellClass() + { + TH3Index temp = (TH3Index)TH3Index.FromText("8a2a1072b59ffff@2024-12-06")!; + + Assert.AreEqual(H3Index.FromText("8a2a1072b59ffff"), temp.StartValue()); + Assert.AreEqual("8a2a1072b59ffff", temp.StartValue().ToString()); + } + [TestMethod] public void AJsonbSetAndATemporalPoseChainHaveTheirClasses() { diff --git a/MEOS.NET/Enums/MeosOper.g.cs b/MEOS.NET/Enums/MeosOper.g.cs index dc2585a..032ba5d 100644 --- a/MEOS.NET/Enums/MeosOper.g.cs +++ b/MEOS.NET/Enums/MeosOper.g.cs @@ -141,5 +141,11 @@ public enum MeosOper /// TEMPCONTAINED_OP TempcontainedOp = 44, + /// EVEROVERLAPS_OP + EveroverlapsOp = 45, + + /// ALWAYSOVERLAPS_OP + AlwaysoverlapsOp = 46, + } } diff --git a/MEOS.NET/Functions/Meos.Native.g.cs b/MEOS.NET/Functions/Meos.Native.g.cs index b1bbe71..ccfba3c 100644 --- a/MEOS.NET/Functions/Meos.Native.g.cs +++ b/MEOS.NET/Functions/Meos.Native.g.cs @@ -3821,6 +3821,21 @@ private static partial class Native [LibraryImport(DllPath, EntryPoint = "always_ne_ttext_text", StringMarshalling = StringMarshalling.Utf8)] internal static partial int AlwaysNeTtextText(IntPtr temp, IntPtr txt); + [LibraryImport(DllPath, EntryPoint = "always_overlaps_tbox_tnumber", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int AlwaysOverlapsTboxTnumber(IntPtr box, IntPtr temp); + + [LibraryImport(DllPath, EntryPoint = "always_overlaps_temporal_temporal", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int AlwaysOverlapsTemporalTemporal(IntPtr temp1, IntPtr temp2); + + [LibraryImport(DllPath, EntryPoint = "always_overlaps_temporal_tstzspan", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int AlwaysOverlapsTemporalTstzspan(IntPtr temp, IntPtr s); + + [LibraryImport(DllPath, EntryPoint = "always_overlaps_tnumber_tbox", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int AlwaysOverlapsTnumberTbox(IntPtr temp, IntPtr box); + + [LibraryImport(DllPath, EntryPoint = "always_overlaps_tstzspan_temporal", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int AlwaysOverlapsTstzspanTemporal(IntPtr s, IntPtr temp); + [LibraryImport(DllPath, EntryPoint = "ever_eq_bool_tbool", StringMarshalling = StringMarshalling.Utf8)] internal static partial int EverEqBoolTbool([MarshalAs(UnmanagedType.U1)] bool b, IntPtr temp); @@ -3995,6 +4010,21 @@ private static partial class Native [LibraryImport(DllPath, EntryPoint = "ever_ne_ttext_text", StringMarshalling = StringMarshalling.Utf8)] internal static partial int EverNeTtextText(IntPtr temp, IntPtr txt); + [LibraryImport(DllPath, EntryPoint = "ever_overlaps_tbox_tnumber", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int EverOverlapsTboxTnumber(IntPtr box, IntPtr temp); + + [LibraryImport(DllPath, EntryPoint = "ever_overlaps_temporal_temporal", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int EverOverlapsTemporalTemporal(IntPtr temp1, IntPtr temp2); + + [LibraryImport(DllPath, EntryPoint = "ever_overlaps_temporal_tstzspan", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int EverOverlapsTemporalTstzspan(IntPtr temp, IntPtr s); + + [LibraryImport(DllPath, EntryPoint = "ever_overlaps_tnumber_tbox", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int EverOverlapsTnumberTbox(IntPtr temp, IntPtr box); + + [LibraryImport(DllPath, EntryPoint = "ever_overlaps_tstzspan_temporal", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int EverOverlapsTstzspanTemporal(IntPtr s, IntPtr temp); + [LibraryImport(DllPath, EntryPoint = "teq_bigint_tbigint", StringMarshalling = StringMarshalling.Utf8)] internal static partial IntPtr TeqBigintTbigint(long i, IntPtr temp); @@ -4701,15 +4731,12 @@ private static partial class Native [LibraryImport(DllPath, EntryPoint = "nad_bigintspan_tbox", StringMarshalling = StringMarshalling.Utf8)] internal static partial long NadBigintspanTbox(IntPtr s, IntPtr box); - [LibraryImport(DllPath, EntryPoint = "nad_tboxfloat_tboxfloat", StringMarshalling = StringMarshalling.Utf8)] - internal static partial double NadTboxfloatTboxfloat(IntPtr box1, IntPtr box2); + [LibraryImport(DllPath, EntryPoint = "nad_tbox_tbox", StringMarshalling = StringMarshalling.Utf8)] + internal static partial double NadTboxTbox(IntPtr box1, IntPtr box2); [LibraryImport(DllPath, EntryPoint = "nad_floatspan_tbox", StringMarshalling = StringMarshalling.Utf8)] internal static partial double NadFloatspanTbox(IntPtr s, IntPtr box); - [LibraryImport(DllPath, EntryPoint = "nad_tboxint_tboxint", StringMarshalling = StringMarshalling.Utf8)] - internal static partial int NadTboxintTboxint(IntPtr box1, IntPtr box2); - [LibraryImport(DllPath, EntryPoint = "nad_intspan_tbox", StringMarshalling = StringMarshalling.Utf8)] internal static partial int NadIntspanTbox(IntPtr s, IntPtr box); @@ -4737,9 +4764,6 @@ private static partial class Native [LibraryImport(DllPath, EntryPoint = "nad_tbigint_tbigint", StringMarshalling = StringMarshalling.Utf8)] internal static partial long NadTbigintTbigint(IntPtr temp1, IntPtr temp2); - [LibraryImport(DllPath, EntryPoint = "nad_tboxbigint_tboxbigint", StringMarshalling = StringMarshalling.Utf8)] - internal static partial long NadTboxbigintTboxbigint(IntPtr box1, IntPtr box2); - [LibraryImport(DllPath, EntryPoint = "nad_tint_int", StringMarshalling = StringMarshalling.Utf8)] internal static partial int NadTintInt(IntPtr temp, int i); @@ -5312,6 +5336,10 @@ private static partial class Native [LibraryImport(DllPath, EntryPoint = "meostype_length", StringMarshalling = StringMarshalling.Utf8)] internal static partial short MeostypeLength(int type); + [LibraryImport(DllPath, EntryPoint = "wkb_header_states_type", StringMarshalling = StringMarshalling.Utf8)] + [return: MarshalAs(UnmanagedType.U1)] + internal static partial bool WkbHeaderStatesType(int type); + [LibraryImport(DllPath, EntryPoint = "talphanum_type", StringMarshalling = StringMarshalling.Utf8)] [return: MarshalAs(UnmanagedType.U1)] internal static partial bool TalphanumType(int type); @@ -6427,6 +6455,15 @@ private static partial class Native [LibraryImport(DllPath, EntryPoint = "always_ne_tgeo_tgeo", StringMarshalling = StringMarshalling.Utf8)] internal static partial int AlwaysNeTgeoTgeo(IntPtr temp1, IntPtr temp2); + [LibraryImport(DllPath, EntryPoint = "always_overlaps_stbox_tgeo", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int AlwaysOverlapsStboxTgeo(IntPtr box, IntPtr temp); + + [LibraryImport(DllPath, EntryPoint = "always_overlaps_tgeo_stbox", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int AlwaysOverlapsTgeoStbox(IntPtr temp, IntPtr box); + + [LibraryImport(DllPath, EntryPoint = "always_overlaps_tgeo_tgeo", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int AlwaysOverlapsTgeoTgeo(IntPtr temp1, IntPtr temp2); + [LibraryImport(DllPath, EntryPoint = "ever_eq_geo_tgeo", StringMarshalling = StringMarshalling.Utf8)] internal static partial int EverEqGeoTgeo(IntPtr gs, IntPtr temp); @@ -6445,6 +6482,15 @@ private static partial class Native [LibraryImport(DllPath, EntryPoint = "ever_ne_tgeo_tgeo", StringMarshalling = StringMarshalling.Utf8)] internal static partial int EverNeTgeoTgeo(IntPtr temp1, IntPtr temp2); + [LibraryImport(DllPath, EntryPoint = "ever_overlaps_stbox_tgeo", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int EverOverlapsStboxTgeo(IntPtr box, IntPtr temp); + + [LibraryImport(DllPath, EntryPoint = "ever_overlaps_tgeo_stbox", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int EverOverlapsTgeoStbox(IntPtr temp, IntPtr box); + + [LibraryImport(DllPath, EntryPoint = "ever_overlaps_tgeo_tgeo", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int EverOverlapsTgeoTgeo(IntPtr temp1, IntPtr temp2); + [LibraryImport(DllPath, EntryPoint = "teq_geo_tgeo", StringMarshalling = StringMarshalling.Utf8)] internal static partial IntPtr TeqGeoTgeo(IntPtr gs, IntPtr temp); @@ -7410,6 +7456,12 @@ private static partial class Native [LibraryImport(DllPath, EntryPoint = "always_ne_tcbuffer_tcbuffer", StringMarshalling = StringMarshalling.Utf8)] internal static partial int AlwaysNeTcbufferTcbuffer(IntPtr temp1, IntPtr temp2); + [LibraryImport(DllPath, EntryPoint = "always_overlaps_stbox_tcbuffer", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int AlwaysOverlapsStboxTcbuffer(IntPtr box, IntPtr temp); + + [LibraryImport(DllPath, EntryPoint = "always_overlaps_tcbuffer_stbox", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int AlwaysOverlapsTcbufferStbox(IntPtr temp, IntPtr box); + [LibraryImport(DllPath, EntryPoint = "ever_eq_cbuffer_tcbuffer", StringMarshalling = StringMarshalling.Utf8)] internal static partial int EverEqCbufferTcbuffer(IntPtr cb, IntPtr temp); @@ -7428,6 +7480,12 @@ private static partial class Native [LibraryImport(DllPath, EntryPoint = "ever_ne_tcbuffer_tcbuffer", StringMarshalling = StringMarshalling.Utf8)] internal static partial int EverNeTcbufferTcbuffer(IntPtr temp1, IntPtr temp2); + [LibraryImport(DllPath, EntryPoint = "ever_overlaps_stbox_tcbuffer", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int EverOverlapsStboxTcbuffer(IntPtr box, IntPtr temp); + + [LibraryImport(DllPath, EntryPoint = "ever_overlaps_tcbuffer_stbox", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int EverOverlapsTcbufferStbox(IntPtr temp, IntPtr box); + [LibraryImport(DllPath, EntryPoint = "teq_cbuffer_tcbuffer", StringMarshalling = StringMarshalling.Utf8)] internal static partial IntPtr TeqCbufferTcbuffer(IntPtr cb, IntPtr temp); @@ -9647,8 +9705,8 @@ private static partial class Native [LibraryImport(DllPath, EntryPoint = "tdistance_tnumber_number", StringMarshalling = StringMarshalling.Utf8)] internal static partial IntPtr TdistanceTnumberNumber(IntPtr temp, ulong value); - [LibraryImport(DllPath, EntryPoint = "nad_tbox_tbox", StringMarshalling = StringMarshalling.Utf8)] - internal static partial ulong NadTboxTbox(IntPtr box1, IntPtr box2); + [LibraryImport(DllPath, EntryPoint = "nad_tbox_tbox_intl", StringMarshalling = StringMarshalling.Utf8)] + internal static partial ulong NadTboxTboxIntl(IntPtr box1, IntPtr box2); [LibraryImport(DllPath, EntryPoint = "nad_tnumber_number", StringMarshalling = StringMarshalling.Utf8)] internal static partial ulong NadTnumberNumber(IntPtr temp, ulong value); @@ -10456,8 +10514,7 @@ private static partial class Native internal static partial int JsonbPathExists(IntPtr jb, IntPtr jp, IntPtr vars, [MarshalAs(UnmanagedType.U1)] bool silent, [MarshalAs(UnmanagedType.U1)] bool tz); [LibraryImport(DllPath, EntryPoint = "jsonb_path_match", StringMarshalling = StringMarshalling.Utf8)] - [return: MarshalAs(UnmanagedType.U1)] - internal static partial bool JsonbPathMatch(IntPtr jb, IntPtr jp, IntPtr vars, [MarshalAs(UnmanagedType.U1)] bool silent, [MarshalAs(UnmanagedType.U1)] bool tz); + internal static partial int JsonbPathMatch(IntPtr jb, IntPtr jp, IntPtr vars, [MarshalAs(UnmanagedType.U1)] bool silent, [MarshalAs(UnmanagedType.U1)] bool tz); [LibraryImport(DllPath, EntryPoint = "jsonb_path_query_all", StringMarshalling = StringMarshalling.Utf8)] internal static partial IntPtr JsonbPathQueryAll(IntPtr jb, IntPtr jp, IntPtr vars, [MarshalAs(UnmanagedType.U1)] bool silent, [MarshalAs(UnmanagedType.U1)] bool tz, IntPtr count); @@ -11346,6 +11403,12 @@ private static partial class Native [LibraryImport(DllPath, EntryPoint = "always_ne_tnpoint_tnpoint", StringMarshalling = StringMarshalling.Utf8)] internal static partial int AlwaysNeTnpointTnpoint(IntPtr temp1, IntPtr temp2); + [LibraryImport(DllPath, EntryPoint = "always_overlaps_stbox_tnpoint", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int AlwaysOverlapsStboxTnpoint(IntPtr box, IntPtr temp); + + [LibraryImport(DllPath, EntryPoint = "always_overlaps_tnpoint_stbox", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int AlwaysOverlapsTnpointStbox(IntPtr temp, IntPtr box); + [LibraryImport(DllPath, EntryPoint = "ever_eq_npoint_tnpoint", StringMarshalling = StringMarshalling.Utf8)] internal static partial int EverEqNpointTnpoint(IntPtr np, IntPtr temp); @@ -11364,6 +11427,12 @@ private static partial class Native [LibraryImport(DllPath, EntryPoint = "ever_ne_tnpoint_tnpoint", StringMarshalling = StringMarshalling.Utf8)] internal static partial int EverNeTnpointTnpoint(IntPtr temp1, IntPtr temp2); + [LibraryImport(DllPath, EntryPoint = "ever_overlaps_stbox_tnpoint", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int EverOverlapsStboxTnpoint(IntPtr box, IntPtr temp); + + [LibraryImport(DllPath, EntryPoint = "ever_overlaps_tnpoint_stbox", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int EverOverlapsTnpointStbox(IntPtr temp, IntPtr box); + [LibraryImport(DllPath, EntryPoint = "teq_tnpoint_npoint", StringMarshalling = StringMarshalling.Utf8)] internal static partial IntPtr TeqTnpointNpoint(IntPtr temp, IntPtr np); @@ -12066,6 +12135,12 @@ private static partial class Native [LibraryImport(DllPath, EntryPoint = "tpcpoint_minus_value", StringMarshalling = StringMarshalling.Utf8)] internal static partial IntPtr TpcpointMinusValue(IntPtr temp, IntPtr pt); + [LibraryImport(DllPath, EntryPoint = "tpcpoint_at_tpcbox", StringMarshalling = StringMarshalling.Utf8)] + internal static partial IntPtr TpcpointAtTpcbox(IntPtr temp, IntPtr box, [MarshalAs(UnmanagedType.U1)] bool border_inc); + + [LibraryImport(DllPath, EntryPoint = "tpcpoint_minus_tpcbox", StringMarshalling = StringMarshalling.Utf8)] + internal static partial IntPtr TpcpointMinusTpcbox(IntPtr temp, IntPtr box, [MarshalAs(UnmanagedType.U1)] bool border_inc); + [LibraryImport(DllPath, EntryPoint = "tpcpoint_pcid", StringMarshalling = StringMarshalling.Utf8)] internal static partial uint TpcpointPcid(IntPtr temp); @@ -12113,6 +12188,12 @@ private static partial class Native [LibraryImport(DllPath, EntryPoint = "tpcpatch_minus_value", StringMarshalling = StringMarshalling.Utf8)] internal static partial IntPtr TpcpatchMinusValue(IntPtr temp, IntPtr pa); + [LibraryImport(DllPath, EntryPoint = "tpcpatch_at_tpcbox", StringMarshalling = StringMarshalling.Utf8)] + internal static partial IntPtr TpcpatchAtTpcbox(IntPtr temp, IntPtr box, [MarshalAs(UnmanagedType.U1)] bool border_inc); + + [LibraryImport(DllPath, EntryPoint = "tpcpatch_minus_tpcbox", StringMarshalling = StringMarshalling.Utf8)] + internal static partial IntPtr TpcpatchMinusTpcbox(IntPtr temp, IntPtr box, [MarshalAs(UnmanagedType.U1)] bool border_inc); + [LibraryImport(DllPath, EntryPoint = "tpcpatch_pcid", StringMarshalling = StringMarshalling.Utf8)] internal static partial uint TpcpatchPcid(IntPtr temp); @@ -12945,6 +13026,15 @@ private static partial class Native [LibraryImport(DllPath, EntryPoint = "always_ne_tpose_tpose", StringMarshalling = StringMarshalling.Utf8)] internal static partial int AlwaysNeTposeTpose(IntPtr temp1, IntPtr temp2); + [LibraryImport(DllPath, EntryPoint = "always_overlaps_stbox_tpose", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int AlwaysOverlapsStboxTpose(IntPtr box, IntPtr temp); + + [LibraryImport(DllPath, EntryPoint = "always_overlaps_tpose_stbox", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int AlwaysOverlapsTposeStbox(IntPtr temp, IntPtr box); + + [LibraryImport(DllPath, EntryPoint = "always_overlaps_tpose_tpose", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int AlwaysOverlapsTposeTpose(IntPtr temp1, IntPtr temp2); + [LibraryImport(DllPath, EntryPoint = "ever_eq_pose_tpose", StringMarshalling = StringMarshalling.Utf8)] internal static partial int EverEqPoseTpose(IntPtr pose, IntPtr temp); @@ -12963,6 +13053,15 @@ private static partial class Native [LibraryImport(DllPath, EntryPoint = "ever_ne_tpose_tpose", StringMarshalling = StringMarshalling.Utf8)] internal static partial int EverNeTposeTpose(IntPtr temp1, IntPtr temp2); + [LibraryImport(DllPath, EntryPoint = "ever_overlaps_stbox_tpose", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int EverOverlapsStboxTpose(IntPtr box, IntPtr temp); + + [LibraryImport(DllPath, EntryPoint = "ever_overlaps_tpose_stbox", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int EverOverlapsTposeStbox(IntPtr temp, IntPtr box); + + [LibraryImport(DllPath, EntryPoint = "ever_overlaps_tpose_tpose", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int EverOverlapsTposeTpose(IntPtr temp1, IntPtr temp2); + [LibraryImport(DllPath, EntryPoint = "teq_pose_tpose", StringMarshalling = StringMarshalling.Utf8)] internal static partial IntPtr TeqPoseTpose(IntPtr pose, IntPtr temp); @@ -14111,24 +14210,12 @@ private static partial class Native [LibraryImport(DllPath, EntryPoint = "trgeometry_to_tgeography", StringMarshalling = StringMarshalling.Utf8)] internal static partial IntPtr TrgeometryToTgeography(IntPtr temp); - [LibraryImport(DllPath, EntryPoint = "trgeometry_end_instant", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryEndInstant(IntPtr temp); - - [LibraryImport(DllPath, EntryPoint = "trgeometry_end_sequence", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryEndSequence(IntPtr temp); - [LibraryImport(DllPath, EntryPoint = "trgeometry_end_value", StringMarshalling = StringMarshalling.Utf8)] internal static partial IntPtr TrgeometryEndValue(IntPtr temp); [LibraryImport(DllPath, EntryPoint = "trgeometry_geom", StringMarshalling = StringMarshalling.Utf8)] internal static partial IntPtr TrgeometryGeom(IntPtr temp); - [LibraryImport(DllPath, EntryPoint = "trgeometry_instant_n", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryInstantN(IntPtr temp, int n); - - [LibraryImport(DllPath, EntryPoint = "trgeometry_instants", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryInstants(IntPtr temp, IntPtr count); - [LibraryImport(DllPath, EntryPoint = "trgeometry_points", StringMarshalling = StringMarshalling.Utf8)] internal static partial IntPtr TrgeometryPoints(IntPtr temp); @@ -14141,21 +14228,6 @@ private static partial class Native [LibraryImport(DllPath, EntryPoint = "trgeometry_roll", StringMarshalling = StringMarshalling.Utf8)] internal static partial IntPtr TrgeometryRoll(IntPtr temp); - [LibraryImport(DllPath, EntryPoint = "trgeometry_segments", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometrySegments(IntPtr temp, IntPtr count); - - [LibraryImport(DllPath, EntryPoint = "trgeometry_sequence_n", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometrySequenceN(IntPtr temp, int i); - - [LibraryImport(DllPath, EntryPoint = "trgeometry_sequences", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometrySequences(IntPtr temp, IntPtr count); - - [LibraryImport(DllPath, EntryPoint = "trgeometry_start_instant", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryStartInstant(IntPtr temp); - - [LibraryImport(DllPath, EntryPoint = "trgeometry_start_sequence", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryStartSequence(IntPtr temp); - [LibraryImport(DllPath, EntryPoint = "trgeometry_start_value", StringMarshalling = StringMarshalling.Utf8)] internal static partial IntPtr TrgeometryStartValue(IntPtr temp); @@ -14221,36 +14293,9 @@ private static partial class Native [LibraryImport(DllPath, EntryPoint = "trgeometry_twcentroid", StringMarshalling = StringMarshalling.Utf8)] internal static partial IntPtr TrgeometryTwcentroid(IntPtr temp); - [LibraryImport(DllPath, EntryPoint = "trgeometry_append_tinstant", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryAppendTinstant(IntPtr temp, IntPtr inst, int interp, double maxdist, IntPtr maxt, [MarshalAs(UnmanagedType.U1)] bool expand); - - [LibraryImport(DllPath, EntryPoint = "trgeometry_append_tsequence", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryAppendTsequence(IntPtr temp, IntPtr seq, [MarshalAs(UnmanagedType.U1)] bool expand); - - [LibraryImport(DllPath, EntryPoint = "trgeometry_delete_timestamptz", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryDeleteTimestamptz(IntPtr temp, long t, [MarshalAs(UnmanagedType.U1)] bool connect); - - [LibraryImport(DllPath, EntryPoint = "trgeometry_delete_tstzset", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryDeleteTstzset(IntPtr temp, IntPtr s, [MarshalAs(UnmanagedType.U1)] bool connect); - - [LibraryImport(DllPath, EntryPoint = "trgeometry_delete_tstzspan", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryDeleteTstzspan(IntPtr temp, IntPtr s, [MarshalAs(UnmanagedType.U1)] bool connect); - - [LibraryImport(DllPath, EntryPoint = "trgeometry_delete_tstzspanset", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryDeleteTstzspanset(IntPtr temp, IntPtr ss, [MarshalAs(UnmanagedType.U1)] bool connect); - [LibraryImport(DllPath, EntryPoint = "trgeometry_force2d", StringMarshalling = StringMarshalling.Utf8)] internal static partial IntPtr TrgeometryForce2d(IntPtr temp); - [LibraryImport(DllPath, EntryPoint = "trgeometry_merge", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryMerge(IntPtr temp1, IntPtr temp2); - - [LibraryImport(DllPath, EntryPoint = "trgeometry_merge_array", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryMergeArray(IntPtr temparr, int count); - - [LibraryImport(DllPath, EntryPoint = "trgeometry_round", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryRound(IntPtr temp, int maxdd); - [LibraryImport(DllPath, EntryPoint = "trgeometry_rotate", StringMarshalling = StringMarshalling.Utf8)] internal static partial IntPtr TrgeometryRotate(IntPtr temp, double angle, double x0, double y0); @@ -14263,9 +14308,6 @@ private static partial class Native [LibraryImport(DllPath, EntryPoint = "trgeometry_rotate_z", StringMarshalling = StringMarshalling.Utf8)] internal static partial IntPtr TrgeometryRotateZ(IntPtr temp, double angle); - [LibraryImport(DllPath, EntryPoint = "trgeometry_set_interp", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometrySetInterp(IntPtr temp, int interp); - [LibraryImport(DllPath, EntryPoint = "trgeometry_translate", StringMarshalling = StringMarshalling.Utf8)] internal static partial IntPtr TrgeometryTranslate(IntPtr temp, double deltax, double deltay, double deltaz); @@ -14278,27 +14320,6 @@ private static partial class Native [LibraryImport(DllPath, EntryPoint = "trgeometry_as_tsequenceset", StringMarshalling = StringMarshalling.Utf8)] internal static partial IntPtr TrgeometryAsTsequenceset(IntPtr temp, int interp); - [LibraryImport(DllPath, EntryPoint = "trgeometry_after_timestamptz", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryAfterTimestamptz(IntPtr temp, long t, [MarshalAs(UnmanagedType.U1)] bool strict); - - [LibraryImport(DllPath, EntryPoint = "trgeometry_before_timestamptz", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryBeforeTimestamptz(IntPtr temp, long t, [MarshalAs(UnmanagedType.U1)] bool strict); - - [LibraryImport(DllPath, EntryPoint = "trgeometry_restrict_values", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryRestrictValues(IntPtr temp, IntPtr s, [MarshalAs(UnmanagedType.U1)] bool atfunc); - - [LibraryImport(DllPath, EntryPoint = "trgeometry_restrict_timestamptz", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryRestrictTimestamptz(IntPtr temp, long t, [MarshalAs(UnmanagedType.U1)] bool atfunc); - - [LibraryImport(DllPath, EntryPoint = "trgeometry_restrict_tstzset", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryRestrictTstzset(IntPtr temp, IntPtr s, [MarshalAs(UnmanagedType.U1)] bool atfunc); - - [LibraryImport(DllPath, EntryPoint = "trgeometry_restrict_tstzspan", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryRestrictTstzspan(IntPtr temp, IntPtr s, [MarshalAs(UnmanagedType.U1)] bool atfunc); - - [LibraryImport(DllPath, EntryPoint = "trgeometry_restrict_tstzspanset", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryRestrictTstzspanset(IntPtr temp, IntPtr ss, [MarshalAs(UnmanagedType.U1)] bool atfunc); - [LibraryImport(DllPath, EntryPoint = "trgeometry_at_geom", StringMarshalling = StringMarshalling.Utf8)] internal static partial IntPtr TrgeometryAtGeom(IntPtr temp, IntPtr gs); @@ -14317,36 +14338,6 @@ private static partial class Native [LibraryImport(DllPath, EntryPoint = "trgeometry_minus_value", StringMarshalling = StringMarshalling.Utf8)] internal static partial IntPtr TrgeometryMinusValue(IntPtr temp, IntPtr pose); - [LibraryImport(DllPath, EntryPoint = "trgeometry_at_values", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryAtValues(IntPtr temp, IntPtr s); - - [LibraryImport(DllPath, EntryPoint = "trgeometry_minus_values", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryMinusValues(IntPtr temp, IntPtr s); - - [LibraryImport(DllPath, EntryPoint = "trgeometry_at_timestamptz", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryAtTimestamptz(IntPtr temp, long t); - - [LibraryImport(DllPath, EntryPoint = "trgeometry_minus_timestamptz", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryMinusTimestamptz(IntPtr temp, long t); - - [LibraryImport(DllPath, EntryPoint = "trgeometry_at_tstzset", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryAtTstzset(IntPtr temp, IntPtr s); - - [LibraryImport(DllPath, EntryPoint = "trgeometry_minus_tstzset", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryMinusTstzset(IntPtr temp, IntPtr s); - - [LibraryImport(DllPath, EntryPoint = "trgeometry_at_tstzspan", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryAtTstzspan(IntPtr temp, IntPtr s); - - [LibraryImport(DllPath, EntryPoint = "trgeometry_minus_tstzspan", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryMinusTstzspan(IntPtr temp, IntPtr s); - - [LibraryImport(DllPath, EntryPoint = "trgeometry_at_tstzspanset", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryAtTstzspanset(IntPtr temp, IntPtr ss); - - [LibraryImport(DllPath, EntryPoint = "trgeometry_minus_tstzspanset", StringMarshalling = StringMarshalling.Utf8)] - internal static partial IntPtr TrgeometryMinusTstzspanset(IntPtr temp, IntPtr ss); - [LibraryImport(DllPath, EntryPoint = "tdistance_trgeometry_geo", StringMarshalling = StringMarshalling.Utf8)] internal static partial IntPtr TdistanceTrgeometryGeo(IntPtr temp, IntPtr gs); @@ -14434,6 +14425,12 @@ private static partial class Native [LibraryImport(DllPath, EntryPoint = "always_ne_trgeometry_trgeometry", StringMarshalling = StringMarshalling.Utf8)] internal static partial int AlwaysNeTrgeometryTrgeometry(IntPtr temp1, IntPtr temp2); + [LibraryImport(DllPath, EntryPoint = "always_overlaps_stbox_trgeometry", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int AlwaysOverlapsStboxTrgeometry(IntPtr box, IntPtr temp); + + [LibraryImport(DllPath, EntryPoint = "always_overlaps_trgeometry_stbox", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int AlwaysOverlapsTrgeometryStbox(IntPtr temp, IntPtr box); + [LibraryImport(DllPath, EntryPoint = "ever_eq_geo_trgeometry", StringMarshalling = StringMarshalling.Utf8)] internal static partial int EverEqGeoTrgeometry(IntPtr gs, IntPtr temp); @@ -14452,6 +14449,12 @@ private static partial class Native [LibraryImport(DllPath, EntryPoint = "ever_ne_trgeometry_trgeometry", StringMarshalling = StringMarshalling.Utf8)] internal static partial int EverNeTrgeometryTrgeometry(IntPtr temp1, IntPtr temp2); + [LibraryImport(DllPath, EntryPoint = "ever_overlaps_stbox_trgeometry", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int EverOverlapsStboxTrgeometry(IntPtr box, IntPtr temp); + + [LibraryImport(DllPath, EntryPoint = "ever_overlaps_trgeometry_stbox", StringMarshalling = StringMarshalling.Utf8)] + internal static partial int EverOverlapsTrgeometryStbox(IntPtr temp, IntPtr box); + [LibraryImport(DllPath, EntryPoint = "teq_geo_trgeometry", StringMarshalling = StringMarshalling.Utf8)] internal static partial IntPtr TeqGeoTrgeometry(IntPtr gs, IntPtr temp); diff --git a/MEOS.NET/Functions/Meos.meos.g.cs b/MEOS.NET/Functions/Meos.meos.g.cs index 8fe891e..9ec9d94 100644 --- a/MEOS.NET/Functions/Meos.meos.g.cs +++ b/MEOS.NET/Functions/Meos.meos.g.cs @@ -4343,6 +4343,21 @@ public static int AlwaysNeTbigintBigint(IntPtr temp, long i) public static int AlwaysNeTtextText(IntPtr temp, IntPtr txt) => SafeExecution(() => Native.AlwaysNeTtextText(temp, txt)); + public static int AlwaysOverlapsTboxTnumber(IntPtr box, IntPtr temp) + => SafeExecution(() => Native.AlwaysOverlapsTboxTnumber(box, temp)); + + public static int AlwaysOverlapsTemporalTemporal(IntPtr temp1, IntPtr temp2) + => SafeExecution(() => Native.AlwaysOverlapsTemporalTemporal(temp1, temp2)); + + public static int AlwaysOverlapsTemporalTstzspan(IntPtr temp, IntPtr s) + => SafeExecution(() => Native.AlwaysOverlapsTemporalTstzspan(temp, s)); + + public static int AlwaysOverlapsTnumberTbox(IntPtr temp, IntPtr box) + => SafeExecution(() => Native.AlwaysOverlapsTnumberTbox(temp, box)); + + public static int AlwaysOverlapsTstzspanTemporal(IntPtr s, IntPtr temp) + => SafeExecution(() => Native.AlwaysOverlapsTstzspanTemporal(s, temp)); + public static int EverEqBoolTbool(bool b, IntPtr temp) => SafeExecution(() => Native.EverEqBoolTbool(b, temp)); @@ -4517,6 +4532,21 @@ public static int EverNeTbigintBigint(IntPtr temp, long i) public static int EverNeTtextText(IntPtr temp, IntPtr txt) => SafeExecution(() => Native.EverNeTtextText(temp, txt)); + public static int EverOverlapsTboxTnumber(IntPtr box, IntPtr temp) + => SafeExecution(() => Native.EverOverlapsTboxTnumber(box, temp)); + + public static int EverOverlapsTemporalTemporal(IntPtr temp1, IntPtr temp2) + => SafeExecution(() => Native.EverOverlapsTemporalTemporal(temp1, temp2)); + + public static int EverOverlapsTemporalTstzspan(IntPtr temp, IntPtr s) + => SafeExecution(() => Native.EverOverlapsTemporalTstzspan(temp, s)); + + public static int EverOverlapsTnumberTbox(IntPtr temp, IntPtr box) + => SafeExecution(() => Native.EverOverlapsTnumberTbox(temp, box)); + + public static int EverOverlapsTstzspanTemporal(IntPtr s, IntPtr temp) + => SafeExecution(() => Native.EverOverlapsTstzspanTemporal(s, temp)); + public static IntPtr TeqBigintTbigint(long i, IntPtr temp) => SafeExecution(() => Native.TeqBigintTbigint(i, temp)); @@ -5210,15 +5240,12 @@ public static IntPtr TdistanceTnumberTnumber(IntPtr temp1, IntPtr temp2) public static long NadBigintspanTbox(IntPtr s, IntPtr box) => SafeExecution(() => Native.NadBigintspanTbox(s, box)); - public static double NadTboxfloatTboxfloat(IntPtr box1, IntPtr box2) - => SafeExecution(() => Native.NadTboxfloatTboxfloat(box1, box2)); + public static double NadTboxTbox(IntPtr box1, IntPtr box2) + => SafeExecution(() => Native.NadTboxTbox(box1, box2)); public static double NadFloatspanTbox(IntPtr s, IntPtr box) => SafeExecution(() => Native.NadFloatspanTbox(s, box)); - public static int NadTboxintTboxint(IntPtr box1, IntPtr box2) - => SafeExecution(() => Native.NadTboxintTboxint(box1, box2)); - public static int NadIntspanTbox(IntPtr s, IntPtr box) => SafeExecution(() => Native.NadIntspanTbox(s, box)); @@ -5246,9 +5273,6 @@ public static long NadTbigintTbox(IntPtr temp, IntPtr box) public static long NadTbigintTbigint(IntPtr temp1, IntPtr temp2) => SafeExecution(() => Native.NadTbigintTbigint(temp1, temp2)); - public static long NadTboxbigintTboxbigint(IntPtr box1, IntPtr box2) - => SafeExecution(() => Native.NadTboxbigintTboxbigint(box1, box2)); - public static int NadTintInt(IntPtr temp, int i) => SafeExecution(() => Native.NadTintInt(temp, i)); diff --git a/MEOS.NET/Functions/Meos.meos_catalog.g.cs b/MEOS.NET/Functions/Meos.meos_catalog.g.cs index a20402f..dd2cec7 100644 --- a/MEOS.NET/Functions/Meos.meos_catalog.g.cs +++ b/MEOS.NET/Functions/Meos.meos_catalog.g.cs @@ -198,6 +198,9 @@ public static bool BasetypeVarlength(int type) public static short MeostypeLength(int type) => SafeExecution(() => Native.MeostypeLength(type)); + public static bool WkbHeaderStatesType(int type) + => SafeExecution(() => Native.WkbHeaderStatesType(type)); + public static bool TalphanumType(int type) => SafeExecution(() => Native.TalphanumType(type)); diff --git a/MEOS.NET/Functions/Meos.meos_cbuffer.g.cs b/MEOS.NET/Functions/Meos.meos_cbuffer.g.cs index 06831c1..d543386 100644 --- a/MEOS.NET/Functions/Meos.meos_cbuffer.g.cs +++ b/MEOS.NET/Functions/Meos.meos_cbuffer.g.cs @@ -495,6 +495,12 @@ public static int AlwaysNeTcbufferCbuffer(IntPtr temp, IntPtr cb) public static int AlwaysNeTcbufferTcbuffer(IntPtr temp1, IntPtr temp2) => SafeExecution(() => Native.AlwaysNeTcbufferTcbuffer(temp1, temp2)); + public static int AlwaysOverlapsStboxTcbuffer(IntPtr box, IntPtr temp) + => SafeExecution(() => Native.AlwaysOverlapsStboxTcbuffer(box, temp)); + + public static int AlwaysOverlapsTcbufferStbox(IntPtr temp, IntPtr box) + => SafeExecution(() => Native.AlwaysOverlapsTcbufferStbox(temp, box)); + public static int EverEqCbufferTcbuffer(IntPtr cb, IntPtr temp) => SafeExecution(() => Native.EverEqCbufferTcbuffer(cb, temp)); @@ -513,6 +519,12 @@ public static int EverNeTcbufferCbuffer(IntPtr temp, IntPtr cb) public static int EverNeTcbufferTcbuffer(IntPtr temp1, IntPtr temp2) => SafeExecution(() => Native.EverNeTcbufferTcbuffer(temp1, temp2)); + public static int EverOverlapsStboxTcbuffer(IntPtr box, IntPtr temp) + => SafeExecution(() => Native.EverOverlapsStboxTcbuffer(box, temp)); + + public static int EverOverlapsTcbufferStbox(IntPtr temp, IntPtr box) + => SafeExecution(() => Native.EverOverlapsTcbufferStbox(temp, box)); + public static IntPtr TeqCbufferTcbuffer(IntPtr cb, IntPtr temp) => SafeExecution(() => Native.TeqCbufferTcbuffer(cb, temp)); diff --git a/MEOS.NET/Functions/Meos.meos_geo.g.cs b/MEOS.NET/Functions/Meos.meos_geo.g.cs index e21112a..d62aaa4 100644 --- a/MEOS.NET/Functions/Meos.meos_geo.g.cs +++ b/MEOS.NET/Functions/Meos.meos_geo.g.cs @@ -1400,6 +1400,15 @@ public static int AlwaysNeTgeoGeo(IntPtr temp, IntPtr gs) public static int AlwaysNeTgeoTgeo(IntPtr temp1, IntPtr temp2) => SafeExecution(() => Native.AlwaysNeTgeoTgeo(temp1, temp2)); + public static int AlwaysOverlapsStboxTgeo(IntPtr box, IntPtr temp) + => SafeExecution(() => Native.AlwaysOverlapsStboxTgeo(box, temp)); + + public static int AlwaysOverlapsTgeoStbox(IntPtr temp, IntPtr box) + => SafeExecution(() => Native.AlwaysOverlapsTgeoStbox(temp, box)); + + public static int AlwaysOverlapsTgeoTgeo(IntPtr temp1, IntPtr temp2) + => SafeExecution(() => Native.AlwaysOverlapsTgeoTgeo(temp1, temp2)); + public static int EverEqGeoTgeo(IntPtr gs, IntPtr temp) => SafeExecution(() => Native.EverEqGeoTgeo(gs, temp)); @@ -1418,6 +1427,15 @@ public static int EverNeTgeoGeo(IntPtr temp, IntPtr gs) public static int EverNeTgeoTgeo(IntPtr temp1, IntPtr temp2) => SafeExecution(() => Native.EverNeTgeoTgeo(temp1, temp2)); + public static int EverOverlapsStboxTgeo(IntPtr box, IntPtr temp) + => SafeExecution(() => Native.EverOverlapsStboxTgeo(box, temp)); + + public static int EverOverlapsTgeoStbox(IntPtr temp, IntPtr box) + => SafeExecution(() => Native.EverOverlapsTgeoStbox(temp, box)); + + public static int EverOverlapsTgeoTgeo(IntPtr temp1, IntPtr temp2) + => SafeExecution(() => Native.EverOverlapsTgeoTgeo(temp1, temp2)); + public static IntPtr TeqGeoTgeo(IntPtr gs, IntPtr temp) => SafeExecution(() => Native.TeqGeoTgeo(gs, temp)); diff --git a/MEOS.NET/Functions/Meos.meos_internal.g.cs b/MEOS.NET/Functions/Meos.meos_internal.g.cs index 7f7d59a..646539d 100644 --- a/MEOS.NET/Functions/Meos.meos_internal.g.cs +++ b/MEOS.NET/Functions/Meos.meos_internal.g.cs @@ -1729,8 +1729,8 @@ public static IntPtr TnumberseqsetDeltaValue(IntPtr ss) public static IntPtr TdistanceTnumberNumber(IntPtr temp, ulong value) => SafeExecution(() => Native.TdistanceTnumberNumber(temp, value)); - public static ulong NadTboxTbox(IntPtr box1, IntPtr box2) - => SafeExecution(() => Native.NadTboxTbox(box1, box2)); + public static ulong NadTboxTboxIntl(IntPtr box1, IntPtr box2) + => SafeExecution(() => Native.NadTboxTboxIntl(box1, box2)); public static ulong NadTnumberNumber(IntPtr temp, ulong value) => SafeExecution(() => Native.NadTnumberNumber(temp, value)); diff --git a/MEOS.NET/Functions/Meos.meos_json.g.cs b/MEOS.NET/Functions/Meos.meos_json.g.cs index 220dad8..0ee845f 100644 --- a/MEOS.NET/Functions/Meos.meos_json.g.cs +++ b/MEOS.NET/Functions/Meos.meos_json.g.cs @@ -423,8 +423,8 @@ public static bool JsonbNe(IntPtr jb1, IntPtr jb2) public static int JsonbPathExists(IntPtr jb, IntPtr jp, IntPtr vars, bool silent, bool tz) => SafeExecution(() => Native.JsonbPathExists(jb, jp, vars, silent, tz)); - public static bool JsonbPathMatch(IntPtr jb, IntPtr jp, IntPtr vars, bool silent, bool tz) - => SafeExecution(() => Native.JsonbPathMatch(jb, jp, vars, silent, tz)); + public static int JsonbPathMatch(IntPtr jb, IntPtr jp, IntPtr vars, bool silent, bool tz) + => SafeExecution(() => Native.JsonbPathMatch(jb, jp, vars, silent, tz)); public static IntPtr[] JsonbPathQueryAll(IntPtr jb, IntPtr jp, IntPtr vars, bool silent, bool tz) { diff --git a/MEOS.NET/Functions/Meos.meos_npoint.g.cs b/MEOS.NET/Functions/Meos.meos_npoint.g.cs index a4de5f6..9ef1514 100644 --- a/MEOS.NET/Functions/Meos.meos_npoint.g.cs +++ b/MEOS.NET/Functions/Meos.meos_npoint.g.cs @@ -631,6 +631,12 @@ public static int AlwaysNeTnpointNpoint(IntPtr temp, IntPtr np) public static int AlwaysNeTnpointTnpoint(IntPtr temp1, IntPtr temp2) => SafeExecution(() => Native.AlwaysNeTnpointTnpoint(temp1, temp2)); + public static int AlwaysOverlapsStboxTnpoint(IntPtr box, IntPtr temp) + => SafeExecution(() => Native.AlwaysOverlapsStboxTnpoint(box, temp)); + + public static int AlwaysOverlapsTnpointStbox(IntPtr temp, IntPtr box) + => SafeExecution(() => Native.AlwaysOverlapsTnpointStbox(temp, box)); + public static int EverEqNpointTnpoint(IntPtr np, IntPtr temp) => SafeExecution(() => Native.EverEqNpointTnpoint(np, temp)); @@ -649,6 +655,12 @@ public static int EverNeTnpointNpoint(IntPtr temp, IntPtr np) public static int EverNeTnpointTnpoint(IntPtr temp1, IntPtr temp2) => SafeExecution(() => Native.EverNeTnpointTnpoint(temp1, temp2)); + public static int EverOverlapsStboxTnpoint(IntPtr box, IntPtr temp) + => SafeExecution(() => Native.EverOverlapsStboxTnpoint(box, temp)); + + public static int EverOverlapsTnpointStbox(IntPtr temp, IntPtr box) + => SafeExecution(() => Native.EverOverlapsTnpointStbox(temp, box)); + public static IntPtr TeqTnpointNpoint(IntPtr temp, IntPtr np) => SafeExecution(() => Native.TeqTnpointNpoint(temp, np)); diff --git a/MEOS.NET/Functions/Meos.meos_pointcloud.g.cs b/MEOS.NET/Functions/Meos.meos_pointcloud.g.cs index 7274c53..6418ad2 100644 --- a/MEOS.NET/Functions/Meos.meos_pointcloud.g.cs +++ b/MEOS.NET/Functions/Meos.meos_pointcloud.g.cs @@ -755,6 +755,12 @@ public static IntPtr TpcpointAtValue(IntPtr temp, IntPtr pt) public static IntPtr TpcpointMinusValue(IntPtr temp, IntPtr pt) => SafeExecution(() => Native.TpcpointMinusValue(temp, pt)); + public static IntPtr TpcpointAtTpcbox(IntPtr temp, IntPtr box, bool border_inc) + => SafeExecution(() => Native.TpcpointAtTpcbox(temp, box, border_inc)); + + public static IntPtr TpcpointMinusTpcbox(IntPtr temp, IntPtr box, bool border_inc) + => SafeExecution(() => Native.TpcpointMinusTpcbox(temp, box, border_inc)); + public static uint TpcpointPcid(IntPtr temp) => SafeExecution(() => Native.TpcpointPcid(temp)); @@ -833,6 +839,12 @@ public static IntPtr TpcpatchAtValue(IntPtr temp, IntPtr pa) public static IntPtr TpcpatchMinusValue(IntPtr temp, IntPtr pa) => SafeExecution(() => Native.TpcpatchMinusValue(temp, pa)); + public static IntPtr TpcpatchAtTpcbox(IntPtr temp, IntPtr box, bool border_inc) + => SafeExecution(() => Native.TpcpatchAtTpcbox(temp, box, border_inc)); + + public static IntPtr TpcpatchMinusTpcbox(IntPtr temp, IntPtr box, bool border_inc) + => SafeExecution(() => Native.TpcpatchMinusTpcbox(temp, box, border_inc)); + public static uint TpcpatchPcid(IntPtr temp) => SafeExecution(() => Native.TpcpatchPcid(temp)); diff --git a/MEOS.NET/Functions/Meos.meos_pose.g.cs b/MEOS.NET/Functions/Meos.meos_pose.g.cs index 4d49307..001ef55 100644 --- a/MEOS.NET/Functions/Meos.meos_pose.g.cs +++ b/MEOS.NET/Functions/Meos.meos_pose.g.cs @@ -700,6 +700,15 @@ public static int AlwaysNeTposePose(IntPtr temp, IntPtr pose) public static int AlwaysNeTposeTpose(IntPtr temp1, IntPtr temp2) => SafeExecution(() => Native.AlwaysNeTposeTpose(temp1, temp2)); + public static int AlwaysOverlapsStboxTpose(IntPtr box, IntPtr temp) + => SafeExecution(() => Native.AlwaysOverlapsStboxTpose(box, temp)); + + public static int AlwaysOverlapsTposeStbox(IntPtr temp, IntPtr box) + => SafeExecution(() => Native.AlwaysOverlapsTposeStbox(temp, box)); + + public static int AlwaysOverlapsTposeTpose(IntPtr temp1, IntPtr temp2) + => SafeExecution(() => Native.AlwaysOverlapsTposeTpose(temp1, temp2)); + public static int EverEqPoseTpose(IntPtr pose, IntPtr temp) => SafeExecution(() => Native.EverEqPoseTpose(pose, temp)); @@ -718,6 +727,15 @@ public static int EverNeTposePose(IntPtr temp, IntPtr pose) public static int EverNeTposeTpose(IntPtr temp1, IntPtr temp2) => SafeExecution(() => Native.EverNeTposeTpose(temp1, temp2)); + public static int EverOverlapsStboxTpose(IntPtr box, IntPtr temp) + => SafeExecution(() => Native.EverOverlapsStboxTpose(box, temp)); + + public static int EverOverlapsTposeStbox(IntPtr temp, IntPtr box) + => SafeExecution(() => Native.EverOverlapsTposeStbox(temp, box)); + + public static int EverOverlapsTposeTpose(IntPtr temp1, IntPtr temp2) + => SafeExecution(() => Native.EverOverlapsTposeTpose(temp1, temp2)); + public static IntPtr TeqPoseTpose(IntPtr pose, IntPtr temp) => SafeExecution(() => Native.TeqPoseTpose(pose, temp)); diff --git a/MEOS.NET/Functions/Meos.meos_rgeo.g.cs b/MEOS.NET/Functions/Meos.meos_rgeo.g.cs index 8ec732d..f792f2e 100644 --- a/MEOS.NET/Functions/Meos.meos_rgeo.g.cs +++ b/MEOS.NET/Functions/Meos.meos_rgeo.g.cs @@ -102,36 +102,12 @@ public static IntPtr TrgeometryToTgeometry(IntPtr temp) public static IntPtr TrgeometryToTgeography(IntPtr temp) => SafeExecution(() => Native.TrgeometryToTgeography(temp)); - public static IntPtr TrgeometryEndInstant(IntPtr temp) - => SafeExecution(() => Native.TrgeometryEndInstant(temp)); - - public static IntPtr TrgeometryEndSequence(IntPtr temp) - => SafeExecution(() => Native.TrgeometryEndSequence(temp)); - public static IntPtr TrgeometryEndValue(IntPtr temp) => SafeExecution(() => Native.TrgeometryEndValue(temp)); public static IntPtr TrgeometryGeom(IntPtr temp) => SafeExecution(() => Native.TrgeometryGeom(temp)); - public static IntPtr TrgeometryInstantN(IntPtr temp, int n) - => SafeExecution(() => Native.TrgeometryInstantN(temp, n)); - - public static IntPtr[] TrgeometryInstants(IntPtr temp) - { - IntPtr _cnt = Marshal.AllocHGlobal(sizeof(int)); - try - { - IntPtr _p = SafeExecution(() => Native.TrgeometryInstants(temp, _cnt)); - int _n = Marshal.ReadInt32(_cnt); - IntPtr[] _out = new IntPtr[_n]; - for (int _i = 0; _i < _n; _i++) - { _out[_i] = Marshal.ReadIntPtr(_p, _i * IntPtr.Size); } - return _out; - } - finally { Marshal.FreeHGlobal(_cnt); } - } - public static IntPtr TrgeometryPoints(IntPtr temp) => SafeExecution(() => Native.TrgeometryPoints(temp)); @@ -144,45 +120,6 @@ public static IntPtr TrgeometryPitch(IntPtr temp) public static IntPtr TrgeometryRoll(IntPtr temp) => SafeExecution(() => Native.TrgeometryRoll(temp)); - public static IntPtr[] TrgeometrySegments(IntPtr temp) - { - IntPtr _cnt = Marshal.AllocHGlobal(sizeof(int)); - try - { - IntPtr _p = SafeExecution(() => Native.TrgeometrySegments(temp, _cnt)); - int _n = Marshal.ReadInt32(_cnt); - IntPtr[] _out = new IntPtr[_n]; - for (int _i = 0; _i < _n; _i++) - { _out[_i] = Marshal.ReadIntPtr(_p, _i * IntPtr.Size); } - return _out; - } - finally { Marshal.FreeHGlobal(_cnt); } - } - - public static IntPtr TrgeometrySequenceN(IntPtr temp, int i) - => SafeExecution(() => Native.TrgeometrySequenceN(temp, i)); - - public static IntPtr[] TrgeometrySequences(IntPtr temp) - { - IntPtr _cnt = Marshal.AllocHGlobal(sizeof(int)); - try - { - IntPtr _p = SafeExecution(() => Native.TrgeometrySequences(temp, _cnt)); - int _n = Marshal.ReadInt32(_cnt); - IntPtr[] _out = new IntPtr[_n]; - for (int _i = 0; _i < _n; _i++) - { _out[_i] = Marshal.ReadIntPtr(_p, _i * IntPtr.Size); } - return _out; - } - finally { Marshal.FreeHGlobal(_cnt); } - } - - public static IntPtr TrgeometryStartInstant(IntPtr temp) - => SafeExecution(() => Native.TrgeometryStartInstant(temp)); - - public static IntPtr TrgeometryStartSequence(IntPtr temp) - => SafeExecution(() => Native.TrgeometryStartSequence(temp)); - public static IntPtr TrgeometryStartValue(IntPtr temp) => SafeExecution(() => Native.TrgeometryStartValue(temp)); @@ -351,36 +288,9 @@ public static IntPtr TrgeometrySpeed(IntPtr temp) public static IntPtr TrgeometryTwcentroid(IntPtr temp) => SafeExecution(() => Native.TrgeometryTwcentroid(temp)); - public static IntPtr TrgeometryAppendTinstant(IntPtr temp, IntPtr inst, int interp, double maxdist, IntPtr maxt, bool expand) - => SafeExecution(() => Native.TrgeometryAppendTinstant(temp, inst, interp, maxdist, maxt, expand)); - - public static IntPtr TrgeometryAppendTsequence(IntPtr temp, IntPtr seq, bool expand) - => SafeExecution(() => Native.TrgeometryAppendTsequence(temp, seq, expand)); - - public static IntPtr TrgeometryDeleteTimestamptz(IntPtr temp, long t, bool connect) - => SafeExecution(() => Native.TrgeometryDeleteTimestamptz(temp, t, connect)); - - public static IntPtr TrgeometryDeleteTstzset(IntPtr temp, IntPtr s, bool connect) - => SafeExecution(() => Native.TrgeometryDeleteTstzset(temp, s, connect)); - - public static IntPtr TrgeometryDeleteTstzspan(IntPtr temp, IntPtr s, bool connect) - => SafeExecution(() => Native.TrgeometryDeleteTstzspan(temp, s, connect)); - - public static IntPtr TrgeometryDeleteTstzspanset(IntPtr temp, IntPtr ss, bool connect) - => SafeExecution(() => Native.TrgeometryDeleteTstzspanset(temp, ss, connect)); - public static IntPtr TrgeometryForce2d(IntPtr temp) => SafeExecution(() => Native.TrgeometryForce2d(temp)); - public static IntPtr TrgeometryMerge(IntPtr temp1, IntPtr temp2) - => SafeExecution(() => Native.TrgeometryMerge(temp1, temp2)); - - public static IntPtr TrgeometryMergeArray(IntPtr temparr, int count) - => SafeExecution(() => Native.TrgeometryMergeArray(temparr, count)); - - public static IntPtr TrgeometryRound(IntPtr temp, int maxdd) - => SafeExecution(() => Native.TrgeometryRound(temp, maxdd)); - public static IntPtr TrgeometryRotate(IntPtr temp, double angle, double x0, double y0) => SafeExecution(() => Native.TrgeometryRotate(temp, angle, x0, y0)); @@ -393,9 +303,6 @@ public static IntPtr TrgeometryRotateY(IntPtr temp, double angle) public static IntPtr TrgeometryRotateZ(IntPtr temp, double angle) => SafeExecution(() => Native.TrgeometryRotateZ(temp, angle)); - public static IntPtr TrgeometrySetInterp(IntPtr temp, int interp) - => SafeExecution(() => Native.TrgeometrySetInterp(temp, interp)); - public static IntPtr TrgeometryTranslate(IntPtr temp, double deltax, double deltay, double deltaz) => SafeExecution(() => Native.TrgeometryTranslate(temp, deltax, deltay, deltaz)); @@ -408,27 +315,6 @@ public static IntPtr TrgeometryAsTsequence(IntPtr temp, int interp) public static IntPtr TrgeometryAsTsequenceset(IntPtr temp, int interp) => SafeExecution(() => Native.TrgeometryAsTsequenceset(temp, interp)); - public static IntPtr TrgeometryAfterTimestamptz(IntPtr temp, long t, bool strict) - => SafeExecution(() => Native.TrgeometryAfterTimestamptz(temp, t, strict)); - - public static IntPtr TrgeometryBeforeTimestamptz(IntPtr temp, long t, bool strict) - => SafeExecution(() => Native.TrgeometryBeforeTimestamptz(temp, t, strict)); - - public static IntPtr TrgeometryRestrictValues(IntPtr temp, IntPtr s, bool atfunc) - => SafeExecution(() => Native.TrgeometryRestrictValues(temp, s, atfunc)); - - public static IntPtr TrgeometryRestrictTimestamptz(IntPtr temp, long t, bool atfunc) - => SafeExecution(() => Native.TrgeometryRestrictTimestamptz(temp, t, atfunc)); - - public static IntPtr TrgeometryRestrictTstzset(IntPtr temp, IntPtr s, bool atfunc) - => SafeExecution(() => Native.TrgeometryRestrictTstzset(temp, s, atfunc)); - - public static IntPtr TrgeometryRestrictTstzspan(IntPtr temp, IntPtr s, bool atfunc) - => SafeExecution(() => Native.TrgeometryRestrictTstzspan(temp, s, atfunc)); - - public static IntPtr TrgeometryRestrictTstzspanset(IntPtr temp, IntPtr ss, bool atfunc) - => SafeExecution(() => Native.TrgeometryRestrictTstzspanset(temp, ss, atfunc)); - public static IntPtr TrgeometryAtGeom(IntPtr temp, IntPtr gs) => SafeExecution(() => Native.TrgeometryAtGeom(temp, gs)); @@ -447,36 +333,6 @@ public static IntPtr TrgeometryAtValue(IntPtr temp, IntPtr pose) public static IntPtr TrgeometryMinusValue(IntPtr temp, IntPtr pose) => SafeExecution(() => Native.TrgeometryMinusValue(temp, pose)); - public static IntPtr TrgeometryAtValues(IntPtr temp, IntPtr s) - => SafeExecution(() => Native.TrgeometryAtValues(temp, s)); - - public static IntPtr TrgeometryMinusValues(IntPtr temp, IntPtr s) - => SafeExecution(() => Native.TrgeometryMinusValues(temp, s)); - - public static IntPtr TrgeometryAtTimestamptz(IntPtr temp, long t) - => SafeExecution(() => Native.TrgeometryAtTimestamptz(temp, t)); - - public static IntPtr TrgeometryMinusTimestamptz(IntPtr temp, long t) - => SafeExecution(() => Native.TrgeometryMinusTimestamptz(temp, t)); - - public static IntPtr TrgeometryAtTstzset(IntPtr temp, IntPtr s) - => SafeExecution(() => Native.TrgeometryAtTstzset(temp, s)); - - public static IntPtr TrgeometryMinusTstzset(IntPtr temp, IntPtr s) - => SafeExecution(() => Native.TrgeometryMinusTstzset(temp, s)); - - public static IntPtr TrgeometryAtTstzspan(IntPtr temp, IntPtr s) - => SafeExecution(() => Native.TrgeometryAtTstzspan(temp, s)); - - public static IntPtr TrgeometryMinusTstzspan(IntPtr temp, IntPtr s) - => SafeExecution(() => Native.TrgeometryMinusTstzspan(temp, s)); - - public static IntPtr TrgeometryAtTstzspanset(IntPtr temp, IntPtr ss) - => SafeExecution(() => Native.TrgeometryAtTstzspanset(temp, ss)); - - public static IntPtr TrgeometryMinusTstzspanset(IntPtr temp, IntPtr ss) - => SafeExecution(() => Native.TrgeometryMinusTstzspanset(temp, ss)); - public static IntPtr TdistanceTrgeometryGeo(IntPtr temp, IntPtr gs) => SafeExecution(() => Native.TdistanceTrgeometryGeo(temp, gs)); @@ -564,6 +420,12 @@ public static int AlwaysNeTrgeometryGeo(IntPtr temp, IntPtr gs) public static int AlwaysNeTrgeometryTrgeometry(IntPtr temp1, IntPtr temp2) => SafeExecution(() => Native.AlwaysNeTrgeometryTrgeometry(temp1, temp2)); + public static int AlwaysOverlapsStboxTrgeometry(IntPtr box, IntPtr temp) + => SafeExecution(() => Native.AlwaysOverlapsStboxTrgeometry(box, temp)); + + public static int AlwaysOverlapsTrgeometryStbox(IntPtr temp, IntPtr box) + => SafeExecution(() => Native.AlwaysOverlapsTrgeometryStbox(temp, box)); + public static int EverEqGeoTrgeometry(IntPtr gs, IntPtr temp) => SafeExecution(() => Native.EverEqGeoTrgeometry(gs, temp)); @@ -582,6 +444,12 @@ public static int EverNeTrgeometryGeo(IntPtr temp, IntPtr gs) public static int EverNeTrgeometryTrgeometry(IntPtr temp1, IntPtr temp2) => SafeExecution(() => Native.EverNeTrgeometryTrgeometry(temp1, temp2)); + public static int EverOverlapsStboxTrgeometry(IntPtr box, IntPtr temp) + => SafeExecution(() => Native.EverOverlapsStboxTrgeometry(box, temp)); + + public static int EverOverlapsTrgeometryStbox(IntPtr temp, IntPtr box) + => SafeExecution(() => Native.EverOverlapsTrgeometryStbox(temp, box)); + public static IntPtr TeqGeoTrgeometry(IntPtr gs, IntPtr temp) => SafeExecution(() => Native.TeqGeoTrgeometry(gs, temp)); diff --git a/MEOS.NET/Types/Geo.g.cs b/MEOS.NET/Types/Geo.g.cs index b75b104..03f1c8d 100644 --- a/MEOS.NET/Types/Geo.g.cs +++ b/MEOS.NET/Types/Geo.g.cs @@ -234,20 +234,20 @@ public bool Same(Geo gs2) public Temporal? Tne(TGeo temp) => MEOSFactory.WrapTemporal(Meos.TneGeoTgeo(this.Ptr, temp.Ptr)); - public ulong ToH3indexCell(int resolution) - => Meos.GeoToH3indexCell(this.Ptr, resolution); + public H3Index ToH3indexCell(int resolution) + => new H3Index(Meos.GeoToH3indexCell(this.Ptr, resolution)); public Set? ToH3indexSet(int resolution) => MEOSFactory.WrapSet(Meos.GeoToH3indexSet(this.Ptr, resolution)); - public ulong ToQuadbinCell(int resolution) - => Meos.GeoToQuadbinCell(this.Ptr, resolution); + public Quadbin ToQuadbinCell(int resolution) + => new Quadbin(Meos.GeoToQuadbinCell(this.Ptr, resolution)); public Set? ToQuadbinSet(int resolution) => MEOSFactory.WrapSet(Meos.GeoToQuadbinSet(this.Ptr, resolution)); - public ulong ToS2cellCell(int level) - => Meos.GeoToS2cellCell(this.Ptr, level); + public S2Cell ToS2cellCell(int level) + => new S2Cell(Meos.GeoToS2cellCell(this.Ptr, level)); public Set? ToS2cellSet(int level) => MEOSFactory.WrapSet(Meos.GeoToS2cellSet(this.Ptr, level)); diff --git a/MEOS.NET/Types/Geography.g.cs b/MEOS.NET/Types/Geography.g.cs index a8c305a..2064e46 100644 --- a/MEOS.NET/Types/Geography.g.cs +++ b/MEOS.NET/Types/Geography.g.cs @@ -192,9 +192,6 @@ public bool Intersects(Geo gs2, bool use_spheroid) public static Geo? FromMFJSON(string geojson) => Geo.FromGeoJSON(geojson); - public static Geo? FromS2cellCell(ulong cell) - => MEOSFactory.WrapGeo(Meos.S2cellCellToGeog(cell)); - public static Geo? In(string str, int typmod) => MEOSFactory.WrapGeo(Meos.GeogIn(str, typmod)); diff --git a/MEOS.NET/Types/Geometry.g.cs b/MEOS.NET/Types/Geometry.g.cs index 36263f7..b73bf52 100644 --- a/MEOS.NET/Types/Geometry.g.cs +++ b/MEOS.NET/Types/Geometry.g.cs @@ -499,9 +499,6 @@ public bool Touches(Geo gs2) public static Geo? FromMFJSON(string geojson) => Geo.FromGeoJSON(geojson); - public static Geo? FromQuadbinCell(ulong cell) - => MEOSFactory.WrapGeo(Meos.QuadbinCellToGeom(cell)); - public static Geo? In(string str, int typmod) => MEOSFactory.WrapGeo(Meos.GeomIn(str, typmod)); diff --git a/MEOS.NET/Types/H3Index.g.cs b/MEOS.NET/Types/H3Index.g.cs new file mode 100644 index 0000000..8cffe15 --- /dev/null +++ b/MEOS.NET/Types/H3Index.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +using System.Runtime.InteropServices; + +using MEOS.NET.Enums; +using MEOS.NET.Functions; +using MEOS.NET.Structures; + +namespace MEOS.NET.Types +{ + /// A cell of the H3 grid, the base type of TH3Index and H3IndexSet. MEOS passes it by value, as a uint64; it is a class all the same because it reads and writes formats of its own (text, WKB, hex WKB), and every type a binding exposes has its readers and writers. + [System.CodeDom.Compiler.GeneratedCode("MEOS.NET.ObjectGen", "0.1.0")] + public readonly record struct H3Index + { + /// The H3Index MEOS passes this value as. + internal readonly ulong value; + + /// The H3Index MEOS passes as . + public H3Index(ulong value) => this.value = value; + + /// The H3Index MEOS passes this value as. + public static explicit operator ulong(H3Index self) => self.value; + + /// The H3Index MEOS passes as . + public static explicit operator H3Index(ulong value) => new H3Index(value); + + /// The text MEOS writes this value as. + public override string ToString() + => this.Out(); + + public string AsHexWKB(byte variant) + => Meos.H3indexAsHexwkb(this.value, variant); + + public string AsText() + => this.Out(); + + public byte[]? AsWKB(byte variant) + { + IntPtr _size_out = Marshal.AllocHGlobal(sizeof(long)); + try + { + IntPtr _bytes = Meos.H3indexAsWkb(this.value, variant, _size_out); + if (_bytes == IntPtr.Zero) + { + return null; + } + + byte[] _wkb = new byte[Marshal.ReadInt64(_size_out)]; + Marshal.Copy(_bytes, _wkb, 0, _wkb.Length); + return _wkb; + } + finally + { + Marshal.FreeHGlobal(_size_out); + } + } + + public double CellArea() + => Meos.H3indexCellArea(this.value); + + public Geo? CellToBoundary() + => MEOSFactory.WrapGeo(Meos.H3indexCellToBoundary(this.value)); + + public Set? CellToCover(int resolution) + => MEOSFactory.WrapSet(Meos.H3indexCellToCover(this.value, resolution)); + + public H3Index CellToParent(uint parent_resolution) + => new H3Index(Meos.H3indexCellToParent(this.value, parent_resolution)); + + public Geo? CellToPoint() + => MEOSFactory.WrapGeo(Meos.H3indexCellToPoint(this.value)); + + public int Cmp(H3Index b) + => Meos.H3indexCmp(this.value, b.value); + + public bool Eq(H3Index b) + => Meos.H3indexEq(this.value, b.value); + + public bool Ge(H3Index b) + => Meos.H3indexGe(this.value, b.value); + + public uint GetResolution() + => Meos.H3indexGetResolution(this.value); + + public bool Gt(H3Index b) + => Meos.H3indexGt(this.value, b.value); + + public uint Hash() + => Meos.H3indexHash(this.value); + + public ulong HashExtended(ulong seed) + => Meos.H3indexHashExtended(this.value, seed); + + public bool Le(H3Index b) + => Meos.H3indexLe(this.value, b.value); + + public bool Lt(H3Index b) + => Meos.H3indexLt(this.value, b.value); + + public bool Ne(H3Index b) + => Meos.H3indexNe(this.value, b.value); + + public string Out() + => Meos.H3indexOut(this.value); + + public STBox? TimestamptzToStbox(DateTime t) + => MEOSFactory.WrapSTBox(Meos.H3indexTimestamptzToStbox(this.value, MEOSConvert.ToTimestampTz(t))); + + public Set? ToSet() + => MEOSFactory.WrapSet(Meos.H3indexToSet(this.value)); + + public STBox? ToStbox() + => MEOSFactory.WrapSTBox(Meos.H3indexToStbox(this.value)); + + public STBox? TstzspanToStbox(Span s) + => MEOSFactory.WrapSTBox(Meos.H3indexTstzspanToStbox(this.value, s.Ptr)); + + public static H3Index FromHexWKB(string hexwkb) + => new H3Index(Meos.H3indexFromHexwkb(hexwkb)); + + public static H3Index FromText(string str) + => H3Index.In(str); + + public static H3Index FromWKB(byte[] wkb) + { + GCHandle _wkb = GCHandle.Alloc(wkb, GCHandleType.Pinned); + try + { + return new H3Index(Meos.H3indexFromWkb(_wkb.AddrOfPinnedObject(), (ulong) wkb.Length)); + } + finally + { + _wkb.Free(); + } + } + + public static H3Index In(string str) + => new H3Index(Meos.H3indexIn(str)); + + } +} diff --git a/MEOS.NET/Types/H3IndexSet.g.cs b/MEOS.NET/Types/H3IndexSet.g.cs index e90f151..b1890cc 100644 --- a/MEOS.NET/Types/H3IndexSet.g.cs +++ b/MEOS.NET/Types/H3IndexSet.g.cs @@ -21,8 +21,8 @@ public override string ToString() public bool Contained(H3IndexSet s2) => Meos.ContainedSetSet(this.Ptr, s2.Ptr); - public bool Contains(ulong cell) - => Meos.ContainsSetH3index(this.Ptr, cell); + public bool Contains(H3Index cell) + => Meos.ContainsSetH3index(this.Ptr, cell.value); public bool Contains(H3IndexSet s2) => Meos.ContainsSetSet(this.Ptr, s2.Ptr); @@ -30,8 +30,8 @@ public bool Contains(H3IndexSet s2) public Set? CoverCells(int resolution) => MEOSFactory.WrapSet(Meos.H3indexsetCoverCells(this.Ptr, resolution)); - public ulong EndValue() - => Meos.H3indexsetEndValue(this.Ptr); + public H3Index EndValue() + => new H3Index(Meos.H3indexsetEndValue(this.Ptr)); public int EverEq(TH3Index th3idx) => Meos.EverEqH3indexsetTh3index(this.Ptr, th3idx.Ptr); @@ -39,14 +39,14 @@ public int EverEq(TH3Index th3idx) public Set? GridDisk(int k) => MEOSFactory.WrapSet(Meos.H3indexsetGridDisk(this.Ptr, k)); - public Set? Intersection(ulong cell) - => MEOSFactory.WrapSet(Meos.IntersectionSetH3index(this.Ptr, cell)); + public Set? Intersection(H3Index cell) + => MEOSFactory.WrapSet(Meos.IntersectionSetH3index(this.Ptr, cell.value)); public Set? Intersection(H3IndexSet s2) => MEOSFactory.WrapSet(Meos.IntersectionSetSet(this.Ptr, s2.Ptr)); - public Set? Minus(ulong cell) - => MEOSFactory.WrapSet(Meos.MinusSetH3index(this.Ptr, cell)); + public Set? Minus(H3Index cell) + => MEOSFactory.WrapSet(Meos.MinusSetH3index(this.Ptr, cell.value)); public Set? Minus(H3IndexSet s2) => MEOSFactory.WrapSet(Meos.MinusSetSet(this.Ptr, s2.Ptr)); @@ -54,28 +54,28 @@ public int EverEq(TH3Index th3idx) public bool Overlaps(H3IndexSet s2) => Meos.OverlapsSetSet(this.Ptr, s2.Ptr); - public bool Rcontained(ulong cell) - => Meos.ContainedH3indexSet(cell, this.Ptr); + public bool Rcontained(H3Index cell) + => Meos.ContainedH3indexSet(cell.value, this.Ptr); - public Set? Rintersection(ulong cell) - => MEOSFactory.WrapSet(Meos.IntersectionH3indexSet(cell, this.Ptr)); + public Set? Rintersection(H3Index cell) + => MEOSFactory.WrapSet(Meos.IntersectionH3indexSet(cell.value, this.Ptr)); - public Set? Rminus(ulong cell) - => MEOSFactory.WrapSet(Meos.MinusH3indexSet(cell, this.Ptr)); + public Set? Rminus(H3Index cell) + => MEOSFactory.WrapSet(Meos.MinusH3indexSet(cell.value, this.Ptr)); - public Set? Runion(ulong cell) - => MEOSFactory.WrapSet(Meos.UnionH3indexSet(cell, this.Ptr)); + public Set? Runion(H3Index cell) + => MEOSFactory.WrapSet(Meos.UnionH3indexSet(cell.value, this.Ptr)); - public ulong StartValue() - => Meos.H3indexsetStartValue(this.Ptr); + public H3Index StartValue() + => new H3Index(Meos.H3indexsetStartValue(this.Ptr)); - public Set? Union(ulong cell) - => MEOSFactory.WrapSet(Meos.UnionSetH3index(this.Ptr, cell)); + public Set? Union(H3Index cell) + => MEOSFactory.WrapSet(Meos.UnionSetH3index(this.Ptr, cell.value)); public Set? Union(H3IndexSet s2) => MEOSFactory.WrapSet(Meos.UnionSetSet(this.Ptr, s2.Ptr)); - public ulong? ValueN(int n) + public H3Index? ValueN(int n) { IntPtr _result = Marshal.AllocHGlobal(8); try @@ -85,7 +85,7 @@ public ulong StartValue() return null; } - return Marshal.PtrToStructure(_result); + return new H3Index(Marshal.PtrToStructure(_result)); } finally { @@ -93,8 +93,8 @@ public ulong StartValue() } } - public ulong[] Values() - => Meos.H3indexsetValues(this.Ptr); + public H3Index[] Values() + => Array.ConvertAll(Meos.H3indexsetValues(this.Ptr), v => new H3Index(v)); public static Set? FromEWKB(byte[] wkb) => Set.FromWKB(wkb); @@ -102,9 +102,6 @@ public ulong[] Values() public static Set? FromEWKT(string str) => H3IndexSet.In(str); - public static Set? FromH3index(ulong cell) - => MEOSFactory.WrapSet(Meos.H3indexToSet(cell)); - public static Set? FromHexEWKB(string hexwkb) => Set.FromHexWKB(hexwkb); @@ -114,7 +111,7 @@ public ulong[] Values() public static Set? In(string str) => MEOSFactory.WrapSet(Meos.H3indexsetIn(str)); - public static Set? Make(ulong[] values) + public static Set? Make(H3Index[] values) { GCHandle _values = GCHandle.Alloc(values, GCHandleType.Pinned); try diff --git a/MEOS.NET/Types/Jsonb.g.cs b/MEOS.NET/Types/Jsonb.g.cs index d5513bf..9c1f204 100644 --- a/MEOS.NET/Types/Jsonb.g.cs +++ b/MEOS.NET/Types/Jsonb.g.cs @@ -251,7 +251,7 @@ public string Out() public int PathExists(JsonPath jp, Jsonb vars, bool silent, bool tz) => Meos.JsonbPathExists(this.Ptr, jp.Ptr, vars.Ptr, silent, tz); - public bool PathMatch(JsonPath jp, Jsonb vars, bool silent, bool tz) + public int PathMatch(JsonPath jp, Jsonb vars, bool silent, bool tz) => Meos.JsonbPathMatch(this.Ptr, jp.Ptr, vars.Ptr, silent, tz); public Jsonb?[] PathQueryAll(JsonPath jp, Jsonb vars, bool silent, bool tz) diff --git a/MEOS.NET/Types/Quadbin.g.cs b/MEOS.NET/Types/Quadbin.g.cs new file mode 100644 index 0000000..0850c7e --- /dev/null +++ b/MEOS.NET/Types/Quadbin.g.cs @@ -0,0 +1,180 @@ +#nullable enable + +using System.Runtime.InteropServices; + +using MEOS.NET.Enums; +using MEOS.NET.Functions; +using MEOS.NET.Structures; + +namespace MEOS.NET.Types +{ + /// A cell of the Quadbin grid, the base type of TQuadbin and QuadbinSet, passed by value as H3Index is. + [System.CodeDom.Compiler.GeneratedCode("MEOS.NET.ObjectGen", "0.1.0")] + public readonly record struct Quadbin + { + /// The Quadbin MEOS passes this value as. + internal readonly ulong value; + + /// The Quadbin MEOS passes as . + public Quadbin(ulong value) => this.value = value; + + /// The Quadbin MEOS passes this value as. + public static explicit operator ulong(Quadbin self) => self.value; + + /// The Quadbin MEOS passes as . + public static explicit operator Quadbin(ulong value) => new Quadbin(value); + + /// The text MEOS writes this value as. + public override string ToString() + => this.Out(); + + public string AsHexWKB(byte variant) + => Meos.QuadbinAsHexwkb(this.value, variant); + + public string AsText() + => this.Out(); + + public byte[]? AsWKB(byte variant) + { + IntPtr _size_out = Marshal.AllocHGlobal(sizeof(long)); + try + { + IntPtr _bytes = Meos.QuadbinAsWkb(this.value, variant, _size_out); + if (_bytes == IntPtr.Zero) + { + return null; + } + + byte[] _wkb = new byte[Marshal.ReadInt64(_size_out)]; + Marshal.Copy(_bytes, _wkb, 0, _wkb.Length); + return _wkb; + } + finally + { + Marshal.FreeHGlobal(_size_out); + } + } + + public double CellArea() + => Meos.QuadbinCellArea(this.value); + + public Quadbin CellSibling(string direction) + => new Quadbin(Meos.QuadbinCellSibling(this.value, direction)); + + public Quadbin[] CellToChildren(uint children_resolution) + => Array.ConvertAll(Meos.QuadbinCellToChildren(this.value, children_resolution), v => new Quadbin(v)); + + public Set? CellToChildrenSet(int children_resolution) + => MEOSFactory.WrapSet(Meos.QuadbinCellToChildrenSet(this.value, children_resolution)); + + public Set? CellToCover(int resolution) + => MEOSFactory.WrapSet(Meos.QuadbinCellToCover(this.value, resolution)); + + public Geo? CellToGeom() + => MEOSFactory.WrapGeo(Meos.QuadbinCellToGeom(this.value)); + + public Geo? CellToGeompoint() + => MEOSFactory.WrapGeo(Meos.QuadbinCellToGeompoint(this.value)); + + public Quadbin CellToParent(uint parent_resolution) + => new Quadbin(Meos.QuadbinCellToParent(this.value, parent_resolution)); + + public string CellToQuadkey() + => Meos.QuadbinCellToQuadkey(this.value); + + public int[] CellToTile() + => Meos.QuadbinCellToTile(this.value); + + public int Cmp(Quadbin b) + => Meos.QuadbinCmp(this.value, b.value); + + public bool Eq(Quadbin b) + => Meos.QuadbinEq(this.value, b.value); + + public bool Ge(Quadbin b) + => Meos.QuadbinGe(this.value, b.value); + + public uint GetResolution() + => Meos.QuadbinGetResolution(this.value); + + public Set? GridDisk(int k) + => MEOSFactory.WrapSet(Meos.QuadbinGridDisk(this.value, k)); + + public bool Gt(Quadbin b) + => Meos.QuadbinGt(this.value, b.value); + + public uint Hash() + => Meos.QuadbinHash(this.value); + + public ulong HashExtended(ulong seed) + => Meos.QuadbinHashExtended(this.value, seed); + + public string IndexToString() + => Meos.QuadbinIndexToString(this.value); + + public bool IsValidCell() + => Meos.QuadbinIsValidCell(this.value); + + public bool IsValidIndex() + => Meos.QuadbinIsValidIndex(this.value); + + public Quadbin[] KRing(int k) + => Array.ConvertAll(Meos.QuadbinKRing(this.value, k), v => new Quadbin(v)); + + public bool Le(Quadbin b) + => Meos.QuadbinLe(this.value, b.value); + + public bool Lt(Quadbin b) + => Meos.QuadbinLt(this.value, b.value); + + public bool Ne(Quadbin b) + => Meos.QuadbinNe(this.value, b.value); + + public string Out() + => Meos.QuadbinOut(this.value); + + public STBox? TimestamptzToStbox(DateTime t) + => MEOSFactory.WrapSTBox(Meos.QuadbinTimestamptzToStbox(this.value, MEOSConvert.ToTimestampTz(t))); + + public Set? ToSet() + => MEOSFactory.WrapSet(Meos.QuadbinToSet(this.value)); + + public STBox? ToStbox() + => MEOSFactory.WrapSTBox(Meos.QuadbinToStbox(this.value)); + + public STBox? TstzspanToStbox(Span s) + => MEOSFactory.WrapSTBox(Meos.QuadbinTstzspanToStbox(this.value, s.Ptr)); + + public static Quadbin FromHexWKB(string hexwkb) + => new Quadbin(Meos.QuadbinFromHexwkb(hexwkb)); + + public static Quadbin FromText(string str) + => Quadbin.In(str); + + public static Quadbin FromWKB(byte[] wkb) + { + GCHandle _wkb = GCHandle.Alloc(wkb, GCHandleType.Pinned); + try + { + return new Quadbin(Meos.QuadbinFromWkb(_wkb.AddrOfPinnedObject(), (ulong) wkb.Length)); + } + finally + { + _wkb.Free(); + } + } + + public static Quadbin In(string str) + => new Quadbin(Meos.QuadbinIn(str)); + + public static Quadbin PointToCell(double longitude, double latitude, uint resolution) + => new Quadbin(Meos.QuadbinPointToCell(longitude, latitude, resolution)); + + public static Quadbin StringToIndex(string str) + => new Quadbin(Meos.QuadbinStringToIndex(str)); + + public static Quadbin TileToCell(uint x, uint y, uint z) + => new Quadbin(Meos.QuadbinTileToCell(x, y, z)); + + } +} diff --git a/MEOS.NET/Types/QuadbinSet.g.cs b/MEOS.NET/Types/QuadbinSet.g.cs index 0e17560..3a4db0d 100644 --- a/MEOS.NET/Types/QuadbinSet.g.cs +++ b/MEOS.NET/Types/QuadbinSet.g.cs @@ -24,8 +24,8 @@ public override string ToString() public bool Contained(QuadbinSet s2) => Meos.ContainedSetSet(this.Ptr, s2.Ptr); - public bool Contains(ulong cell) - => Meos.ContainsSetQuadbin(this.Ptr, cell); + public bool Contains(Quadbin cell) + => Meos.ContainsSetQuadbin(this.Ptr, cell.value); public bool Contains(QuadbinSet s2) => Meos.ContainsSetSet(this.Ptr, s2.Ptr); @@ -33,8 +33,8 @@ public bool Contains(QuadbinSet s2) public Set? CoverCells(int resolution) => MEOSFactory.WrapSet(Meos.QuadbinsetCoverCells(this.Ptr, resolution)); - public ulong EndValue() - => Meos.QuadbinsetEndValue(this.Ptr); + public Quadbin EndValue() + => new Quadbin(Meos.QuadbinsetEndValue(this.Ptr)); public int EverEq(TQuadbin tqb) => Meos.EverEqQuadbinsetTquadbin(this.Ptr, tqb.Ptr); @@ -42,14 +42,14 @@ public int EverEq(TQuadbin tqb) public Set? GridDisk(int k) => MEOSFactory.WrapSet(Meos.QuadbinsetGridDisk(this.Ptr, k)); - public Set? Intersection(ulong cell) - => MEOSFactory.WrapSet(Meos.IntersectionSetQuadbin(this.Ptr, cell)); + public Set? Intersection(Quadbin cell) + => MEOSFactory.WrapSet(Meos.IntersectionSetQuadbin(this.Ptr, cell.value)); public Set? Intersection(QuadbinSet s2) => MEOSFactory.WrapSet(Meos.IntersectionSetSet(this.Ptr, s2.Ptr)); - public Set? Minus(ulong cell) - => MEOSFactory.WrapSet(Meos.MinusSetQuadbin(this.Ptr, cell)); + public Set? Minus(Quadbin cell) + => MEOSFactory.WrapSet(Meos.MinusSetQuadbin(this.Ptr, cell.value)); public Set? Minus(QuadbinSet s2) => MEOSFactory.WrapSet(Meos.MinusSetSet(this.Ptr, s2.Ptr)); @@ -57,31 +57,31 @@ public int EverEq(TQuadbin tqb) public bool Overlaps(QuadbinSet s2) => Meos.OverlapsSetSet(this.Ptr, s2.Ptr); - public bool Rcontained(ulong cell) - => Meos.ContainedQuadbinSet(cell, this.Ptr); + public bool Rcontained(Quadbin cell) + => Meos.ContainedQuadbinSet(cell.value, this.Ptr); - public Set? Rintersection(ulong cell) - => MEOSFactory.WrapSet(Meos.IntersectionQuadbinSet(cell, this.Ptr)); + public Set? Rintersection(Quadbin cell) + => MEOSFactory.WrapSet(Meos.IntersectionQuadbinSet(cell.value, this.Ptr)); - public Set? Rminus(ulong cell) - => MEOSFactory.WrapSet(Meos.MinusQuadbinSet(cell, this.Ptr)); + public Set? Rminus(Quadbin cell) + => MEOSFactory.WrapSet(Meos.MinusQuadbinSet(cell.value, this.Ptr)); - public Set? Runion(ulong cell) - => MEOSFactory.WrapSet(Meos.UnionQuadbinSet(cell, this.Ptr)); + public Set? Runion(Quadbin cell) + => MEOSFactory.WrapSet(Meos.UnionQuadbinSet(cell.value, this.Ptr)); - public ulong StartValue() - => Meos.QuadbinsetStartValue(this.Ptr); + public Quadbin StartValue() + => new Quadbin(Meos.QuadbinsetStartValue(this.Ptr)); public Set? UncompactCells(int resolution) => MEOSFactory.WrapSet(Meos.QuadbinsetUncompactCells(this.Ptr, resolution)); - public Set? Union(ulong cell) - => MEOSFactory.WrapSet(Meos.UnionSetQuadbin(this.Ptr, cell)); + public Set? Union(Quadbin cell) + => MEOSFactory.WrapSet(Meos.UnionSetQuadbin(this.Ptr, cell.value)); public Set? Union(QuadbinSet s2) => MEOSFactory.WrapSet(Meos.UnionSetSet(this.Ptr, s2.Ptr)); - public ulong? ValueN(int n) + public Quadbin? ValueN(int n) { IntPtr _result = Marshal.AllocHGlobal(8); try @@ -91,7 +91,7 @@ public ulong StartValue() return null; } - return Marshal.PtrToStructure(_result); + return new Quadbin(Marshal.PtrToStructure(_result)); } finally { @@ -99,8 +99,8 @@ public ulong StartValue() } } - public ulong[] Values() - => Meos.QuadbinsetValues(this.Ptr); + public Quadbin[] Values() + => Array.ConvertAll(Meos.QuadbinsetValues(this.Ptr), v => new Quadbin(v)); public static Set? FromEWKB(byte[] wkb) => Set.FromWKB(wkb); @@ -111,16 +111,13 @@ public ulong[] Values() public static Set? FromHexEWKB(string hexwkb) => Set.FromHexWKB(hexwkb); - public static Set? FromQuadbin(ulong cell) - => MEOSFactory.WrapSet(Meos.QuadbinToSet(cell)); - public static Set? FromText(string str) => QuadbinSet.In(str); public static Set? In(string str) => MEOSFactory.WrapSet(Meos.QuadbinsetIn(str)); - public static Set? Make(ulong[] values) + public static Set? Make(Quadbin[] values) { GCHandle _values = GCHandle.Alloc(values, GCHandleType.Pinned); try diff --git a/MEOS.NET/Types/RaQuet.g.cs b/MEOS.NET/Types/RaQuet.g.cs index 4f7432b..5298d69 100644 --- a/MEOS.NET/Types/RaQuet.g.cs +++ b/MEOS.NET/Types/RaQuet.g.cs @@ -14,16 +14,9 @@ public class RaQuet : Value { internal RaQuet(IntPtr ptr) : base(ptr) { } - /// The text MEOS writes this value as. - public override string ToString() - => this.Out(); - public string AsHexWKB(byte variant) => Meos.RaquetAsHexwkb(this.Ptr, variant); - public string AsText() - => this.Out(); - public byte[]? AsWKB(byte variant) { IntPtr _size_out = Marshal.AllocHGlobal(sizeof(long)); @@ -129,8 +122,8 @@ public string Out() } } - public ulong Quadbin() - => Meos.RaquetQuadbin(this.Ptr); + public Quadbin Quadbin() + => new Quadbin(Meos.RaquetQuadbin(this.Ptr)); public STBox? ToStbox() => MEOSFactory.WrapSTBox(Meos.RaquetToStbox(this.Ptr)); @@ -141,9 +134,6 @@ public int Width() public static RaQuet? FromHexWKB(string hexwkb) => MEOSFactory.WrapRaQuet(Meos.RaquetFromHexwkb(hexwkb)); - public static RaQuet? FromText(string str) - => RaQuet.In(str); - public static RaQuet? FromWKB(byte[] wkb) { GCHandle _wkb = GCHandle.Alloc(wkb, GCHandleType.Pinned); @@ -160,12 +150,12 @@ public int Width() public static RaQuet? In(string str) => MEOSFactory.WrapRaQuet(Meos.RaquetIn(str)); - public static RaQuet? Make(ulong quadbin, int width, int height, string pixtype, double nodata, bool has_nodata, byte[] pixels) + public static RaQuet? Make(Quadbin quadbin, int width, int height, string pixtype, double nodata, bool has_nodata, byte[] pixels) { GCHandle _pixels = GCHandle.Alloc(pixels, GCHandleType.Pinned); try { - return MEOSFactory.WrapRaQuet(Meos.RaquetMake(quadbin, width, height, Meos.MeospixtypeFromString(pixtype), nodata, has_nodata, _pixels.AddrOfPinnedObject(), (ulong) pixels.Length)); + return MEOSFactory.WrapRaQuet(Meos.RaquetMake(quadbin.value, width, height, Meos.MeospixtypeFromString(pixtype), nodata, has_nodata, _pixels.AddrOfPinnedObject(), (ulong) pixels.Length)); } finally { @@ -176,15 +166,15 @@ public int Width() public static ulong PixtypeSize(string pixtype) => Meos.RaquetPixtypeSize(Meos.MeospixtypeFromString(pixtype)); - public static RaQuet? Read(string path, ulong quadbin) - => MEOSFactory.WrapRaQuet(Meos.RaquetRead(path, quadbin)); + public static RaQuet? Read(string path, Quadbin quadbin) + => MEOSFactory.WrapRaQuet(Meos.RaquetRead(path, quadbin.value)); - public static RaQuet? ReadBytes(byte[] data, ulong quadbin) + public static RaQuet? ReadBytes(byte[] data, Quadbin quadbin) { GCHandle _data = GCHandle.Alloc(data, GCHandleType.Pinned); try { - return MEOSFactory.WrapRaQuet(Meos.RaquetReadBytes(_data.AddrOfPinnedObject(), (ulong) data.Length, quadbin)); + return MEOSFactory.WrapRaQuet(Meos.RaquetReadBytes(_data.AddrOfPinnedObject(), (ulong) data.Length, quadbin.value)); } finally { diff --git a/MEOS.NET/Types/Raster.g.cs b/MEOS.NET/Types/Raster.g.cs index c56302e..17b667e 100644 --- a/MEOS.NET/Types/Raster.g.cs +++ b/MEOS.NET/Types/Raster.g.cs @@ -330,12 +330,12 @@ public int Width() } } - public static Temporal? TileValueQuadbin(Temporal traj, byte[] pixels, int width, int height, ulong quadbin, string pixtype, double nodata, bool has_nodata) + public static Temporal? TileValueQuadbin(Temporal traj, byte[] pixels, int width, int height, Quadbin quadbin, string pixtype, double nodata, bool has_nodata) { GCHandle _pixels = GCHandle.Alloc(pixels, GCHandleType.Pinned); try { - return MEOSFactory.WrapTemporal(Meos.RasterTileValueQuadbin(traj.Ptr, _pixels.AddrOfPinnedObject(), (ulong) pixels.Length, width, height, quadbin, Meos.MeospixtypeFromString(pixtype), nodata, has_nodata)); + return MEOSFactory.WrapTemporal(Meos.RasterTileValueQuadbin(traj.Ptr, _pixels.AddrOfPinnedObject(), (ulong) pixels.Length, width, height, quadbin.value, Meos.MeospixtypeFromString(pixtype), nodata, has_nodata)); } finally { diff --git a/MEOS.NET/Types/S2Cell.g.cs b/MEOS.NET/Types/S2Cell.g.cs new file mode 100644 index 0000000..98127af --- /dev/null +++ b/MEOS.NET/Types/S2Cell.g.cs @@ -0,0 +1,186 @@ +#nullable enable + +using System.Runtime.InteropServices; + +using MEOS.NET.Enums; +using MEOS.NET.Functions; +using MEOS.NET.Structures; + +namespace MEOS.NET.Types +{ + /// A cell of the S2 grid, the base type of TS2Cell and S2CellSet, passed by value as H3Index is. + [System.CodeDom.Compiler.GeneratedCode("MEOS.NET.ObjectGen", "0.1.0")] + public readonly record struct S2Cell + { + /// The S2CellId MEOS passes this value as. + internal readonly ulong value; + + /// The S2Cell MEOS passes as . + public S2Cell(ulong value) => this.value = value; + + /// The S2CellId MEOS passes this value as. + public static explicit operator ulong(S2Cell self) => self.value; + + /// The S2Cell MEOS passes as . + public static explicit operator S2Cell(ulong value) => new S2Cell(value); + + /// The text MEOS writes this value as. + public override string ToString() + => this.Out(); + + public string AsHexWKB(byte variant) + => Meos.S2cellAsHexwkb(this.value, variant); + + public string AsText() + => this.Out(); + + public byte[]? AsWKB(byte variant) + { + IntPtr _size_out = Marshal.AllocHGlobal(sizeof(long)); + try + { + IntPtr _bytes = Meos.S2cellAsWkb(this.value, variant, _size_out); + if (_bytes == IntPtr.Zero) + { + return null; + } + + byte[] _wkb = new byte[Marshal.ReadInt64(_size_out)]; + Marshal.Copy(_bytes, _wkb, 0, _wkb.Length); + return _wkb; + } + finally + { + Marshal.FreeHGlobal(_size_out); + } + } + + public double CellArea() + => Meos.S2cellCellArea(this.value); + + public bool CellContains(S2Cell other) + => Meos.S2cellCellContains(this.value, other.value); + + public S2Cell CellToChild(uint level, uint position) + => new S2Cell(Meos.S2cellCellToChild(this.value, level, position)); + + public S2Cell[] CellToChildren(uint level) + => Array.ConvertAll(Meos.S2cellCellToChildren(this.value, level), v => new S2Cell(v)); + + public Set? CellToChildrenSet(int children_level) + => MEOSFactory.WrapSet(Meos.S2cellCellToChildrenSet(this.value, children_level)); + + public Set? CellToCover(int resolution) + => MEOSFactory.WrapSet(Meos.S2cellCellToCover(this.value, resolution)); + + public Geo? CellToGeog() + => MEOSFactory.WrapGeo(Meos.S2cellCellToGeog(this.value)); + + public Geo? CellToGeogpoint() + => MEOSFactory.WrapGeo(Meos.S2cellCellToGeogpoint(this.value)); + + public S2Cell CellToParent(uint level) + => new S2Cell(Meos.S2cellCellToParent(this.value, level)); + + public string CellToToken() + => Meos.S2cellCellToToken(this.value); + + public int Cmp(S2Cell b) + => Meos.S2cellCmp(this.value, b.value); + + public int CommonAncestorLevel(S2Cell b) + => Meos.S2cellCommonAncestorLevel(this.value, b.value); + + public double EdgeLength(uint edge) + => Meos.S2cellEdgeLength(this.value, edge); + + public S2Cell[] EdgeNeighbors() + => Array.ConvertAll(Meos.S2cellEdgeNeighbors(this.value), v => new S2Cell(v)); + + public Set? EdgeNeighborsSet() + => MEOSFactory.WrapSet(Meos.S2cellEdgeNeighborsSet(this.value)); + + public bool Eq(S2Cell b) + => Meos.S2cellEq(this.value, b.value); + + public bool Ge(S2Cell b) + => Meos.S2cellGe(this.value, b.value); + + public uint GetFace() + => Meos.S2cellGetFace(this.value); + + public uint GetResolution() + => Meos.S2cellGetResolution(this.value); + + public bool Gt(S2Cell b) + => Meos.S2cellGt(this.value, b.value); + + public uint Hash() + => Meos.S2cellHash(this.value); + + public ulong HashExtended(ulong seed) + => Meos.S2cellHashExtended(this.value, seed); + + public bool IsValidCell() + => Meos.S2cellIsValidCell(this.value); + + public bool Le(S2Cell b) + => Meos.S2cellLe(this.value, b.value); + + public bool Lt(S2Cell b) + => Meos.S2cellLt(this.value, b.value); + + public bool Ne(S2Cell b) + => Meos.S2cellNe(this.value, b.value); + + public string Out() + => Meos.S2cellOut(this.value); + + public S2Cell RangeMax() + => new S2Cell(Meos.S2cellRangeMax(this.value)); + + public S2Cell RangeMin() + => new S2Cell(Meos.S2cellRangeMin(this.value)); + + public STBox? TimestamptzToStbox(DateTime t) + => MEOSFactory.WrapSTBox(Meos.S2cellTimestamptzToStbox(this.value, MEOSConvert.ToTimestampTz(t))); + + public Set? ToSet() + => MEOSFactory.WrapSet(Meos.S2cellToSet(this.value)); + + public STBox? ToStbox() + => MEOSFactory.WrapSTBox(Meos.S2cellToStbox(this.value)); + + public STBox? TstzspanToStbox(Span s) + => MEOSFactory.WrapSTBox(Meos.S2cellTstzspanToStbox(this.value, s.Ptr)); + + public static S2Cell FromHexWKB(string hexwkb) + => new S2Cell(Meos.S2cellFromHexwkb(hexwkb)); + + public static S2Cell FromText(string str) + => S2Cell.In(str); + + public static S2Cell FromWKB(byte[] wkb) + { + GCHandle _wkb = GCHandle.Alloc(wkb, GCHandleType.Pinned); + try + { + return new S2Cell(Meos.S2cellFromWkb(_wkb.AddrOfPinnedObject(), (ulong) wkb.Length)); + } + finally + { + _wkb.Free(); + } + } + + public static S2Cell In(string str) + => new S2Cell(Meos.S2cellIn(str)); + + public static S2Cell PointToCell(double longitude, double latitude, uint level) + => new S2Cell(Meos.S2cellPointToCell(longitude, latitude, level)); + + public static S2Cell TokenToCell(string token) + => new S2Cell(Meos.S2cellTokenToCell(token)); + + } +} diff --git a/MEOS.NET/Types/S2CellSet.g.cs b/MEOS.NET/Types/S2CellSet.g.cs index 4cad03b..602864e 100644 --- a/MEOS.NET/Types/S2CellSet.g.cs +++ b/MEOS.NET/Types/S2CellSet.g.cs @@ -24,8 +24,8 @@ public override string ToString() public bool Contained(S2CellSet s2) => Meos.ContainedSetSet(this.Ptr, s2.Ptr); - public bool Contains(ulong cell) - => Meos.ContainsSetS2cell(this.Ptr, cell); + public bool Contains(S2Cell cell) + => Meos.ContainsSetS2cell(this.Ptr, cell.value); public bool Contains(S2CellSet s2) => Meos.ContainsSetSet(this.Ptr, s2.Ptr); @@ -33,20 +33,20 @@ public bool Contains(S2CellSet s2) public Set? CoverCells(int resolution) => MEOSFactory.WrapSet(Meos.S2cellsetCoverCells(this.Ptr, resolution)); - public ulong EndValue() - => Meos.S2cellsetEndValue(this.Ptr); + public S2Cell EndValue() + => new S2Cell(Meos.S2cellsetEndValue(this.Ptr)); public int EverEq(TS2Cell temp) => Meos.EverEqS2cellsetTs2cell(this.Ptr, temp.Ptr); - public Set? Intersection(ulong cell) - => MEOSFactory.WrapSet(Meos.IntersectionSetS2cell(this.Ptr, cell)); + public Set? Intersection(S2Cell cell) + => MEOSFactory.WrapSet(Meos.IntersectionSetS2cell(this.Ptr, cell.value)); public Set? Intersection(S2CellSet s2) => MEOSFactory.WrapSet(Meos.IntersectionSetSet(this.Ptr, s2.Ptr)); - public Set? Minus(ulong cell) - => MEOSFactory.WrapSet(Meos.MinusSetS2cell(this.Ptr, cell)); + public Set? Minus(S2Cell cell) + => MEOSFactory.WrapSet(Meos.MinusSetS2cell(this.Ptr, cell.value)); public Set? Minus(S2CellSet s2) => MEOSFactory.WrapSet(Meos.MinusSetSet(this.Ptr, s2.Ptr)); @@ -54,31 +54,31 @@ public int EverEq(TS2Cell temp) public bool Overlaps(S2CellSet s2) => Meos.OverlapsSetSet(this.Ptr, s2.Ptr); - public bool Rcontained(ulong cell) - => Meos.ContainedS2cellSet(cell, this.Ptr); + public bool Rcontained(S2Cell cell) + => Meos.ContainedS2cellSet(cell.value, this.Ptr); - public Set? Rintersection(ulong cell) - => MEOSFactory.WrapSet(Meos.IntersectionS2cellSet(cell, this.Ptr)); + public Set? Rintersection(S2Cell cell) + => MEOSFactory.WrapSet(Meos.IntersectionS2cellSet(cell.value, this.Ptr)); - public Set? Rminus(ulong cell) - => MEOSFactory.WrapSet(Meos.MinusS2cellSet(cell, this.Ptr)); + public Set? Rminus(S2Cell cell) + => MEOSFactory.WrapSet(Meos.MinusS2cellSet(cell.value, this.Ptr)); - public Set? Runion(ulong cell) - => MEOSFactory.WrapSet(Meos.UnionS2cellSet(cell, this.Ptr)); + public Set? Runion(S2Cell cell) + => MEOSFactory.WrapSet(Meos.UnionS2cellSet(cell.value, this.Ptr)); - public ulong StartValue() - => Meos.S2cellsetStartValue(this.Ptr); + public S2Cell StartValue() + => new S2Cell(Meos.S2cellsetStartValue(this.Ptr)); public Set? UncompactCells(int resolution) => MEOSFactory.WrapSet(Meos.S2cellsetUncompactCells(this.Ptr, resolution)); - public Set? Union(ulong cell) - => MEOSFactory.WrapSet(Meos.UnionSetS2cell(this.Ptr, cell)); + public Set? Union(S2Cell cell) + => MEOSFactory.WrapSet(Meos.UnionSetS2cell(this.Ptr, cell.value)); public Set? Union(S2CellSet s2) => MEOSFactory.WrapSet(Meos.UnionSetSet(this.Ptr, s2.Ptr)); - public ulong? ValueN(int n) + public S2Cell? ValueN(int n) { IntPtr _result = Marshal.AllocHGlobal(8); try @@ -88,7 +88,7 @@ public ulong StartValue() return null; } - return Marshal.PtrToStructure(_result); + return new S2Cell(Marshal.PtrToStructure(_result)); } finally { @@ -96,8 +96,8 @@ public ulong StartValue() } } - public ulong[] Values() - => Meos.S2cellsetValues(this.Ptr); + public S2Cell[] Values() + => Array.ConvertAll(Meos.S2cellsetValues(this.Ptr), v => new S2Cell(v)); public static Set? FromEWKB(byte[] wkb) => Set.FromWKB(wkb); @@ -108,16 +108,13 @@ public ulong[] Values() public static Set? FromHexEWKB(string hexwkb) => Set.FromHexWKB(hexwkb); - public static Set? FromS2cell(ulong cell) - => MEOSFactory.WrapSet(Meos.S2cellToSet(cell)); - public static Set? FromText(string str) => S2CellSet.In(str); public static Set? In(string str) => MEOSFactory.WrapSet(Meos.S2cellsetIn(str)); - public static Set? Make(ulong[] values) + public static Set? Make(S2Cell[] values) { GCHandle _values = GCHandle.Alloc(values, GCHandleType.Pinned); try diff --git a/MEOS.NET/Types/STBox.g.cs b/MEOS.NET/Types/STBox.g.cs index 398653e..688aa94 100644 --- a/MEOS.NET/Types/STBox.g.cs +++ b/MEOS.NET/Types/STBox.g.cs @@ -138,6 +138,33 @@ public bool After(TRGeometry temp) public bool After(TS2Cell temp) => Meos.AfterStboxTspatial(this.Ptr, temp.Ptr); + public int AlwaysOverlaps(TGeo temp) + => Meos.AlwaysOverlapsStboxTgeo(this.Ptr, temp.Ptr); + + public int AlwaysOverlaps(TCBuffer temp) + => Meos.AlwaysOverlapsStboxTcbuffer(this.Ptr, temp.Ptr); + + public int AlwaysOverlaps(TNPoint temp) + => Meos.AlwaysOverlapsStboxTnpoint(this.Ptr, temp.Ptr); + + public int AlwaysOverlaps(TPose temp) + => Meos.AlwaysOverlapsStboxTpose(this.Ptr, temp.Ptr); + + public int AlwaysOverlaps(TRGeometry temp) + => Meos.AlwaysOverlapsStboxTrgeometry(this.Ptr, temp.Ptr); + + public int AlwaysOverlaps(TGeogPoint temp) + => Meos.AlwaysOverlapsStboxTgeo(this.Ptr, temp.Ptr); + + public int AlwaysOverlaps(TGeography temp) + => Meos.AlwaysOverlapsStboxTgeo(this.Ptr, temp.Ptr); + + public int AlwaysOverlaps(TGeomPoint temp) + => Meos.AlwaysOverlapsStboxTgeo(this.Ptr, temp.Ptr); + + public int AlwaysOverlaps(TGeometry temp) + => Meos.AlwaysOverlapsStboxTgeo(this.Ptr, temp.Ptr); + public double Area(bool spheroid) => Meos.StboxArea(this.Ptr, spheroid); @@ -387,6 +414,33 @@ public bool Contains(TS2Cell temp) public bool Eq(STBox box2) => Meos.StboxEq(this.Ptr, box2.Ptr); + public int EverOverlaps(TGeo temp) + => Meos.EverOverlapsStboxTgeo(this.Ptr, temp.Ptr); + + public int EverOverlaps(TCBuffer temp) + => Meos.EverOverlapsStboxTcbuffer(this.Ptr, temp.Ptr); + + public int EverOverlaps(TNPoint temp) + => Meos.EverOverlapsStboxTnpoint(this.Ptr, temp.Ptr); + + public int EverOverlaps(TPose temp) + => Meos.EverOverlapsStboxTpose(this.Ptr, temp.Ptr); + + public int EverOverlaps(TRGeometry temp) + => Meos.EverOverlapsStboxTrgeometry(this.Ptr, temp.Ptr); + + public int EverOverlaps(TGeogPoint temp) + => Meos.EverOverlapsStboxTgeo(this.Ptr, temp.Ptr); + + public int EverOverlaps(TGeography temp) + => Meos.EverOverlapsStboxTgeo(this.Ptr, temp.Ptr); + + public int EverOverlaps(TGeomPoint temp) + => Meos.EverOverlapsStboxTgeo(this.Ptr, temp.Ptr); + + public int EverOverlaps(TGeometry temp) + => Meos.EverOverlapsStboxTgeo(this.Ptr, temp.Ptr); + public STBox? ExpandSpace(double d) => MEOSFactory.WrapSTBox(Meos.StboxExpandSpace(this.Ptr, d)); @@ -1267,39 +1321,12 @@ public double Volume() } } - public static STBox? FromH3index(ulong cell) - => MEOSFactory.WrapSTBox(Meos.H3indexToStbox(cell)); - - public static STBox? FromH3indexTimestamptz(ulong cell, DateTime t) - => MEOSFactory.WrapSTBox(Meos.H3indexTimestamptzToStbox(cell, MEOSConvert.ToTimestampTz(t))); - - public static STBox? FromH3indexTstzspan(ulong cell, Span s) - => MEOSFactory.WrapSTBox(Meos.H3indexTstzspanToStbox(cell, s.Ptr)); - public static STBox? FromHexEWKB(string hexwkb) => STBox.FromHexWKB(hexwkb); public static STBox? FromHexWKB(string hexwkb) => MEOSFactory.WrapSTBox(Meos.StboxFromHexwkb(hexwkb)); - public static STBox? FromQuadbin(ulong cell) - => MEOSFactory.WrapSTBox(Meos.QuadbinToStbox(cell)); - - public static STBox? FromQuadbinTimestamptz(ulong cell, DateTime t) - => MEOSFactory.WrapSTBox(Meos.QuadbinTimestamptzToStbox(cell, MEOSConvert.ToTimestampTz(t))); - - public static STBox? FromQuadbinTstzspan(ulong cell, Span s) - => MEOSFactory.WrapSTBox(Meos.QuadbinTstzspanToStbox(cell, s.Ptr)); - - public static STBox? FromS2cell(ulong cell) - => MEOSFactory.WrapSTBox(Meos.S2cellToStbox(cell)); - - public static STBox? FromS2cellTimestamptz(ulong cell, DateTime t) - => MEOSFactory.WrapSTBox(Meos.S2cellTimestamptzToStbox(cell, MEOSConvert.ToTimestampTz(t))); - - public static STBox? FromS2cellTstzspan(ulong cell, Span s) - => MEOSFactory.WrapSTBox(Meos.S2cellTstzspanToStbox(cell, s.Ptr)); - public static STBox? FromText(string str) => STBox.In(str); diff --git a/MEOS.NET/Types/TAlpha.g.cs b/MEOS.NET/Types/TAlpha.g.cs index be897d0..ce3c327 100644 --- a/MEOS.NET/Types/TAlpha.g.cs +++ b/MEOS.NET/Types/TAlpha.g.cs @@ -20,6 +20,9 @@ public bool Adjacent(TAlpha temp2) public bool After(TAlpha temp2) => Meos.AfterTemporalTemporal(this.Ptr, temp2.Ptr); + public int AlwaysOverlaps(TsTzSpan s) + => Meos.AlwaysOverlapsTemporalTstzspan(this.Ptr, s.Ptr); + public bool Before(TAlpha temp2) => Meos.BeforeTemporalTemporal(this.Ptr, temp2.Ptr); @@ -29,6 +32,9 @@ public bool Contained(TAlpha temp2) public bool Contains(TAlpha temp2) => Meos.ContainsTemporalTemporal(this.Ptr, temp2.Ptr); + public int EverOverlaps(TsTzSpan s) + => Meos.EverOverlapsTemporalTstzspan(this.Ptr, s.Ptr); + public bool Overafter(TAlpha temp2) => Meos.OverafterTemporalTemporal(this.Ptr, temp2.Ptr); diff --git a/MEOS.NET/Types/TBigInt.g.cs b/MEOS.NET/Types/TBigInt.g.cs index ed92486..9e0fb32 100644 --- a/MEOS.NET/Types/TBigInt.g.cs +++ b/MEOS.NET/Types/TBigInt.g.cs @@ -69,6 +69,9 @@ public int AlwaysNe(long i) public int AlwaysNe(TBigInt temp2) => Meos.AlwaysNeTemporalTemporal(this.Ptr, temp2.Ptr); + public int AlwaysOverlaps(TBigInt temp2) + => Meos.AlwaysOverlapsTemporalTemporal(this.Ptr, temp2.Ptr); + public string AsText(int maxdd) => this.Out(maxdd); @@ -135,6 +138,9 @@ public int EverNe(long i) public int EverNe(TBigInt temp2) => Meos.EverNeTemporalTemporal(this.Ptr, temp2.Ptr); + public int EverOverlaps(TBigInt temp2) + => Meos.EverOverlapsTemporalTemporal(this.Ptr, temp2.Ptr); + public bool Left(BigIntSpan s) => Meos.LeftTnumberNumspan(this.Ptr, s.Ptr); diff --git a/MEOS.NET/Types/TBool.g.cs b/MEOS.NET/Types/TBool.g.cs index 3e06c5f..f6442bc 100644 --- a/MEOS.NET/Types/TBool.g.cs +++ b/MEOS.NET/Types/TBool.g.cs @@ -36,6 +36,9 @@ public int AlwaysNe(bool b) public int AlwaysNe(TBool temp2) => Meos.AlwaysNeTemporalTemporal(this.Ptr, temp2.Ptr); + public int AlwaysOverlaps(TBool temp2) + => Meos.AlwaysOverlapsTemporalTemporal(this.Ptr, temp2.Ptr); + public string AsText(int maxdd) => this.Out(maxdd); @@ -66,6 +69,9 @@ public int EverNe(bool b) public int EverNe(TBool temp2) => Meos.EverNeTemporalTemporal(this.Ptr, temp2.Ptr); + public int EverOverlaps(TBool temp2) + => Meos.EverOverlapsTemporalTemporal(this.Ptr, temp2.Ptr); + public Temporal? MinusValue(bool b) => MEOSFactory.WrapTemporal(Meos.TboolMinusValue(this.Ptr, b)); diff --git a/MEOS.NET/Types/TBox.g.cs b/MEOS.NET/Types/TBox.g.cs index d325e78..f9045ba 100644 --- a/MEOS.NET/Types/TBox.g.cs +++ b/MEOS.NET/Types/TBox.g.cs @@ -66,6 +66,18 @@ public bool After(TFloat temp) public bool After(TInt temp) => Meos.AfterTboxTnumber(this.Ptr, temp.Ptr); + public int AlwaysOverlaps(TNumber temp) + => Meos.AlwaysOverlapsTboxTnumber(this.Ptr, temp.Ptr); + + public int AlwaysOverlaps(TBigInt temp) + => Meos.AlwaysOverlapsTboxTnumber(this.Ptr, temp.Ptr); + + public int AlwaysOverlaps(TFloat temp) + => Meos.AlwaysOverlapsTboxTnumber(this.Ptr, temp.Ptr); + + public int AlwaysOverlaps(TInt temp) + => Meos.AlwaysOverlapsTboxTnumber(this.Ptr, temp.Ptr); + public string AsHexWKB(byte variant) => Meos.TboxAsHexwkb(this.Ptr, variant); @@ -180,6 +192,18 @@ public bool Contains(TInt temp) public bool Eq(TBox box2) => Meos.TboxEq(this.Ptr, box2.Ptr); + public int EverOverlaps(TNumber temp) + => Meos.EverOverlapsTboxTnumber(this.Ptr, temp.Ptr); + + public int EverOverlaps(TBigInt temp) + => Meos.EverOverlapsTboxTnumber(this.Ptr, temp.Ptr); + + public int EverOverlaps(TFloat temp) + => Meos.EverOverlapsTboxTnumber(this.Ptr, temp.Ptr); + + public int EverOverlaps(TInt temp) + => Meos.EverOverlapsTboxTnumber(this.Ptr, temp.Ptr); + public TBox? ExpandBigint(long i) => MEOSFactory.WrapTBox(Meos.TbigintboxExpand(this.Ptr, i)); @@ -257,6 +281,9 @@ public bool Left(TInt temp) public bool Lt(TBox box2) => Meos.TboxLt(this.Ptr, box2.Ptr); + public double Nad(TBox box2) + => Meos.NadTboxTbox(this.Ptr, box2.Ptr); + public bool Ne(TBox box2) => Meos.TboxNe(this.Ptr, box2.Ptr); diff --git a/MEOS.NET/Types/TCBuffer.g.cs b/MEOS.NET/Types/TCBuffer.g.cs index 757cd56..9ad7349 100644 --- a/MEOS.NET/Types/TCBuffer.g.cs +++ b/MEOS.NET/Types/TCBuffer.g.cs @@ -84,6 +84,9 @@ public int AlwaysNe(CBuffer cb) public int AlwaysNe(TCBuffer temp2) => Meos.AlwaysNeTcbufferTcbuffer(this.Ptr, temp2.Ptr); + public int AlwaysOverlaps(STBox box) + => Meos.AlwaysOverlapsTcbufferStbox(this.Ptr, box.Ptr); + public Temporal? AtCbuffer(CBuffer cb) => MEOSFactory.WrapTemporal(Meos.TcbufferAtCbuffer(this.Ptr, cb.Ptr)); @@ -186,6 +189,9 @@ public int EverNe(CBuffer cb) public int EverNe(TCBuffer temp2) => Meos.EverNeTcbufferTcbuffer(this.Ptr, temp2.Ptr); + public int EverOverlaps(STBox box) + => Meos.EverOverlapsTcbufferStbox(this.Ptr, box.Ptr); + public Temporal? Expand(double dist) => MEOSFactory.WrapTemporal(Meos.TcbufferExpand(this.Ptr, dist)); diff --git a/MEOS.NET/Types/TFloat.g.cs b/MEOS.NET/Types/TFloat.g.cs index 84a5bb2..80427b7 100644 --- a/MEOS.NET/Types/TFloat.g.cs +++ b/MEOS.NET/Types/TFloat.g.cs @@ -69,6 +69,9 @@ public int AlwaysNe(double d) public int AlwaysNe(TFloat temp2) => Meos.AlwaysNeTemporalTemporal(this.Ptr, temp2.Ptr); + public int AlwaysOverlaps(TFloat temp2) + => Meos.AlwaysOverlapsTemporalTemporal(this.Ptr, temp2.Ptr); + public string AsText(int maxdd) => this.Out(maxdd); @@ -144,6 +147,9 @@ public int EverNe(double d) public int EverNe(TFloat temp2) => Meos.EverNeTemporalTemporal(this.Ptr, temp2.Ptr); + public int EverOverlaps(TFloat temp2) + => Meos.EverOverlapsTemporalTemporal(this.Ptr, temp2.Ptr); + public Temporal? Exp() => MEOSFactory.WrapTemporal(Meos.TfloatExp(this.Ptr)); diff --git a/MEOS.NET/Types/TGeo.g.cs b/MEOS.NET/Types/TGeo.g.cs index 7aaf02e..4d991a6 100644 --- a/MEOS.NET/Types/TGeo.g.cs +++ b/MEOS.NET/Types/TGeo.g.cs @@ -47,6 +47,12 @@ public int AlwaysNe(Geo gs) public int AlwaysNe(TGeo temp2) => Meos.AlwaysNeTgeoTgeo(this.Ptr, temp2.Ptr); + public int AlwaysOverlaps(STBox box) + => Meos.AlwaysOverlapsTgeoStbox(this.Ptr, box.Ptr); + + public int AlwaysOverlaps(TGeo temp2) + => Meos.AlwaysOverlapsTgeoTgeo(this.Ptr, temp2.Ptr); + public Temporal? AtGeom(Geo gs) => MEOSFactory.WrapTemporal(Meos.TgeoAtGeom(this.Ptr, gs.Ptr)); @@ -95,6 +101,12 @@ public int EverNe(Geo gs) public int EverNe(TGeo temp2) => Meos.EverNeTgeoTgeo(this.Ptr, temp2.Ptr); + public int EverOverlaps(STBox box) + => Meos.EverOverlapsTgeoStbox(this.Ptr, box.Ptr); + + public int EverOverlaps(TGeo temp2) + => Meos.EverOverlapsTgeoTgeo(this.Ptr, temp2.Ptr); + public Temporal? Force2d() => MEOSFactory.WrapTemporal(Meos.TgeoForce2d(this.Ptr)); diff --git a/MEOS.NET/Types/TGeogPoint.g.cs b/MEOS.NET/Types/TGeogPoint.g.cs index ce288a7..df7a8ed 100644 --- a/MEOS.NET/Types/TGeogPoint.g.cs +++ b/MEOS.NET/Types/TGeogPoint.g.cs @@ -54,6 +54,9 @@ public int AlwaysNe(Geography gs) public int AlwaysNe(TGeogPoint temp2) => Meos.AlwaysNeTgeoTgeo(this.Ptr, temp2.Ptr); + public int AlwaysOverlaps(TGeogPoint temp2) + => Meos.AlwaysOverlapsTgeoTgeo(this.Ptr, temp2.Ptr); + public Temporal? Bearing(Geography gs) => MEOSFactory.WrapTemporal(Meos.BearingTpointPoint(this.Ptr, gs.Ptr)); @@ -96,14 +99,17 @@ public int EverNe(Geography gs) public int EverNe(TGeogPoint temp2) => Meos.EverNeTgeoTgeo(this.Ptr, temp2.Ptr); + public int EverOverlaps(TGeogPoint temp2) + => Meos.EverOverlapsTgeoTgeo(this.Ptr, temp2.Ptr); + public Temporal? GreatCircleDistance(Temporal b) => MEOSFactory.WrapTemporal(Meos.TgeogpointGreatCircleDistance(this.Ptr, b.Ptr)); - public (Temporal?[], ulong[]) H3indexSplit(int resolution, bool border_inc) + public (Temporal?[], H3Index[]) H3indexSplit(int resolution, bool border_inc) { var _answered = Meos.TgeogpointH3indexSplit(this.Ptr, resolution, border_inc); - return (MEOSFactory.WrapTemporalArray(_answered.Item1), _answered.Item2); + return (MEOSFactory.WrapTemporalArray(_answered.Item1), Array.ConvertAll(_answered.Item2, v => new H3Index(v))); } public double Nad(Geography gs, bool spheroid) @@ -127,18 +133,18 @@ public bool Overbefore(TGeogPoint temp2) public bool Overlaps(TGeogPoint temp2) => Meos.OverlapsTspatialTspatial(this.Ptr, temp2.Ptr); - public (Temporal?[], ulong[]) QuadbinSplit(int resolution, bool border_inc) + public (Temporal?[], Quadbin[]) QuadbinSplit(int resolution, bool border_inc) { var _answered = Meos.TgeogpointQuadbinSplit(this.Ptr, resolution, border_inc); - return (MEOSFactory.WrapTemporalArray(_answered.Item1), _answered.Item2); + return (MEOSFactory.WrapTemporalArray(_answered.Item1), Array.ConvertAll(_answered.Item2, v => new Quadbin(v))); } - public (Temporal?[], ulong[]) S2cellSplit(int level, bool border_inc) + public (Temporal?[], S2Cell[]) S2cellSplit(int level, bool border_inc) { var _answered = Meos.TgeogpointS2cellSplit(this.Ptr, level, border_inc); - return (MEOSFactory.WrapTemporalArray(_answered.Item1), _answered.Item2); + return (MEOSFactory.WrapTemporalArray(_answered.Item1), Array.ConvertAll(_answered.Item2, v => new S2Cell(v))); } public bool Same(TGeogPoint temp2) diff --git a/MEOS.NET/Types/TGeography.g.cs b/MEOS.NET/Types/TGeography.g.cs index 2627861..da1a23e 100644 --- a/MEOS.NET/Types/TGeography.g.cs +++ b/MEOS.NET/Types/TGeography.g.cs @@ -54,6 +54,9 @@ public int AlwaysNe(Geography gs) public int AlwaysNe(TGeography temp2) => Meos.AlwaysNeTgeoTgeo(this.Ptr, temp2.Ptr); + public int AlwaysOverlaps(TGeography temp2) + => Meos.AlwaysOverlapsTgeoTgeo(this.Ptr, temp2.Ptr); + public bool Before(TGeography temp2) => Meos.BeforeTspatialTspatial(this.Ptr, temp2.Ptr); @@ -93,6 +96,9 @@ public int EverNe(Geography gs) public int EverNe(TGeography temp2) => Meos.EverNeTgeoTgeo(this.Ptr, temp2.Ptr); + public int EverOverlaps(TGeography temp2) + => Meos.EverOverlapsTgeoTgeo(this.Ptr, temp2.Ptr); + public double Nad(Geography gs, bool spheroid) => Meos.NadTgeoGeo(this.Ptr, gs.Ptr, spheroid); diff --git a/MEOS.NET/Types/TGeomPoint.g.cs b/MEOS.NET/Types/TGeomPoint.g.cs index 1c3ca8b..300d147 100644 --- a/MEOS.NET/Types/TGeomPoint.g.cs +++ b/MEOS.NET/Types/TGeomPoint.g.cs @@ -57,6 +57,9 @@ public int AlwaysNe(Geometry gs) public int AlwaysNe(TGeomPoint temp2) => Meos.AlwaysNeTgeoTgeo(this.Ptr, temp2.Ptr); + public int AlwaysOverlaps(TGeomPoint temp2) + => Meos.AlwaysOverlapsTgeoTgeo(this.Ptr, temp2.Ptr); + public int Atouches(Geometry gs) => Meos.AtouchesTpointGeo(this.Ptr, gs.Ptr); @@ -114,14 +117,17 @@ public int EverNe(Geometry gs) public int EverNe(TGeomPoint temp2) => Meos.EverNeTgeoTgeo(this.Ptr, temp2.Ptr); + public int EverOverlaps(TGeomPoint temp2) + => Meos.EverOverlapsTgeoTgeo(this.Ptr, temp2.Ptr); + public bool Front(TGeomPoint temp2) => Meos.FrontTspatialTspatial(this.Ptr, temp2.Ptr); - public (Temporal?[], ulong[]) H3indexSplit(int resolution, bool border_inc) + public (Temporal?[], H3Index[]) H3indexSplit(int resolution, bool border_inc) { var _answered = Meos.TgeompointH3indexSplit(this.Ptr, resolution, border_inc); - return (MEOSFactory.WrapTemporalArray(_answered.Item1), _answered.Item2); + return (MEOSFactory.WrapTemporalArray(_answered.Item1), Array.ConvertAll(_answered.Item2, v => new H3Index(v))); } public bool Left(TGeomPoint temp2) @@ -166,21 +172,21 @@ public bool Overleft(TGeomPoint temp2) public bool Overright(TGeomPoint temp2) => Meos.OverrightTspatialTspatial(this.Ptr, temp2.Ptr); - public (Temporal?[], ulong[]) QuadbinSplit(int resolution, bool border_inc) + public (Temporal?[], Quadbin[]) QuadbinSplit(int resolution, bool border_inc) { var _answered = Meos.TgeompointQuadbinSplit(this.Ptr, resolution, border_inc); - return (MEOSFactory.WrapTemporalArray(_answered.Item1), _answered.Item2); + return (MEOSFactory.WrapTemporalArray(_answered.Item1), Array.ConvertAll(_answered.Item2, v => new Quadbin(v))); } public bool Right(TGeomPoint temp2) => Meos.RightTspatialTspatial(this.Ptr, temp2.Ptr); - public (Temporal?[], ulong[]) S2cellSplit(int level, bool border_inc) + public (Temporal?[], S2Cell[]) S2cellSplit(int level, bool border_inc) { var _answered = Meos.TgeompointS2cellSplit(this.Ptr, level, border_inc); - return (MEOSFactory.WrapTemporalArray(_answered.Item1), _answered.Item2); + return (MEOSFactory.WrapTemporalArray(_answered.Item1), Array.ConvertAll(_answered.Item2, v => new S2Cell(v))); } public bool Same(TGeomPoint temp2) diff --git a/MEOS.NET/Types/TGeometry.g.cs b/MEOS.NET/Types/TGeometry.g.cs index b8a2355..ff81e43 100644 --- a/MEOS.NET/Types/TGeometry.g.cs +++ b/MEOS.NET/Types/TGeometry.g.cs @@ -69,6 +69,9 @@ public int AlwaysNe(Geometry gs) public int AlwaysNe(TGeometry temp2) => Meos.AlwaysNeTgeoTgeo(this.Ptr, temp2.Ptr); + public int AlwaysOverlaps(TGeometry temp2) + => Meos.AlwaysOverlapsTgeoTgeo(this.Ptr, temp2.Ptr); + public int Atouches(Geometry gs) => Meos.AtouchesTgeoGeo(this.Ptr, gs.Ptr); @@ -138,6 +141,9 @@ public int EverNe(Geometry gs) public int EverNe(TGeometry temp2) => Meos.EverNeTgeoTgeo(this.Ptr, temp2.Ptr); + public int EverOverlaps(TGeometry temp2) + => Meos.EverOverlapsTgeoTgeo(this.Ptr, temp2.Ptr); + public bool Front(TGeometry temp2) => Meos.FrontTspatialTspatial(this.Ptr, temp2.Ptr); diff --git a/MEOS.NET/Types/TH3Index.g.cs b/MEOS.NET/Types/TH3Index.g.cs index 7a99cfe..08f67df 100644 --- a/MEOS.NET/Types/TH3Index.g.cs +++ b/MEOS.NET/Types/TH3Index.g.cs @@ -27,14 +27,14 @@ public bool Adjacent(TH3Index temp2) public bool After(TH3Index temp2) => Meos.AfterTspatialTspatial(this.Ptr, temp2.Ptr); - public int AlwaysEq(ulong cell) - => Meos.AlwaysEqTh3indexH3index(this.Ptr, cell); + public int AlwaysEq(H3Index cell) + => Meos.AlwaysEqTh3indexH3index(this.Ptr, cell.value); public int AlwaysEq(TH3Index temp2) => Meos.AlwaysEqTh3indexTh3index(this.Ptr, temp2.Ptr); - public int AlwaysNe(ulong cell) - => Meos.AlwaysNeTh3indexH3index(this.Ptr, cell); + public int AlwaysNe(H3Index cell) + => Meos.AlwaysNeTh3indexH3index(this.Ptr, cell.value); public int AlwaysNe(TH3Index temp2) => Meos.AlwaysNeTh3indexTh3index(this.Ptr, temp2.Ptr); @@ -42,8 +42,8 @@ public int AlwaysNe(TH3Index temp2) public Temporal? AreNeighborCells(Temporal dest) => MEOSFactory.WrapTemporal(Meos.Th3indexAreNeighborCells(this.Ptr, dest.Ptr)); - public Temporal? AtValue(ulong cell) - => MEOSFactory.WrapTemporal(Meos.Th3indexAtValue(this.Ptr, cell)); + public Temporal? AtValue(H3Index cell) + => MEOSFactory.WrapTemporal(Meos.Th3indexAtValue(this.Ptr, cell.value)); public bool Before(TH3Index temp2) => Meos.BeforeTspatialTspatial(this.Ptr, temp2.Ptr); @@ -87,11 +87,11 @@ public bool Contains(TH3Index temp2) public Temporal? EdgeLength() => MEOSFactory.WrapTemporal(Meos.Th3indexEdgeLength(this.Ptr)); - public ulong EndValue() - => Meos.Th3indexEndValue(this.Ptr); + public H3Index EndValue() + => new H3Index(Meos.Th3indexEndValue(this.Ptr)); - public int EverEq(ulong cell) - => Meos.EverEqTh3indexH3index(this.Ptr, cell); + public int EverEq(H3Index cell) + => Meos.EverEqTh3indexH3index(this.Ptr, cell.value); public int EverEq(TH3Index temp2) => Meos.EverEqTh3indexTh3index(this.Ptr, temp2.Ptr); @@ -99,8 +99,8 @@ public int EverEq(TH3Index temp2) public int EverEq(H3IndexSet cells) => Meos.EverEqTh3indexH3indexset(this.Ptr, cells.Ptr); - public int EverNe(ulong cell) - => Meos.EverNeTh3indexH3index(this.Ptr, cell); + public int EverNe(H3Index cell) + => Meos.EverNeTh3indexH3index(this.Ptr, cell.value); public int EverNe(TH3Index temp2) => Meos.EverNeTh3indexTh3index(this.Ptr, temp2.Ptr); @@ -135,8 +135,8 @@ public bool Left(TH3Index temp2) public Temporal? LocalIjToCell(Temporal coord) => MEOSFactory.WrapTemporal(Meos.Th3indexLocalIjToCell(this.Ptr, coord.Ptr)); - public Temporal? MinusValue(ulong cell) - => MEOSFactory.WrapTemporal(Meos.Th3indexMinusValue(this.Ptr, cell)); + public Temporal? MinusValue(H3Index cell) + => MEOSFactory.WrapTemporal(Meos.Th3indexMinusValue(this.Ptr, cell.value)); public bool Overabove(TH3Index temp2) => Meos.OveraboveTspatialTspatial(this.Ptr, temp2.Ptr); @@ -159,41 +159,41 @@ public bool Overleft(TH3Index temp2) public bool Overright(TH3Index temp2) => Meos.OverrightTspatialTspatial(this.Ptr, temp2.Ptr); - public int RalwaysEq(ulong cell) - => Meos.AlwaysEqH3indexTh3index(cell, this.Ptr); + public int RalwaysEq(H3Index cell) + => Meos.AlwaysEqH3indexTh3index(cell.value, this.Ptr); - public int RalwaysNe(ulong cell) - => Meos.AlwaysNeH3indexTh3index(cell, this.Ptr); + public int RalwaysNe(H3Index cell) + => Meos.AlwaysNeH3indexTh3index(cell.value, this.Ptr); - public int ReverEq(ulong cell) - => Meos.EverEqH3indexTh3index(cell, this.Ptr); + public int ReverEq(H3Index cell) + => Meos.EverEqH3indexTh3index(cell.value, this.Ptr); - public int ReverNe(ulong cell) - => Meos.EverNeH3indexTh3index(cell, this.Ptr); + public int ReverNe(H3Index cell) + => Meos.EverNeH3indexTh3index(cell.value, this.Ptr); public bool Right(TH3Index temp2) => Meos.RightTspatialTspatial(this.Ptr, temp2.Ptr); - public Temporal? Rteq(ulong cell) - => MEOSFactory.WrapTemporal(Meos.TeqH3indexTh3index(cell, this.Ptr)); + public Temporal? Rteq(H3Index cell) + => MEOSFactory.WrapTemporal(Meos.TeqH3indexTh3index(cell.value, this.Ptr)); - public Temporal? Rtne(ulong cell) - => MEOSFactory.WrapTemporal(Meos.TneH3indexTh3index(cell, this.Ptr)); + public Temporal? Rtne(H3Index cell) + => MEOSFactory.WrapTemporal(Meos.TneH3indexTh3index(cell.value, this.Ptr)); public bool Same(TH3Index temp2) => Meos.SameTspatialTspatial(this.Ptr, temp2.Ptr); - public ulong StartValue() - => Meos.Th3indexStartValue(this.Ptr); + public H3Index StartValue() + => new H3Index(Meos.Th3indexStartValue(this.Ptr)); - public Temporal? Teq(ulong cell) - => MEOSFactory.WrapTemporal(Meos.TeqTh3indexH3index(this.Ptr, cell)); + public Temporal? Teq(H3Index cell) + => MEOSFactory.WrapTemporal(Meos.TeqTh3indexH3index(this.Ptr, cell.value)); public Temporal? Teq(TH3Index temp2) => MEOSFactory.WrapTemporal(Meos.TeqTh3indexTh3index(this.Ptr, temp2.Ptr)); - public Temporal? Tne(ulong cell) - => MEOSFactory.WrapTemporal(Meos.TneTh3indexH3index(this.Ptr, cell)); + public Temporal? Tne(H3Index cell) + => MEOSFactory.WrapTemporal(Meos.TneTh3indexH3index(this.Ptr, cell.value)); public Temporal? Tne(TH3Index temp2) => MEOSFactory.WrapTemporal(Meos.TneTh3indexTh3index(this.Ptr, temp2.Ptr)); @@ -207,17 +207,17 @@ public ulong StartValue() public Temporal? ToTgeompoint() => MEOSFactory.WrapTemporal(Meos.Th3indexToTgeompoint(this.Ptr)); - public (SpanSet?[], ulong[]) Unnest() + public (SpanSet?[], H3Index[]) Unnest() { var _answered = Meos.Th3indexUnnest(this.Ptr); - return (MEOSFactory.WrapSpanSetArray(_answered.Item1), _answered.Item2); + return (MEOSFactory.WrapSpanSetArray(_answered.Item1), Array.ConvertAll(_answered.Item2, v => new H3Index(v))); } - public ulong Value() - => Meos.Th3indexValue(this.Ptr); + public H3Index Value() + => new H3Index(Meos.Th3indexValue(this.Ptr)); - public ulong? ValueAtTimestamptz(DateTime t, bool strict) + public H3Index? ValueAtTimestamptz(DateTime t, bool strict) { IntPtr _result = Marshal.AllocHGlobal(8); try @@ -227,7 +227,7 @@ public ulong Value() return null; } - return Marshal.PtrToStructure(_result); + return new H3Index(Marshal.PtrToStructure(_result)); } finally { @@ -235,7 +235,7 @@ public ulong Value() } } - public ulong? ValueN(int n) + public H3Index? ValueN(int n) { IntPtr _result = Marshal.AllocHGlobal(8); try @@ -245,7 +245,7 @@ public ulong Value() return null; } - return Marshal.PtrToStructure(_result); + return new H3Index(Marshal.PtrToStructure(_result)); } finally { @@ -253,14 +253,14 @@ public ulong Value() } } - public ulong[] Values() - => Meos.Th3indexValues(this.Ptr); + public H3Index[] Values() + => Array.ConvertAll(Meos.Th3indexValues(this.Ptr), v => new H3Index(v)); public Temporal? VertexToLatlng() => MEOSFactory.WrapTemporal(Meos.Th3indexVertexToLatlng(this.Ptr)); - public static Temporal? FromBaseTemp(ulong value, Temporal temp) - => MEOSFactory.WrapTemporal(Meos.Th3indexFromBaseTemp(value, temp.Ptr)); + public static Temporal? FromBaseTemp(H3Index value, Temporal temp) + => MEOSFactory.WrapTemporal(Meos.Th3indexFromBaseTemp(value.value, temp.Ptr)); public static Temporal? FromEWKB(byte[] wkb) => Temporal.FromWKB(wkb); diff --git a/MEOS.NET/Types/TH3IndexInst.g.cs b/MEOS.NET/Types/TH3IndexInst.g.cs index 7cdf3a4..44306db 100644 --- a/MEOS.NET/Types/TH3IndexInst.g.cs +++ b/MEOS.NET/Types/TH3IndexInst.g.cs @@ -14,8 +14,8 @@ public class TH3IndexInst : TH3Index { internal TH3IndexInst(IntPtr ptr) : base(ptr) { } - public static Temporal? Make(ulong value, DateTime t) - => MEOSFactory.WrapTemporal(Meos.Th3indexinstMake(value, MEOSConvert.ToTimestampTz(t))); + public static Temporal? Make(H3Index value, DateTime t) + => MEOSFactory.WrapTemporal(Meos.Th3indexinstMake(value.value, MEOSConvert.ToTimestampTz(t))); } } diff --git a/MEOS.NET/Types/TH3IndexSeq.g.cs b/MEOS.NET/Types/TH3IndexSeq.g.cs index a9d9bd5..f09f11d 100644 --- a/MEOS.NET/Types/TH3IndexSeq.g.cs +++ b/MEOS.NET/Types/TH3IndexSeq.g.cs @@ -14,13 +14,13 @@ public class TH3IndexSeq : TH3Index { internal TH3IndexSeq(IntPtr ptr) : base(ptr) { } - public static Temporal? FromBaseTstzset(ulong value, Set s) - => MEOSFactory.WrapTemporal(Meos.Th3indexseqFromBaseTstzset(value, s.Ptr)); + public static Temporal? FromBaseTstzset(H3Index value, Set s) + => MEOSFactory.WrapTemporal(Meos.Th3indexseqFromBaseTstzset(value.value, s.Ptr)); - public static Temporal? FromBaseTstzspan(ulong value, Span s) - => MEOSFactory.WrapTemporal(Meos.Th3indexseqFromBaseTstzspan(value, s.Ptr)); + public static Temporal? FromBaseTstzspan(H3Index value, Span s) + => MEOSFactory.WrapTemporal(Meos.Th3indexseqFromBaseTstzspan(value.value, s.Ptr)); - public static Temporal? Make(ulong[] values, long[] times, bool lower_inc, bool upper_inc) + public static Temporal? Make(H3Index[] values, long[] times, bool lower_inc, bool upper_inc) { if (values.Length != times.Length) { diff --git a/MEOS.NET/Types/TH3IndexSeqSet.g.cs b/MEOS.NET/Types/TH3IndexSeqSet.g.cs index 941e2a8..f29a7b0 100644 --- a/MEOS.NET/Types/TH3IndexSeqSet.g.cs +++ b/MEOS.NET/Types/TH3IndexSeqSet.g.cs @@ -14,8 +14,8 @@ public class TH3IndexSeqSet : TH3Index { internal TH3IndexSeqSet(IntPtr ptr) : base(ptr) { } - public static Temporal? FromBaseTstzspanset(ulong value, SpanSet ss) - => MEOSFactory.WrapTemporal(Meos.Th3indexseqsetFromBaseTstzspanset(value, ss.Ptr)); + public static Temporal? FromBaseTstzspanset(H3Index value, SpanSet ss) + => MEOSFactory.WrapTemporal(Meos.Th3indexseqsetFromBaseTstzspanset(value.value, ss.Ptr)); public static Temporal? Make(Temporal[] sequences) { diff --git a/MEOS.NET/Types/TInt.g.cs b/MEOS.NET/Types/TInt.g.cs index e88bc1f..e074e8f 100644 --- a/MEOS.NET/Types/TInt.g.cs +++ b/MEOS.NET/Types/TInt.g.cs @@ -69,6 +69,9 @@ public int AlwaysNe(int i) public int AlwaysNe(TInt temp2) => Meos.AlwaysNeTemporalTemporal(this.Ptr, temp2.Ptr); + public int AlwaysOverlaps(TInt temp2) + => Meos.AlwaysOverlapsTemporalTemporal(this.Ptr, temp2.Ptr); + public string AsText(int maxdd) => this.Out(maxdd); @@ -135,6 +138,9 @@ public int EverNe(int i) public int EverNe(TInt temp2) => Meos.EverNeTemporalTemporal(this.Ptr, temp2.Ptr); + public int EverOverlaps(TInt temp2) + => Meos.EverOverlapsTemporalTemporal(this.Ptr, temp2.Ptr); + public bool Left(IntSpan s) => Meos.LeftTnumberNumspan(this.Ptr, s.Ptr); diff --git a/MEOS.NET/Types/TNPoint.g.cs b/MEOS.NET/Types/TNPoint.g.cs index 4132a1e..76f0d3d 100644 --- a/MEOS.NET/Types/TNPoint.g.cs +++ b/MEOS.NET/Types/TNPoint.g.cs @@ -39,6 +39,9 @@ public int AlwaysNe(NPoint np) public int AlwaysNe(TNPoint temp2) => Meos.AlwaysNeTnpointTnpoint(this.Ptr, temp2.Ptr); + public int AlwaysOverlaps(STBox box) + => Meos.AlwaysOverlapsTnpointStbox(this.Ptr, box.Ptr); + public Temporal? AtGeom(Geo gs) => MEOSFactory.WrapTemporal(Meos.TnpointAtGeom(this.Ptr, gs.Ptr)); @@ -111,6 +114,9 @@ public int EverNe(NPoint np) public int EverNe(TNPoint temp2) => Meos.EverNeTnpointTnpoint(this.Ptr, temp2.Ptr); + public int EverOverlaps(STBox box) + => Meos.EverOverlapsTnpointStbox(this.Ptr, box.Ptr); + public bool Left(TNPoint temp2) => Meos.LeftTspatialTspatial(this.Ptr, temp2.Ptr); diff --git a/MEOS.NET/Types/TNumber.g.cs b/MEOS.NET/Types/TNumber.g.cs index d3ab025..7d1273f 100644 --- a/MEOS.NET/Types/TNumber.g.cs +++ b/MEOS.NET/Types/TNumber.g.cs @@ -38,6 +38,9 @@ public bool After(TBox box) public bool After(TNumber temp2) => Meos.AfterTnumberTnumber(this.Ptr, temp2.Ptr); + public int AlwaysOverlaps(TBox box) + => Meos.AlwaysOverlapsTnumberTbox(this.Ptr, box.Ptr); + public Temporal? AngularDifference() => MEOSFactory.WrapTemporal(Meos.TnumberAngularDifference(this.Ptr)); @@ -89,6 +92,9 @@ public bool Contains(TNumber temp2) public Temporal? Div(TNumber tnumber2) => MEOSFactory.WrapTemporal(Meos.DivTnumberTnumber(this.Ptr, tnumber2.Ptr)); + public int EverOverlaps(TBox box) + => Meos.EverOverlapsTnumberTbox(this.Ptr, box.Ptr); + public double Integral() => Meos.TnumberIntegral(this.Ptr); diff --git a/MEOS.NET/Types/TPCPatch.g.cs b/MEOS.NET/Types/TPCPatch.g.cs index 8a3ff68..b8b52e2 100644 --- a/MEOS.NET/Types/TPCPatch.g.cs +++ b/MEOS.NET/Types/TPCPatch.g.cs @@ -30,6 +30,9 @@ public int AlwaysNe(PCPatch pa) public int AlwaysNe(TPCPatch temp2) => Meos.AlwaysNeTpcpatchTpcpatch(this.Ptr, temp2.Ptr); + public Temporal? AtTpcbox(TPCBox box, bool border_inc) + => MEOSFactory.WrapTemporal(Meos.TpcpatchAtTpcbox(this.Ptr, box.Ptr, border_inc)); + public Temporal? AtValue(PCPatch pa) => MEOSFactory.WrapTemporal(Meos.TpcpatchAtValue(this.Ptr, pa.Ptr)); @@ -51,6 +54,9 @@ public int EverNe(PCPatch pa) public int EverNe(TPCPatch temp2) => Meos.EverNeTpcpatchTpcpatch(this.Ptr, temp2.Ptr); + public Temporal? MinusTpcbox(TPCBox box, bool border_inc) + => MEOSFactory.WrapTemporal(Meos.TpcpatchMinusTpcbox(this.Ptr, box.Ptr, border_inc)); + public Temporal? MinusValue(PCPatch pa) => MEOSFactory.WrapTemporal(Meos.TpcpatchMinusValue(this.Ptr, pa.Ptr)); diff --git a/MEOS.NET/Types/TPCPoint.g.cs b/MEOS.NET/Types/TPCPoint.g.cs index ee1a53e..0261c9d 100644 --- a/MEOS.NET/Types/TPCPoint.g.cs +++ b/MEOS.NET/Types/TPCPoint.g.cs @@ -30,6 +30,9 @@ public int AlwaysNe(PCPoint pt) public int AlwaysNe(TPCPoint temp2) => Meos.AlwaysNeTpcpointTpcpoint(this.Ptr, temp2.Ptr); + public Temporal? AtTpcbox(TPCBox box, bool border_inc) + => MEOSFactory.WrapTemporal(Meos.TpcpointAtTpcbox(this.Ptr, box.Ptr, border_inc)); + public Temporal? AtValue(PCPoint pt) => MEOSFactory.WrapTemporal(Meos.TpcpointAtValue(this.Ptr, pt.Ptr)); @@ -51,6 +54,9 @@ public int EverNe(PCPoint pt) public int EverNe(TPCPoint temp2) => Meos.EverNeTpcpointTpcpoint(this.Ptr, temp2.Ptr); + public Temporal? MinusTpcbox(TPCBox box, bool border_inc) + => MEOSFactory.WrapTemporal(Meos.TpcpointMinusTpcbox(this.Ptr, box.Ptr, border_inc)); + public Temporal? MinusValue(PCPoint pt) => MEOSFactory.WrapTemporal(Meos.TpcpointMinusValue(this.Ptr, pt.Ptr)); diff --git a/MEOS.NET/Types/TPose.g.cs b/MEOS.NET/Types/TPose.g.cs index f1bd272..cafc915 100644 --- a/MEOS.NET/Types/TPose.g.cs +++ b/MEOS.NET/Types/TPose.g.cs @@ -39,6 +39,12 @@ public int AlwaysNe(Pose pose) public int AlwaysNe(TPose temp2) => Meos.AlwaysNeTposeTpose(this.Ptr, temp2.Ptr); + public int AlwaysOverlaps(STBox box) + => Meos.AlwaysOverlapsTposeStbox(this.Ptr, box.Ptr); + + public int AlwaysOverlaps(TPose temp2) + => Meos.AlwaysOverlapsTposeTpose(this.Ptr, temp2.Ptr); + public Temporal? AngularSpeed() => MEOSFactory.WrapTemporal(Meos.TposeAngularSpeed(this.Ptr)); @@ -123,6 +129,12 @@ public int EverNe(Pose pose) public int EverNe(TPose temp2) => Meos.EverNeTposeTpose(this.Ptr, temp2.Ptr); + public int EverOverlaps(STBox box) + => Meos.EverOverlapsTposeStbox(this.Ptr, box.Ptr); + + public int EverOverlaps(TPose temp2) + => Meos.EverOverlapsTposeTpose(this.Ptr, temp2.Ptr); + public Temporal? Force2d() => MEOSFactory.WrapTemporal(Meos.TposeForce2d(this.Ptr)); diff --git a/MEOS.NET/Types/TQuadbin.g.cs b/MEOS.NET/Types/TQuadbin.g.cs index 10587f0..f5d5a8e 100644 --- a/MEOS.NET/Types/TQuadbin.g.cs +++ b/MEOS.NET/Types/TQuadbin.g.cs @@ -27,20 +27,20 @@ public bool Adjacent(TQuadbin temp2) public bool After(TQuadbin temp2) => Meos.AfterTspatialTspatial(this.Ptr, temp2.Ptr); - public int AlwaysEq(ulong cell) - => Meos.AlwaysEqTquadbinQuadbin(this.Ptr, cell); + public int AlwaysEq(Quadbin cell) + => Meos.AlwaysEqTquadbinQuadbin(this.Ptr, cell.value); public int AlwaysEq(TQuadbin temp2) => Meos.AlwaysEqTquadbinTquadbin(this.Ptr, temp2.Ptr); - public int AlwaysNe(ulong cell) - => Meos.AlwaysNeTquadbinQuadbin(this.Ptr, cell); + public int AlwaysNe(Quadbin cell) + => Meos.AlwaysNeTquadbinQuadbin(this.Ptr, cell.value); public int AlwaysNe(TQuadbin temp2) => Meos.AlwaysNeTquadbinTquadbin(this.Ptr, temp2.Ptr); - public Temporal? AtValue(ulong cell) - => MEOSFactory.WrapTemporal(Meos.TquadbinAtValue(this.Ptr, cell)); + public Temporal? AtValue(Quadbin cell) + => MEOSFactory.WrapTemporal(Meos.TquadbinAtValue(this.Ptr, cell.value)); public bool Before(TQuadbin temp2) => Meos.BeforeTspatialTspatial(this.Ptr, temp2.Ptr); @@ -69,20 +69,20 @@ public int Eintersects(Geometry gs) public int Eintersects(TQuadbin temp2) => Meos.EintersectsTgeoTgeo(this.Ptr, temp2.Ptr); - public ulong EndValue() - => Meos.TquadbinEndValue(this.Ptr); + public Quadbin EndValue() + => new Quadbin(Meos.TquadbinEndValue(this.Ptr)); public int EverEq(QuadbinSet cells) => Meos.EverEqTquadbinQuadbinset(this.Ptr, cells.Ptr); - public int EverEq(ulong cell) - => Meos.EverEqTquadbinQuadbin(this.Ptr, cell); + public int EverEq(Quadbin cell) + => Meos.EverEqTquadbinQuadbin(this.Ptr, cell.value); public int EverEq(TQuadbin temp2) => Meos.EverEqTquadbinTquadbin(this.Ptr, temp2.Ptr); - public int EverNe(ulong cell) - => Meos.EverNeTquadbinQuadbin(this.Ptr, cell); + public int EverNe(Quadbin cell) + => Meos.EverNeTquadbinQuadbin(this.Ptr, cell.value); public int EverNe(TQuadbin temp2) => Meos.EverNeTquadbinTquadbin(this.Ptr, temp2.Ptr); @@ -93,8 +93,8 @@ public int EverNe(TQuadbin temp2) public bool Left(TQuadbin temp2) => Meos.LeftTspatialTspatial(this.Ptr, temp2.Ptr); - public Temporal? MinusValue(ulong cell) - => MEOSFactory.WrapTemporal(Meos.TquadbinMinusValue(this.Ptr, cell)); + public Temporal? MinusValue(Quadbin cell) + => MEOSFactory.WrapTemporal(Meos.TquadbinMinusValue(this.Ptr, cell.value)); public bool Overabove(TQuadbin temp2) => Meos.OveraboveTspatialTspatial(this.Ptr, temp2.Ptr); @@ -117,41 +117,41 @@ public bool Overleft(TQuadbin temp2) public bool Overright(TQuadbin temp2) => Meos.OverrightTspatialTspatial(this.Ptr, temp2.Ptr); - public int RalwaysEq(ulong cell) - => Meos.AlwaysEqQuadbinTquadbin(cell, this.Ptr); + public int RalwaysEq(Quadbin cell) + => Meos.AlwaysEqQuadbinTquadbin(cell.value, this.Ptr); - public int RalwaysNe(ulong cell) - => Meos.AlwaysNeQuadbinTquadbin(cell, this.Ptr); + public int RalwaysNe(Quadbin cell) + => Meos.AlwaysNeQuadbinTquadbin(cell.value, this.Ptr); - public int ReverEq(ulong cell) - => Meos.EverEqQuadbinTquadbin(cell, this.Ptr); + public int ReverEq(Quadbin cell) + => Meos.EverEqQuadbinTquadbin(cell.value, this.Ptr); - public int ReverNe(ulong cell) - => Meos.EverNeQuadbinTquadbin(cell, this.Ptr); + public int ReverNe(Quadbin cell) + => Meos.EverNeQuadbinTquadbin(cell.value, this.Ptr); public bool Right(TQuadbin temp2) => Meos.RightTspatialTspatial(this.Ptr, temp2.Ptr); - public Temporal? Rteq(ulong cell) - => MEOSFactory.WrapTemporal(Meos.TeqQuadbinTquadbin(cell, this.Ptr)); + public Temporal? Rteq(Quadbin cell) + => MEOSFactory.WrapTemporal(Meos.TeqQuadbinTquadbin(cell.value, this.Ptr)); - public Temporal? Rtne(ulong cell) - => MEOSFactory.WrapTemporal(Meos.TneQuadbinTquadbin(cell, this.Ptr)); + public Temporal? Rtne(Quadbin cell) + => MEOSFactory.WrapTemporal(Meos.TneQuadbinTquadbin(cell.value, this.Ptr)); public bool Same(TQuadbin temp2) => Meos.SameTspatialTspatial(this.Ptr, temp2.Ptr); - public ulong StartValue() - => Meos.TquadbinStartValue(this.Ptr); + public Quadbin StartValue() + => new Quadbin(Meos.TquadbinStartValue(this.Ptr)); - public Temporal? Teq(ulong cell) - => MEOSFactory.WrapTemporal(Meos.TeqTquadbinQuadbin(this.Ptr, cell)); + public Temporal? Teq(Quadbin cell) + => MEOSFactory.WrapTemporal(Meos.TeqTquadbinQuadbin(this.Ptr, cell.value)); public Temporal? Teq(TQuadbin temp2) => MEOSFactory.WrapTemporal(Meos.TeqTquadbinTquadbin(this.Ptr, temp2.Ptr)); - public Temporal? Tne(ulong cell) - => MEOSFactory.WrapTemporal(Meos.TneTquadbinQuadbin(this.Ptr, cell)); + public Temporal? Tne(Quadbin cell) + => MEOSFactory.WrapTemporal(Meos.TneTquadbinQuadbin(this.Ptr, cell.value)); public Temporal? Tne(TQuadbin temp2) => MEOSFactory.WrapTemporal(Meos.TneTquadbinTquadbin(this.Ptr, temp2.Ptr)); @@ -162,17 +162,17 @@ public ulong StartValue() public Temporal? ToTgeogpoint() => MEOSFactory.WrapTemporal(Meos.TquadbinToTgeogpoint(this.Ptr)); - public (SpanSet?[], ulong[]) Unnest() + public (SpanSet?[], Quadbin[]) Unnest() { var _answered = Meos.TquadbinUnnest(this.Ptr); - return (MEOSFactory.WrapSpanSetArray(_answered.Item1), _answered.Item2); + return (MEOSFactory.WrapSpanSetArray(_answered.Item1), Array.ConvertAll(_answered.Item2, v => new Quadbin(v))); } - public ulong Value() - => Meos.TquadbinValue(this.Ptr); + public Quadbin Value() + => new Quadbin(Meos.TquadbinValue(this.Ptr)); - public ulong? ValueAtTimestamptz(DateTime t, bool strict) + public Quadbin? ValueAtTimestamptz(DateTime t, bool strict) { IntPtr _result = Marshal.AllocHGlobal(8); try @@ -182,7 +182,7 @@ public ulong Value() return null; } - return Marshal.PtrToStructure(_result); + return new Quadbin(Marshal.PtrToStructure(_result)); } finally { @@ -190,7 +190,7 @@ public ulong Value() } } - public ulong? ValueN(int n) + public Quadbin? ValueN(int n) { IntPtr _result = Marshal.AllocHGlobal(8); try @@ -200,7 +200,7 @@ public ulong Value() return null; } - return Marshal.PtrToStructure(_result); + return new Quadbin(Marshal.PtrToStructure(_result)); } finally { @@ -208,11 +208,11 @@ public ulong Value() } } - public ulong[] Values() - => Meos.TquadbinValues(this.Ptr); + public Quadbin[] Values() + => Array.ConvertAll(Meos.TquadbinValues(this.Ptr), v => new Quadbin(v)); - public static Temporal? FromBaseTemp(ulong value, Temporal temp) - => MEOSFactory.WrapTemporal(Meos.TquadbinFromBaseTemp(value, temp.Ptr)); + public static Temporal? FromBaseTemp(Quadbin value, Temporal temp) + => MEOSFactory.WrapTemporal(Meos.TquadbinFromBaseTemp(value.value, temp.Ptr)); public static Temporal? FromEWKB(byte[] wkb) => Temporal.FromWKB(wkb); diff --git a/MEOS.NET/Types/TQuadbinInst.g.cs b/MEOS.NET/Types/TQuadbinInst.g.cs index d436914..6190fdf 100644 --- a/MEOS.NET/Types/TQuadbinInst.g.cs +++ b/MEOS.NET/Types/TQuadbinInst.g.cs @@ -14,8 +14,8 @@ public class TQuadbinInst : TQuadbin { internal TQuadbinInst(IntPtr ptr) : base(ptr) { } - public static Temporal? Make(ulong value, DateTime t) - => MEOSFactory.WrapTemporal(Meos.TquadbininstMake(value, MEOSConvert.ToTimestampTz(t))); + public static Temporal? Make(Quadbin value, DateTime t) + => MEOSFactory.WrapTemporal(Meos.TquadbininstMake(value.value, MEOSConvert.ToTimestampTz(t))); } } diff --git a/MEOS.NET/Types/TQuadbinSeq.g.cs b/MEOS.NET/Types/TQuadbinSeq.g.cs index cc666d5..7f50fe9 100644 --- a/MEOS.NET/Types/TQuadbinSeq.g.cs +++ b/MEOS.NET/Types/TQuadbinSeq.g.cs @@ -14,13 +14,13 @@ public class TQuadbinSeq : TQuadbin { internal TQuadbinSeq(IntPtr ptr) : base(ptr) { } - public static Temporal? FromBaseTstzset(ulong value, Set s) - => MEOSFactory.WrapTemporal(Meos.TquadbinseqFromBaseTstzset(value, s.Ptr)); + public static Temporal? FromBaseTstzset(Quadbin value, Set s) + => MEOSFactory.WrapTemporal(Meos.TquadbinseqFromBaseTstzset(value.value, s.Ptr)); - public static Temporal? FromBaseTstzspan(ulong value, Span s) - => MEOSFactory.WrapTemporal(Meos.TquadbinseqFromBaseTstzspan(value, s.Ptr)); + public static Temporal? FromBaseTstzspan(Quadbin value, Span s) + => MEOSFactory.WrapTemporal(Meos.TquadbinseqFromBaseTstzspan(value.value, s.Ptr)); - public static Temporal? Make(ulong[] values, long[] times, bool lower_inc, bool upper_inc) + public static Temporal? Make(Quadbin[] values, long[] times, bool lower_inc, bool upper_inc) { if (values.Length != times.Length) { diff --git a/MEOS.NET/Types/TQuadbinSeqSet.g.cs b/MEOS.NET/Types/TQuadbinSeqSet.g.cs index 29031de..829bbb7 100644 --- a/MEOS.NET/Types/TQuadbinSeqSet.g.cs +++ b/MEOS.NET/Types/TQuadbinSeqSet.g.cs @@ -14,8 +14,8 @@ public class TQuadbinSeqSet : TQuadbin { internal TQuadbinSeqSet(IntPtr ptr) : base(ptr) { } - public static Temporal? FromBaseTstzspanset(ulong value, SpanSet ss) - => MEOSFactory.WrapTemporal(Meos.TquadbinseqsetFromBaseTstzspanset(value, ss.Ptr)); + public static Temporal? FromBaseTstzspanset(Quadbin value, SpanSet ss) + => MEOSFactory.WrapTemporal(Meos.TquadbinseqsetFromBaseTstzspanset(value.value, ss.Ptr)); public static Temporal? Make(Temporal[] sequences) { diff --git a/MEOS.NET/Types/TRGeometry.g.cs b/MEOS.NET/Types/TRGeometry.g.cs index 7ca5018..c263b93 100644 --- a/MEOS.NET/Types/TRGeometry.g.cs +++ b/MEOS.NET/Types/TRGeometry.g.cs @@ -42,9 +42,6 @@ public int Adwithin(TRGeometry temp2, double dist) public bool After(TRGeometry temp2) => Meos.AfterTspatialTspatial(this.Ptr, temp2.Ptr); - public new Temporal? AfterTimestamptz(DateTime t, bool strict) - => MEOSFactory.WrapTemporal(Meos.TrgeometryAfterTimestamptz(this.Ptr, MEOSConvert.ToTimestampTz(t), strict)); - public int Aintersects(Geometry gs) => Meos.AintersectsTrgeometryGeo(this.Ptr, gs.Ptr); @@ -63,26 +60,12 @@ public int AlwaysNe(Geometry gs) public int AlwaysNe(TRGeometry temp2) => Meos.AlwaysNeTrgeometryTrgeometry(this.Ptr, temp2.Ptr); + public int AlwaysOverlaps(STBox box) + => Meos.AlwaysOverlapsTrgeometryStbox(this.Ptr, box.Ptr); + public Temporal? AngularSpeed() => MEOSFactory.WrapTemporal(Meos.TrgeometryAngularSpeed(this.Ptr)); - public new Temporal? AppendTinstant(Temporal inst, string interp, double maxdist, Interval maxt, bool expand) - { - IntPtr _maxt = Marshal.AllocHGlobal(Marshal.SizeOf()); - try - { - Marshal.StructureToPtr(maxt, _maxt, false); - return MEOSFactory.WrapTemporal(Meos.TrgeometryAppendTinstant(this.Ptr, inst.Ptr, Meos.InterptypeFromString(interp), maxdist, _maxt, expand)); - } - finally - { - Marshal.FreeHGlobal(_maxt); - } - } - - public new Temporal? AppendTsequence(Temporal seq, bool expand) - => MEOSFactory.WrapTemporal(Meos.TrgeometryAppendTsequence(this.Ptr, seq.Ptr, expand)); - public new string AsEWKT(int maxdd) => Meos.TrgeometryAsEwkt(this.Ptr, maxdd); @@ -104,24 +87,9 @@ public int AlwaysNe(TRGeometry temp2) public Temporal? AtStbox(STBox box, bool border_inc) => MEOSFactory.WrapTemporal(Meos.TrgeometryAtStbox(this.Ptr, box.Ptr, border_inc)); - public new Temporal? AtTimestamptz(DateTime t) - => MEOSFactory.WrapTemporal(Meos.TrgeometryAtTimestamptz(this.Ptr, MEOSConvert.ToTimestampTz(t))); - - public new Temporal? AtTstzset(Set s) - => MEOSFactory.WrapTemporal(Meos.TrgeometryAtTstzset(this.Ptr, s.Ptr)); - - public new Temporal? AtTstzspan(Span s) - => MEOSFactory.WrapTemporal(Meos.TrgeometryAtTstzspan(this.Ptr, s.Ptr)); - - public new Temporal? AtTstzspanset(SpanSet ss) - => MEOSFactory.WrapTemporal(Meos.TrgeometryAtTstzspanset(this.Ptr, ss.Ptr)); - public Temporal? AtValue(Pose pose) => MEOSFactory.WrapTemporal(Meos.TrgeometryAtValue(this.Ptr, pose.Ptr)); - public new Temporal? AtValues(Set s) - => MEOSFactory.WrapTemporal(Meos.TrgeometryAtValues(this.Ptr, s.Ptr)); - public int Atouches(Geometry gs) => Meos.AtouchesTrgeometryGeo(this.Ptr, gs.Ptr); @@ -131,9 +99,6 @@ public bool Back(TRGeometry temp2) public bool Before(TRGeometry temp2) => Meos.BeforeTspatialTspatial(this.Ptr, temp2.Ptr); - public new Temporal? BeforeTimestamptz(DateTime t, bool strict) - => MEOSFactory.WrapTemporal(Meos.TrgeometryBeforeTimestamptz(this.Ptr, MEOSConvert.ToTimestampTz(t), strict)); - public bool Below(TRGeometry temp2) => Meos.BelowTspatialTspatial(this.Ptr, temp2.Ptr); @@ -155,18 +120,6 @@ public bool Contains(TRGeometry temp2) public Temporal? CumulativeLength() => MEOSFactory.WrapTemporal(Meos.TrgeometryCumulativeLength(this.Ptr)); - public new Temporal? DeleteTimestamptz(DateTime t, bool connect) - => MEOSFactory.WrapTemporal(Meos.TrgeometryDeleteTimestamptz(this.Ptr, MEOSConvert.ToTimestampTz(t), connect)); - - public new Temporal? DeleteTstzset(Set s, bool connect) - => MEOSFactory.WrapTemporal(Meos.TrgeometryDeleteTstzset(this.Ptr, s.Ptr, connect)); - - public new Temporal? DeleteTstzspan(Span s, bool connect) - => MEOSFactory.WrapTemporal(Meos.TrgeometryDeleteTstzspan(this.Ptr, s.Ptr, connect)); - - public new Temporal? DeleteTstzspanset(SpanSet ss, bool connect) - => MEOSFactory.WrapTemporal(Meos.TrgeometryDeleteTstzspanset(this.Ptr, ss.Ptr, connect)); - public int Ecovers(Geometry gs) => Meos.EcoversTrgeometryGeo(this.Ptr, gs.Ptr); @@ -188,12 +141,6 @@ public int Eintersects(Geometry gs) public int Eintersects(TRGeometry temp2) => Meos.EintersectsTrgeometryTrgeometry(this.Ptr, temp2.Ptr); - public new Temporal? EndInstant() - => MEOSFactory.WrapTemporal(Meos.TrgeometryEndInstant(this.Ptr)); - - public new Temporal? EndSequence() - => MEOSFactory.WrapTemporal(Meos.TrgeometryEndSequence(this.Ptr)); - public Geo? EndValue() => MEOSFactory.WrapGeo(Meos.TrgeometryEndValue(this.Ptr)); @@ -212,6 +159,9 @@ public int EverNe(Geometry gs) public int EverNe(TRGeometry temp2) => Meos.EverNeTrgeometryTrgeometry(this.Ptr, temp2.Ptr); + public int EverOverlaps(STBox box) + => Meos.EverOverlapsTrgeometryStbox(this.Ptr, box.Ptr); + public Temporal? Force2d() => MEOSFactory.WrapTemporal(Meos.TrgeometryForce2d(this.Ptr)); @@ -221,45 +171,21 @@ public bool Front(TRGeometry temp2) public Geo? Geom() => MEOSFactory.WrapGeo(Meos.TrgeometryGeom(this.Ptr)); - public new Temporal? InstantN(int n) - => MEOSFactory.WrapTemporal(Meos.TrgeometryInstantN(this.Ptr, n)); - - public new Temporal?[] Instants() - => MEOSFactory.WrapTemporalArray(Meos.TrgeometryInstants(this.Ptr)); - public bool Left(TRGeometry temp2) => Meos.LeftTspatialTspatial(this.Ptr, temp2.Ptr); public double Length() => Meos.TrgeometryLength(this.Ptr); - public new Temporal? Merge(Temporal temp2) - => MEOSFactory.WrapTemporal(Meos.TrgeometryMerge(this.Ptr, temp2.Ptr)); - public Temporal? MinusGeom(Geo gs) => MEOSFactory.WrapTemporal(Meos.TrgeometryMinusGeom(this.Ptr, gs.Ptr)); public Temporal? MinusStbox(STBox box, bool border_inc) => MEOSFactory.WrapTemporal(Meos.TrgeometryMinusStbox(this.Ptr, box.Ptr, border_inc)); - public new Temporal? MinusTimestamptz(DateTime t) - => MEOSFactory.WrapTemporal(Meos.TrgeometryMinusTimestamptz(this.Ptr, MEOSConvert.ToTimestampTz(t))); - - public new Temporal? MinusTstzset(Set s) - => MEOSFactory.WrapTemporal(Meos.TrgeometryMinusTstzset(this.Ptr, s.Ptr)); - - public new Temporal? MinusTstzspan(Span s) - => MEOSFactory.WrapTemporal(Meos.TrgeometryMinusTstzspan(this.Ptr, s.Ptr)); - - public new Temporal? MinusTstzspanset(SpanSet ss) - => MEOSFactory.WrapTemporal(Meos.TrgeometryMinusTstzspanset(this.Ptr, ss.Ptr)); - public Temporal? MinusValue(Pose pose) => MEOSFactory.WrapTemporal(Meos.TrgeometryMinusValue(this.Ptr, pose.Ptr)); - public new Temporal? MinusValues(Set s) - => MEOSFactory.WrapTemporal(Meos.TrgeometryMinusValues(this.Ptr, s.Ptr)); - public double Nad(Geometry gs) => Meos.NadTrgeometryGeo(this.Ptr, gs.Ptr); @@ -335,24 +261,9 @@ public bool Right(TRGeometry temp2) public Temporal? RotateZ(double angle) => MEOSFactory.WrapTemporal(Meos.TrgeometryRotateZ(this.Ptr, angle)); - public new Temporal? Round(int maxdd) - => MEOSFactory.WrapTemporal(Meos.TrgeometryRound(this.Ptr, maxdd)); - public bool Same(TRGeometry temp2) => Meos.SameTspatialTspatial(this.Ptr, temp2.Ptr); - public new Temporal?[] Segments() - => MEOSFactory.WrapTemporalArray(Meos.TrgeometrySegments(this.Ptr)); - - public new Temporal? SequenceN(int i) - => MEOSFactory.WrapTemporal(Meos.TrgeometrySequenceN(this.Ptr, i)); - - public new Temporal?[] Sequences() - => MEOSFactory.WrapTemporalArray(Meos.TrgeometrySequences(this.Ptr)); - - public new Temporal? SetInterp(string interp) - => MEOSFactory.WrapTemporal(Meos.TrgeometrySetInterp(this.Ptr, Meos.InterptypeFromString(interp))); - public Geo? Shortestline(Geometry gs) => MEOSFactory.WrapGeo(Meos.ShortestlineTrgeometryGeo(this.Ptr, gs.Ptr)); @@ -388,12 +299,6 @@ public bool Same(TRGeometry temp2) public STBox?[] SplitNStboxes(int box_count) => MEOSFactory.WrapSTBoxArray(Meos.TrgeometrySplitNStboxes(this.Ptr, box_count)); - public new Temporal? StartInstant() - => MEOSFactory.WrapTemporal(Meos.TrgeometryStartInstant(this.Ptr)); - - public new Temporal? StartSequence() - => MEOSFactory.WrapTemporal(Meos.TrgeometryStartSequence(this.Ptr)); - public Geo? StartValue() => MEOSFactory.WrapGeo(Meos.TrgeometryStartValue(this.Ptr)); @@ -547,24 +452,5 @@ public bool Same(TRGeometry temp2) public static Temporal? In(string str) => MEOSFactory.WrapTemporal(Meos.TrgeometryIn(str)); - public new static Temporal? MergeArray(Temporal[] temparr) - { - IntPtr[] _temparrValues = new IntPtr[temparr.Length]; - for (int i = 0; i < temparr.Length; i++) - { - _temparrValues[i] = temparr[i].Ptr; - } - - GCHandle _temparr = GCHandle.Alloc(_temparrValues, GCHandleType.Pinned); - try - { - return MEOSFactory.WrapTemporal(Meos.TrgeometryMergeArray(_temparr.AddrOfPinnedObject(), temparr.Length)); - } - finally - { - _temparr.Free(); - } - } - } } diff --git a/MEOS.NET/Types/TS2Cell.g.cs b/MEOS.NET/Types/TS2Cell.g.cs index 8ed5f08..62a11dd 100644 --- a/MEOS.NET/Types/TS2Cell.g.cs +++ b/MEOS.NET/Types/TS2Cell.g.cs @@ -27,20 +27,20 @@ public bool Adjacent(TS2Cell temp2) public bool After(TS2Cell temp2) => Meos.AfterTspatialTspatial(this.Ptr, temp2.Ptr); - public int AlwaysEq(ulong cell) - => Meos.AlwaysEqTs2cellS2cell(this.Ptr, cell); + public int AlwaysEq(S2Cell cell) + => Meos.AlwaysEqTs2cellS2cell(this.Ptr, cell.value); public int AlwaysEq(TS2Cell temp2) => Meos.AlwaysEqTs2cellTs2cell(this.Ptr, temp2.Ptr); - public int AlwaysNe(ulong cell) - => Meos.AlwaysNeTs2cellS2cell(this.Ptr, cell); + public int AlwaysNe(S2Cell cell) + => Meos.AlwaysNeTs2cellS2cell(this.Ptr, cell.value); public int AlwaysNe(TS2Cell temp2) => Meos.AlwaysNeTs2cellTs2cell(this.Ptr, temp2.Ptr); - public Temporal? AtValue(ulong cell) - => MEOSFactory.WrapTemporal(Meos.Ts2cellAtValue(this.Ptr, cell)); + public Temporal? AtValue(S2Cell cell) + => MEOSFactory.WrapTemporal(Meos.Ts2cellAtValue(this.Ptr, cell.value)); public bool Before(TS2Cell temp2) => Meos.BeforeTspatialTspatial(this.Ptr, temp2.Ptr); @@ -57,20 +57,20 @@ public bool Contained(TS2Cell temp2) public bool Contains(TS2Cell temp2) => Meos.ContainsTspatialTspatial(this.Ptr, temp2.Ptr); - public ulong EndValue() - => Meos.Ts2cellEndValue(this.Ptr); + public S2Cell EndValue() + => new S2Cell(Meos.Ts2cellEndValue(this.Ptr)); public int EverEq(S2CellSet cells) => Meos.EverEqTs2cellS2cellset(this.Ptr, cells.Ptr); - public int EverEq(ulong cell) - => Meos.EverEqTs2cellS2cell(this.Ptr, cell); + public int EverEq(S2Cell cell) + => Meos.EverEqTs2cellS2cell(this.Ptr, cell.value); public int EverEq(TS2Cell temp2) => Meos.EverEqTs2cellTs2cell(this.Ptr, temp2.Ptr); - public int EverNe(ulong cell) - => Meos.EverNeTs2cellS2cell(this.Ptr, cell); + public int EverNe(S2Cell cell) + => Meos.EverNeTs2cellS2cell(this.Ptr, cell.value); public int EverNe(TS2Cell temp2) => Meos.EverNeTs2cellTs2cell(this.Ptr, temp2.Ptr); @@ -81,8 +81,8 @@ public int EverNe(TS2Cell temp2) public bool Left(TS2Cell temp2) => Meos.LeftTspatialTspatial(this.Ptr, temp2.Ptr); - public Temporal? MinusValue(ulong cell) - => MEOSFactory.WrapTemporal(Meos.Ts2cellMinusValue(this.Ptr, cell)); + public Temporal? MinusValue(S2Cell cell) + => MEOSFactory.WrapTemporal(Meos.Ts2cellMinusValue(this.Ptr, cell.value)); public bool Overabove(TS2Cell temp2) => Meos.OveraboveTspatialTspatial(this.Ptr, temp2.Ptr); @@ -105,41 +105,41 @@ public bool Overleft(TS2Cell temp2) public bool Overright(TS2Cell temp2) => Meos.OverrightTspatialTspatial(this.Ptr, temp2.Ptr); - public int RalwaysEq(ulong cell) - => Meos.AlwaysEqS2cellTs2cell(cell, this.Ptr); + public int RalwaysEq(S2Cell cell) + => Meos.AlwaysEqS2cellTs2cell(cell.value, this.Ptr); - public int RalwaysNe(ulong cell) - => Meos.AlwaysNeS2cellTs2cell(cell, this.Ptr); + public int RalwaysNe(S2Cell cell) + => Meos.AlwaysNeS2cellTs2cell(cell.value, this.Ptr); - public int ReverEq(ulong cell) - => Meos.EverEqS2cellTs2cell(cell, this.Ptr); + public int ReverEq(S2Cell cell) + => Meos.EverEqS2cellTs2cell(cell.value, this.Ptr); - public int ReverNe(ulong cell) - => Meos.EverNeS2cellTs2cell(cell, this.Ptr); + public int ReverNe(S2Cell cell) + => Meos.EverNeS2cellTs2cell(cell.value, this.Ptr); public bool Right(TS2Cell temp2) => Meos.RightTspatialTspatial(this.Ptr, temp2.Ptr); - public Temporal? Rteq(ulong cell) - => MEOSFactory.WrapTemporal(Meos.TeqS2cellTs2cell(cell, this.Ptr)); + public Temporal? Rteq(S2Cell cell) + => MEOSFactory.WrapTemporal(Meos.TeqS2cellTs2cell(cell.value, this.Ptr)); - public Temporal? Rtne(ulong cell) - => MEOSFactory.WrapTemporal(Meos.TneS2cellTs2cell(cell, this.Ptr)); + public Temporal? Rtne(S2Cell cell) + => MEOSFactory.WrapTemporal(Meos.TneS2cellTs2cell(cell.value, this.Ptr)); public bool Same(TS2Cell temp2) => Meos.SameTspatialTspatial(this.Ptr, temp2.Ptr); - public ulong StartValue() - => Meos.Ts2cellStartValue(this.Ptr); + public S2Cell StartValue() + => new S2Cell(Meos.Ts2cellStartValue(this.Ptr)); - public Temporal? Teq(ulong cell) - => MEOSFactory.WrapTemporal(Meos.TeqTs2cellS2cell(this.Ptr, cell)); + public Temporal? Teq(S2Cell cell) + => MEOSFactory.WrapTemporal(Meos.TeqTs2cellS2cell(this.Ptr, cell.value)); public Temporal? Teq(TS2Cell temp2) => MEOSFactory.WrapTemporal(Meos.TeqTs2cellTs2cell(this.Ptr, temp2.Ptr)); - public Temporal? Tne(ulong cell) - => MEOSFactory.WrapTemporal(Meos.TneTs2cellS2cell(this.Ptr, cell)); + public Temporal? Tne(S2Cell cell) + => MEOSFactory.WrapTemporal(Meos.TneTs2cellS2cell(this.Ptr, cell.value)); public Temporal? Tne(TS2Cell temp2) => MEOSFactory.WrapTemporal(Meos.TneTs2cellTs2cell(this.Ptr, temp2.Ptr)); @@ -150,17 +150,17 @@ public ulong StartValue() public Temporal? ToTgeompoint() => MEOSFactory.WrapTemporal(Meos.Ts2cellToTgeompoint(this.Ptr)); - public (SpanSet?[], ulong[]) Unnest() + public (SpanSet?[], S2Cell[]) Unnest() { var _answered = Meos.Ts2cellUnnest(this.Ptr); - return (MEOSFactory.WrapSpanSetArray(_answered.Item1), _answered.Item2); + return (MEOSFactory.WrapSpanSetArray(_answered.Item1), Array.ConvertAll(_answered.Item2, v => new S2Cell(v))); } - public ulong Value() - => Meos.Ts2cellValue(this.Ptr); + public S2Cell Value() + => new S2Cell(Meos.Ts2cellValue(this.Ptr)); - public ulong? ValueAtTimestamptz(DateTime t, bool strict) + public S2Cell? ValueAtTimestamptz(DateTime t, bool strict) { IntPtr _result = Marshal.AllocHGlobal(8); try @@ -170,7 +170,7 @@ public ulong Value() return null; } - return Marshal.PtrToStructure(_result); + return new S2Cell(Marshal.PtrToStructure(_result)); } finally { @@ -178,7 +178,7 @@ public ulong Value() } } - public ulong? ValueN(int n) + public S2Cell? ValueN(int n) { IntPtr _result = Marshal.AllocHGlobal(8); try @@ -188,7 +188,7 @@ public ulong Value() return null; } - return Marshal.PtrToStructure(_result); + return new S2Cell(Marshal.PtrToStructure(_result)); } finally { @@ -196,11 +196,11 @@ public ulong Value() } } - public ulong[] Values() - => Meos.Ts2cellValues(this.Ptr); + public S2Cell[] Values() + => Array.ConvertAll(Meos.Ts2cellValues(this.Ptr), v => new S2Cell(v)); - public static Temporal? FromBaseTemp(ulong value, Temporal temp) - => MEOSFactory.WrapTemporal(Meos.Ts2cellFromBaseTemp(value, temp.Ptr)); + public static Temporal? FromBaseTemp(S2Cell value, Temporal temp) + => MEOSFactory.WrapTemporal(Meos.Ts2cellFromBaseTemp(value.value, temp.Ptr)); public static Temporal? FromEWKB(byte[] wkb) => Temporal.FromWKB(wkb); diff --git a/MEOS.NET/Types/TS2CellInst.g.cs b/MEOS.NET/Types/TS2CellInst.g.cs index e8069f3..907071d 100644 --- a/MEOS.NET/Types/TS2CellInst.g.cs +++ b/MEOS.NET/Types/TS2CellInst.g.cs @@ -14,8 +14,8 @@ public class TS2CellInst : TS2Cell { internal TS2CellInst(IntPtr ptr) : base(ptr) { } - public static Temporal? Make(ulong value, DateTime t) - => MEOSFactory.WrapTemporal(Meos.Ts2cellinstMake(value, MEOSConvert.ToTimestampTz(t))); + public static Temporal? Make(S2Cell value, DateTime t) + => MEOSFactory.WrapTemporal(Meos.Ts2cellinstMake(value.value, MEOSConvert.ToTimestampTz(t))); } } diff --git a/MEOS.NET/Types/TS2CellSeq.g.cs b/MEOS.NET/Types/TS2CellSeq.g.cs index 50215b2..6fb17c0 100644 --- a/MEOS.NET/Types/TS2CellSeq.g.cs +++ b/MEOS.NET/Types/TS2CellSeq.g.cs @@ -14,13 +14,13 @@ public class TS2CellSeq : TS2Cell { internal TS2CellSeq(IntPtr ptr) : base(ptr) { } - public static Temporal? FromBaseTstzset(ulong value, Set s) - => MEOSFactory.WrapTemporal(Meos.Ts2cellseqFromBaseTstzset(value, s.Ptr)); + public static Temporal? FromBaseTstzset(S2Cell value, Set s) + => MEOSFactory.WrapTemporal(Meos.Ts2cellseqFromBaseTstzset(value.value, s.Ptr)); - public static Temporal? FromBaseTstzspan(ulong value, Span s) - => MEOSFactory.WrapTemporal(Meos.Ts2cellseqFromBaseTstzspan(value, s.Ptr)); + public static Temporal? FromBaseTstzspan(S2Cell value, Span s) + => MEOSFactory.WrapTemporal(Meos.Ts2cellseqFromBaseTstzspan(value.value, s.Ptr)); - public static Temporal? Make(ulong[] values, long[] times, bool lower_inc, bool upper_inc) + public static Temporal? Make(S2Cell[] values, long[] times, bool lower_inc, bool upper_inc) { if (values.Length != times.Length) { diff --git a/MEOS.NET/Types/TS2CellSeqSet.g.cs b/MEOS.NET/Types/TS2CellSeqSet.g.cs index 6fe1554..55c976f 100644 --- a/MEOS.NET/Types/TS2CellSeqSet.g.cs +++ b/MEOS.NET/Types/TS2CellSeqSet.g.cs @@ -14,8 +14,8 @@ public class TS2CellSeqSet : TS2Cell { internal TS2CellSeqSet(IntPtr ptr) : base(ptr) { } - public static Temporal? FromBaseTstzspanset(ulong value, SpanSet ss) - => MEOSFactory.WrapTemporal(Meos.Ts2cellseqsetFromBaseTstzspanset(value, ss.Ptr)); + public static Temporal? FromBaseTstzspanset(S2Cell value, SpanSet ss) + => MEOSFactory.WrapTemporal(Meos.Ts2cellseqsetFromBaseTstzspanset(value.value, ss.Ptr)); public static Temporal? Make(Temporal[] sequences) { diff --git a/MEOS.NET/Types/TText.g.cs b/MEOS.NET/Types/TText.g.cs index ea6ff3f..416c6ea 100644 --- a/MEOS.NET/Types/TText.g.cs +++ b/MEOS.NET/Types/TText.g.cs @@ -60,6 +60,9 @@ public int AlwaysNe(Text txt) public int AlwaysNe(TText temp2) => Meos.AlwaysNeTemporalTemporal(this.Ptr, temp2.Ptr); + public int AlwaysOverlaps(TText temp2) + => Meos.AlwaysOverlapsTemporalTemporal(this.Ptr, temp2.Ptr); + public string AsText(int maxdd) => this.Out(maxdd); @@ -114,6 +117,9 @@ public int EverNe(Text txt) public int EverNe(TText temp2) => Meos.EverNeTemporalTemporal(this.Ptr, temp2.Ptr); + public int EverOverlaps(TText temp2) + => Meos.EverOverlapsTemporalTemporal(this.Ptr, temp2.Ptr); + public Temporal? Initcap() => MEOSFactory.WrapTemporal(Meos.TtextInitcap(this.Ptr)); diff --git a/MEOS.NET/Types/Temporal.g.cs b/MEOS.NET/Types/Temporal.g.cs index c2ac2fd..4e0e161 100644 --- a/MEOS.NET/Types/Temporal.g.cs +++ b/MEOS.NET/Types/Temporal.g.cs @@ -41,6 +41,9 @@ public int AlwaysLt(Temporal temp2) public int AlwaysNe(Temporal temp2) => Meos.AlwaysNeTemporalTemporal(this.Ptr, temp2.Ptr); + public int AlwaysOverlaps(Temporal temp2) + => Meos.AlwaysOverlapsTemporalTemporal(this.Ptr, temp2.Ptr); + public Temporal? AppendTinstant(Temporal inst, string interp, double maxdist, Interval maxt, bool expand) { IntPtr _maxt = Marshal.AllocHGlobal(Marshal.SizeOf()); @@ -193,6 +196,9 @@ public int EverLt(Temporal temp2) public int EverNe(Temporal temp2) => Meos.EverNeTemporalTemporal(this.Ptr, temp2.Ptr); + public int EverOverlaps(Temporal temp2) + => Meos.EverOverlapsTemporalTemporal(this.Ptr, temp2.Ptr); + public Temporal? ExtKalmanFilter(double gate, double q, double variance, bool to_drop) => MEOSFactory.WrapTemporal(Meos.TemporalExtKalmanFilter(this.Ptr, gate, q, variance, to_drop)); diff --git a/MEOS.NET/Types/TsTzSpan.g.cs b/MEOS.NET/Types/TsTzSpan.g.cs index d90f161..f9477bd 100644 --- a/MEOS.NET/Types/TsTzSpan.g.cs +++ b/MEOS.NET/Types/TsTzSpan.g.cs @@ -158,6 +158,15 @@ public bool After(TS2Cell temp) public bool After(TText temp) => Meos.AfterTstzspanTemporal(this.Ptr, temp.Ptr); + public int AlwaysOverlaps(TAlpha temp) + => Meos.AlwaysOverlapsTstzspanTemporal(this.Ptr, temp.Ptr); + + public int AlwaysOverlaps(TBool temp) + => Meos.AlwaysOverlapsTstzspanTemporal(this.Ptr, temp.Ptr); + + public int AlwaysOverlaps(TText temp) + => Meos.AlwaysOverlapsTstzspanTemporal(this.Ptr, temp.Ptr); + public string AsText(int maxdd) => this.Out(maxdd); @@ -400,6 +409,15 @@ public bool Contains(TText temp) public Interval? Duration() => MEOSConvert.ToStruct(Meos.TstzspanDuration(this.Ptr)); + public int EverOverlaps(TAlpha temp) + => Meos.EverOverlapsTstzspanTemporal(this.Ptr, temp.Ptr); + + public int EverOverlaps(TBool temp) + => Meos.EverOverlapsTstzspanTemporal(this.Ptr, temp.Ptr); + + public int EverOverlaps(TText temp) + => Meos.EverOverlapsTstzspanTemporal(this.Ptr, temp.Ptr); + public Span? Expand(Interval interv) { IntPtr _interv = Marshal.AllocHGlobal(Marshal.SizeOf()); diff --git a/MEOS.NET/Types/Value.g.cs b/MEOS.NET/Types/Value.g.cs index f19fd22..4cf1806 100644 --- a/MEOS.NET/Types/Value.g.cs +++ b/MEOS.NET/Types/Value.g.cs @@ -8,7 +8,7 @@ namespace MEOS.NET.Types { - /// Base values MEOS passes by reference. + /// Base values a binding holds as instances: those MEOS passes by reference, and the grid cells, which it passes by value. [System.CodeDom.Compiler.GeneratedCode("MEOS.NET.ObjectGen", "0.1.0")] public class Value : MEOSObject { diff --git a/tools/README.md b/tools/README.md index 22546e1..39a3e51 100644 --- a/tools/README.md +++ b/tools/README.md @@ -74,6 +74,16 @@ struct starts with the Temporal header, so a `TInstant *` or `TSequence *` return is a `Temporal` at the surface whose runtime class is the concrete one. +A class the model marks `byValue` — a grid cell, `H3Index`, `Quadbin`, +`S2Cell` — is a value MEOS passes by value rather than through a pointer, +so it is a `readonly record struct` holding the scalar of its `cType` +(`S2CellId` is a `uint64_t`, a `ulong`), equal where the scalars are equal, +with explicit conversions from and to that scalar. Its methods receive the +value it holds, and every parameter, return, out-parameter and array the +catalog types with that `cType` is the struct: `TH3Index.StartValue()` +answers an `H3Index`, `Geo.ToQuadbinCell` a `Quadbin`. It reads and writes +its formats under the portable names, and its `ToString` is its text. + The operators the model assigns a class (`classes..operators`) are built the same way, one overload of the method their `ooName` names: `ever_eq_tfloat_float` is `TFloat.EverEq(double)` beside the inherited diff --git a/tools/objectgen.py b/tools/objectgen.py index 1e07da4..c97d76c 100644 --- a/tools/objectgen.py +++ b/tools/objectgen.py @@ -201,6 +201,11 @@ def __init__(self, idl: dict): } self.parent: dict[str, str | None] = {} self.ctype: dict[str, str] = {} + # C typedef -> the class the catalog marks `byValue` for it (a grid + # cell: `H3Index`, `Quadbin`, `S2CellId`), and that typedef -> the C + # type it is at the ABI, as the catalog's slots naming it state it. + self.value_of: dict[str, str] = {} + self.value_canonical: dict[str, str] = {} self.meostype: dict[str, str] = {} # class -> its MeosType constant self.subtype_of: dict[str, str] = {} # concrete class -> template subtype self.wrap_root: dict[str, str] = {} # C struct -> the class it wraps as @@ -272,10 +277,29 @@ def _build(self) -> None: if spec.get("cType"): self.ctype[name] = spec["cType"] + # A class the catalog marks `byValue` holds its value, never a pointer: + # its `cType` is the typedef MEOS passes by value, which each slot naming + # it states beside its `canonical` (`"typedef": "H3Index"` on a + # `uint64_t`). It is a C# value type, and a value type has no base + # class, so it stands outside the hierarchy its model parent heads; nor + # is it the class a pointer is wrapped in. The by-value counterpart of + # #wrap_root below, which maps a pointer. + for name, spec in self.om["classes"].items(): + if spec.get("byValue") and spec.get("cType"): + self.value_of[spec["cType"]] = name + self.parent[name] = None + for f in self.idl["functions"]: + for slot in [f["returnType"]] + list(f.get("params", [])): + typedef = slot.get("typedef") + if typedef in self.value_of and "*" not in slot["canonical"]: + self.value_canonical.setdefault(typedef, clean(slot["canonical"])) + # A pointer to a C struct is wrapped in the SHALLOWEST class carrying it, # so a `GSERIALIZED *` is a Geo and its Geometry and Geography leaves stay # distinct classes under it, exactly as a `Set *` is a Set. for name, ct in self.ctype.items(): + if ct in self.value_of: + continue best = self.wrap_root.get(ct) if best is None or self._depth(name) < self._depth(best): self.wrap_root[ct] = name @@ -343,6 +367,15 @@ def class_for_ctype(self, c_type: str) -> str | None: return "Temporal" return self.wrap_root.get(base) + def class_for_value(self, slot: dict | None) -> str | None: + """The class a value MEOS passes BY VALUE is held in, beside + #class_for_ctype, which answers it for a pointer: the class the catalog + marks `byValue` for the typedef the slot names, `th3index_value` + answering an H3Index. A pointer to such a value (an array of cells, an + out-parameter) is the slot's typedef too, and its element is the class + as well; the caller reads which of the two the slot is.""" + return self.value_of.get((slot or {}).get("typedef")) + class Method: """One emitted method: its C# signature and the wrapper call behind it.""" @@ -471,6 +504,14 @@ def map_return(self, f: dict, wrapper_ret: str) -> tuple[str, str] | None: return ("DateTime", "MEOSConvert.ToDateTime($)") if c == "DateADT": return ("DateOnly", "MEOSConvert.ToDateOnly($)") + # A value of a class held by value (#class_for_value) is the class + # around the scalar the wrapper answers, and an array of them is the + # class's array, as a pointer return is wrapped in its class below. + value = self.m.class_for_value(f["returnType"]) + if value and "*" not in c and is_scalar(wrapper_ret): + return (value, f"new {value}($)") + if value and wrapper_ret.endswith("[]") and is_scalar(wrapper_ret[:-2]): + return (f"{value}[]", f"Array.ConvertAll($, v => new {value}(v))") if wrapper_ret in ("string", "string?"): return (wrapper_ret, "$") text = self.enum_text(c) if c in codegen.ENUM_TYPES else None @@ -642,6 +683,19 @@ def scalar_out_reader(self, pointee: str, where: str) -> tuple[str, int, str] | return None return (cs_type, size, f"Marshal.PtrToStructure<{cs_type}>({{0}})") + def value_out_reader(self, pointee: str, value: str | None, + where: str) -> tuple[str, int, str] | None: + """The reader for a value of a class held by value (#class_for_value) + MEOS writes through a pointer: the scalar #scalar_out_reader reads, + held in that class, as #wrapped_out_reader wraps the address it reads + in the class a pointer is wrapped in.""" + if value is None or pointee.count("*") != 1: + return None + scalar = self.scalar_out_reader(pointee, where) + if scalar is None: + return None + return (value, scalar[1], f"new {value}({scalar[2]})") + def wrapped_out_reader(self, pointee: str) -> tuple[str, int, str] | None: """The reader for a value MEOS writes through a pointer to a pointer. @@ -675,11 +729,16 @@ def map_tuple_return(self, f: dict, wrapper_ret: str) -> tuple[str, str] | None: first = ((array_ret.get("element") or {}).get("canonical") if array_ret else f["returnType"]["canonical"]) params = {p["name"]: p["canonical"] for p in f.get("params", [])} + slots = {p["name"]: p for p in f.get("params", [])} # `TYPE **bins` is an out-ARRAY of `TYPE`, so two stars come off: one # for the handle MEOS writes through, one for the array itself. c_types = [first] + [ clean(params.get(a["param"], "")).rstrip("* ").strip() for a in shape.get("outputArrays") or []] + # The class each item's values are held in by value, if any. + values = [self.m.class_for_value(f["returnType"])] + [ + self.m.class_for_value(slots.get(a["param"])) + for a in shape.get("outputArrays") or []] pieces = [p.strip() for p in tuple_ret[1:-1].split(",")] if len(pieces) != len(c_types) or not all(c_types): return None @@ -687,9 +746,11 @@ def map_tuple_return(self, f: dict, wrapper_ret: str) -> tuple[str, str] | None: types, readers = [], [] for i, (piece, c_type) in enumerate(zip(pieces, c_types)): if i == 0 and not array_ret: - mapped = self.map_value_item(piece, clean(c_type), item.format(1)) + mapped = self.map_value_item(piece, clean(c_type), item.format(1), + values[i]) else: - mapped = self.map_array_item(piece, clean(c_type), item.format(i + 1)) + mapped = self.map_array_item(piece, clean(c_type), item.format(i + 1), + values[i]) if mapped is None: return None types.append(mapped[0]) @@ -702,21 +763,25 @@ def map_tuple_return(self, f: dict, wrapper_ret: str) -> tuple[str, str] | None: f"$|>_answered is null ? null : {reads}") return (f"({', '.join(types)})", f"$|>{reads}") - def map_value_item(self, piece: str, c_type: str, - item: str) -> tuple[str, str] | None: + def map_value_item(self, piece: str, c_type: str, item: str, + value: str | None = None) -> tuple[str, str] | None: """The value item of an answered tuple, read as #map_return reads a - value of its own: a MEOS value wraps into its class, a scalar is handed - on.""" + value of its own: a MEOS value wraps into its class, a value of a class + held by value is that class, a scalar is handed on.""" if piece == "IntPtr": cls = self.m.class_for_ctype(c_type) return (f"{cls}?", f"MEOSFactory.Wrap{cls}({item})") if cls else None + if value and is_scalar(piece): + return (value, f"new {value}({item})") if is_scalar(piece): return (piece, item) return None - def map_array_item(self, piece: str, c_type: str, - item: str) -> tuple[str, str] | None: + def map_array_item(self, piece: str, c_type: str, item: str, + value: str | None = None) -> tuple[str, str] | None: """One item of an answered tuple: its C# type and how it is read.""" + if value and piece.endswith("[]") and is_scalar(piece[:-2]): + return (f"{value}[]", f"Array.ConvertAll({item}, v => new {value}(v))") if piece == "IntPtr[]": cls = (self.m.class_for_ctype(c_type) or self.m.class_for_ctype(f"{c_type} *")) @@ -753,9 +818,16 @@ def enum_text(self, c: str) -> dict | None: return text return None - def map_param(self, c_type: str, cs_type: str, name: str) -> tuple[str, str] | None: - """``(csharp_type, argument expression)`` for one parameter, or None.""" + def map_param(self, c_type: str, cs_type: str, name: str, + value: str | None = None) -> tuple[str, str] | None: + """``(csharp_type, argument expression)`` for one parameter, or None. + + `value` is the class the parameter's value is held in by value + (#class_for_value): the caller passes that class and the call the + scalar it holds, as a pointer's class passes its `Ptr`.""" c = clean(c_type) + if value and "*" not in c and is_scalar(cs_type): + return (value, f"{name}.value") if c in ("TimestampTz", "Timestamp"): return ("DateTime", f"MEOSConvert.ToTimestampTz({name})") if c == "DateADT": @@ -808,6 +880,13 @@ def method_for(self, cls: str, entry: dict) -> Method | None: (codegen.csharp_param_name(p["name"]) if p["name"] else "arg"): p["canonical"] for p in f.get("params", []) } + # The class each parameter's value is held in by value, if any. + value_by_name = { + (codegen.csharp_param_name(p["name"]) if p["name"] else "arg"): + self.m.class_for_value(p) + for p in f.get("params", []) + } + by_value = cls in self.m.value_of.values() # An array ARGUMENT is one parameter to the caller and two to MEOS, the # pointer and its length. Which parameters those are is the catalog's to @@ -827,8 +906,12 @@ def method_for(self, cls: str, entry: dict) -> Method | None: params = list(wrapper_params) static = True args: list[str] = [] + # A class held by value receives its own value rather than a pointer + # to it (#class_for_value). if (len(params) > at - and clean(c_by_name.get(params[at][1], "")) == f"{recv_ctype} *"): + and (clean(c_by_name.get(params[at][1], "")) == f"{recv_ctype} *" + or (by_value and value_by_name.get(params[at][1]) == cls + and "*" not in c_by_name.get(params[at][1], "")))): static = False params = params[:at] + params[at + 1:] elif operator: @@ -894,6 +977,9 @@ def method_for(self, cls: str, entry: dict) -> Method | None: if p["name"] == name), "")) reader = (OUT_PARAM_READERS.get(pointee) or self.wrapped_out_reader(pointee) + or self.value_out_reader( + pointee, value_by_name.get(codegen.csharp_param_name(name)), + f"{fname} parameter {name}") or self.scalar_out_reader(pointee, f"{fname} parameter {name}")) if reader: result_outs.append((codegen.csharp_param_name(name), reader)) @@ -981,11 +1067,14 @@ def method_for(self, cls: str, entry: dict) -> Method | None: args.append(scratch(pname)) continue # A scalar element is the array itself: the values need no - # gathering, so what is pinned is the caller's own array. + # gathering, so what is pinned is the caller's own array. An + # element held by value in a class (#class_for_value) is that + # class, a struct of the one scalar, laid out as the scalar is, + # so its array is pinned the same way. scalar = codegen.scalar_cs( pointee, f"{fname} parameter {pname} (array element)") if scalar is not None: - sig.append((f"{scalar}[]", pname)) + sig.append((f"{value_by_name.get(pname) or scalar}[]", pname)) scalar_arrays.append(pname) args.append(f"{scratch(pname)}.AddrOfPinnedObject()") continue @@ -993,7 +1082,8 @@ def method_for(self, cls: str, entry: dict) -> Method | None: f"argument {pname} is an array of " f"{pointee}, which has no class") return None - mapped = self.map_param(c_by_name.get(pname, ""), cs_type, pname) + mapped = self.map_param(c_by_name.get(pname, ""), cs_type, pname, + value_by_name.get(pname)) if mapped is None: self.defer(cls, oo, "argument needs a class", f"argument {pname} of type " @@ -1012,7 +1102,7 @@ def method_for(self, cls: str, entry: dict) -> Method | None: if not static: # Every other parameter gave the call one argument in its own place, # so the receiver's goes back where the wrapper takes it. - args.insert(at, "this.Ptr") + args.insert(at, "this.value" if by_value else "this.Ptr") call = f"Meos.{codegen.public_name(fname)}({', '.join(args)})" outs = [(name, size, reader.format(scratch(name))) for name, (_t, size, reader) in result_outs] @@ -1293,11 +1383,16 @@ def emit_class(self, cls: str) -> str: "{", f" /// {self.doc_for(cls)}", f' [System.CodeDom.Compiler.GeneratedCode("MEOS.NET.ObjectGen", "{GENERATOR_VERSION}")]', - f" public class {cls} : {parent}", - " {", - f" internal {cls}(IntPtr ptr) : base(ptr) {{ }}", - "", ] + if cls in self.m.value_of.values(): + lines += self.value_head(cls) + else: + lines += [ + f" public class {cls} : {parent}", + " {", + f" internal {cls}(IntPtr ptr) : base(ptr) {{ }}", + "", + ] lines += self.to_string(cls, functions) for m in methods: args = ", ".join(f"{t} {ident(n)}" for t, n in m.params) @@ -1312,6 +1407,31 @@ def emit_class(self, cls: str) -> str: lines += [" }", "}", ""] return "\n".join(lines) + def value_head(self, cls: str) -> list[str]: + """The head of a class the catalog marks `byValue` (#class_for_value): + a value type holding the scalar MEOS passes, as a pointer's class holds + the `Ptr` it passes (#base_file), with an equality of the value and the + two conversions from and to the scalar, as #held_struct_file declares a + struct of values a record struct.""" + ctype = self.m.ctype[cls] + scalar = codegen.scalar_cs(self.m.value_canonical[ctype], f"class {cls}") + return [ + f" public readonly record struct {cls}", + " {", + f" /// The {ctype} MEOS passes this value as.", + f" internal readonly {scalar} value;", + "", + f" /// The {cls} MEOS passes as .", + f" public {cls}({scalar} value) => this.value = value;", + "", + f" /// The {ctype} MEOS passes this value as.", + f" public static explicit operator {scalar}({cls} self) => self.value;", + "", + f" /// The {cls} MEOS passes as .", + f" public static explicit operator {cls}({scalar} value) => new {cls}(value);", + "", + ] + def call_body(self, method: Method) -> list[str]: """The body of a method whose call needs something around it.