Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cast.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
#define gunion_spanset_spanset union_spanset_spanset


#include <stddef.h>
#include "meos.h"
#include "meos_geo.h"
#include <stdio.h>
#include <stdlib.h>

Expand Down
14 changes: 7 additions & 7 deletions geo.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,55 +17,55 @@ type Geom struct {
func NewGeom(geom_str string, typemod int) Geom {
c_geom_str := C.CString(geom_str)
defer C.free(unsafe.Pointer(c_geom_str))
c_geom := C.pgis_geometry_in(c_geom_str, C.int(typemod))
c_geom := C.geom_in(c_geom_str, C.int(typemod))
g := Geom{_inner: c_geom}
return g
}

func PgisGeometryIn(input string, typemod int) *Geom {
c_geom_str := C.CString(input)
defer C.free(unsafe.Pointer(c_geom_str))
c_geom := C.pgis_geometry_in(c_geom_str, C.int(typemod))
c_geom := C.geom_in(c_geom_str, C.int(typemod))
g := &Geom{_inner: c_geom}
return g
}

func PgisGeographyIn(input string, typemod int) *Geom {
c_geom_str := C.CString(input)
defer C.free(unsafe.Pointer(c_geom_str))
c_geom := C.pgis_geography_in(c_geom_str, C.int(typemod))
c_geom := C.geog_in(c_geom_str, C.int(typemod))
g := &Geom{_inner: c_geom}
return g
}

func GeographyFromHexEwkb(input string) *Geom {
c_geom_str := C.CString(input)
defer C.free(unsafe.Pointer(c_geom_str))
c_geom := C.geography_from_hexewkb(c_geom_str)
c_geom := C.geog_from_hexewkb(c_geom_str)
g := &Geom{_inner: c_geom}
return g
}

func GeometryFromHexEwkb(input string) *Geom {
c_geom_str := C.CString(input)
defer C.free(unsafe.Pointer(c_geom_str))
c_geom := C.geometry_from_hexewkb(c_geom_str)
c_geom := C.geom_from_hexewkb(c_geom_str)
g := &Geom{_inner: c_geom}
return g
}

func GeographyFromText(input string, srid int) *Geom {
c_geom_str := C.CString(input)
defer C.free(unsafe.Pointer(c_geom_str))
c_geom := C.geography_from_text(c_geom_str, C.int(srid))
c_geom := C.geo_from_text(c_geom_str, C.int(srid))
g := &Geom{_inner: c_geom}
return g
}

func GeometryFromText(input string, srid int) *Geom {
c_geom_str := C.CString(input)
defer C.free(unsafe.Pointer(c_geom_str))
c_geom := C.geometry_from_text(c_geom_str, C.int(srid))
c_geom := C.geo_from_text(c_geom_str, C.int(srid))
g := &Geom{_inner: c_geom}
return g
}
Expand Down
2 changes: 1 addition & 1 deletion main_temporal.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func TemporalTPrecision[T Temporal](temp T, duration timeutil.Timedelta, start t
// TemporalAppendTInstant Append an instant to a temporal value
func TemporalAppendTInstant[T Temporal, TI TInstant](temp T, inst TI, max_dist float64, max_time timeutil.Timedelta, expand bool) Temporal {
m := TimeDeltaToInterval(max_time)
res := C.temporal_append_tinstant(temp.Inner(), C.cast_temporal_to_tinstant(inst.Inner()), C.double(max_dist), &m, C.bool(expand))
res := C.temporal_append_tinstant(temp.Inner(), C.cast_temporal_to_tinstant(inst.Inner()), C.interpType(C.INTERP_NONE), C.double(max_dist), &m, C.bool(expand))
return CreateTemporal(res)
}

Expand Down
6 changes: 3 additions & 3 deletions main_tfloat.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ func TFloatValueAtTimestamp[TF TFloat](tf TF, ts time.Time) float64 {

// TFloatDerivative Return the derivative of a temporal number
func TFloatDerivative[TF TFloat](tf TF) Temporal {
return CreateTemporal(C.tfloat_derivative(tf.Inner()))
return CreateTemporal(C.temporal_derivative(tf.Inner()))
}

// TFloatToDegrees Return a temporal number transformed from radians to degrees
Expand All @@ -391,7 +391,7 @@ func TFloatToRadians[TF TFloat](tf TF) Temporal {

// TFloatRound Return a temporal float with the precision of the values set to a number of decimal places
func TFloatRound[TF TFloat](tf TF, max_decimals int) Temporal {
return CreateTemporal(C.tfloat_round(tf.Inner(), C.int(max_decimals)))
return CreateTemporal(C.temporal_round(tf.Inner(), C.int(max_decimals)))
}

// TFloatShiftValue Return a temporal integer whose value dimension is shifted by a value
Expand Down Expand Up @@ -465,7 +465,7 @@ func DivFloatTFloat[TF TFloat](value float64, tf TF) Temporal {

// DistanceTFloatFloat returns the temporal distance between a temporal float and a constant float.
func DistanceTFloatFloat[TF TFloat](tf TF, value float64) Temporal {
c_temp := C.distance_tfloat_float(tf.Inner(), C.double(value))
c_temp := C.tdistance_tfloat_float(tf.Inner(), C.double(value))
return CreateTemporal(c_temp)
}

Expand Down
6 changes: 3 additions & 3 deletions main_tgeogpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func NewTGeogPointInst(tgmpi_in string) *TGeogPointInst {
}

func (tgmpi *TGeogPointInst) TPointOut(maxdd int) string {
c_tgmpi_out := C.tpoint_as_text(tgmpi._inner, C.int(maxdd))
c_tgmpi_out := C.tspatial_as_text(tgmpi._inner, C.int(maxdd))
defer C.free(unsafe.Pointer(c_tgmpi_out))
tgmpi_out := C.GoString(c_tgmpi_out)
return tgmpi_out
Expand Down Expand Up @@ -82,7 +82,7 @@ func NewTGeogPointSeq(tgmpi_in string) TGeogPointSeq {
}

func (tgmpi *TGeogPointSeq) TPointOut(maxdd int) string {
c_tgmpi_out := C.tpoint_as_text(tgmpi._inner, C.int(maxdd))
c_tgmpi_out := C.tspatial_as_text(tgmpi._inner, C.int(maxdd))
defer C.free(unsafe.Pointer(c_tgmpi_out))
tgmpi_out := C.GoString(c_tgmpi_out)
return tgmpi_out
Expand Down Expand Up @@ -129,7 +129,7 @@ func NewTGeogPointSeqSet(tgmpi_in string) *TGeogPointSeqSet {
}

func (tgmpi *TGeogPointSeqSet) TPointOut(maxdd int) string {
c_tgmpi_out := C.tpoint_as_text(tgmpi._inner, C.int(maxdd))
c_tgmpi_out := C.tspatial_as_text(tgmpi._inner, C.int(maxdd))
defer C.free(unsafe.Pointer(c_tgmpi_out))
tgmpi_out := C.GoString(c_tgmpi_out)
return tgmpi_out
Expand Down
8 changes: 4 additions & 4 deletions main_tgeompoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ func NewEmptyTGeomPointInst() TGeomPointInst {
}

func (tgmpi *TGeomPointInst) TPointOut(maxdd int) string {
c_tgmpi_out := C.tpoint_as_text(tgmpi._inner, C.int(maxdd))
c_tgmpi_out := C.tspatial_as_text(tgmpi._inner, C.int(maxdd))
defer C.free(unsafe.Pointer(c_tgmpi_out))
tgmpi_out := C.GoString(c_tgmpi_out)
return tgmpi_out
}

func (tgmpi *TGeomPointInst) TInstantOut(maxdd int) string {
c_tgmpi_out := C.tpoint_as_text(tgmpi._inner, C.int(maxdd))
c_tgmpi_out := C.tspatial_as_text(tgmpi._inner, C.int(maxdd))
defer C.free(unsafe.Pointer(c_tgmpi_out))
tgmpi_out := C.GoString(c_tgmpi_out)
return tgmpi_out
Expand Down Expand Up @@ -93,7 +93,7 @@ func NewTGeomPointSeqFromWKB(tgmpi_in string) *TGeomPointSeq {
}

func (tgmpi *TGeomPointSeq) TPointOut(maxdd int) string {
c_tgmpi_out := C.tpoint_as_text(tgmpi._inner, C.int(maxdd))
c_tgmpi_out := C.tspatial_as_text(tgmpi._inner, C.int(maxdd))
defer C.free(unsafe.Pointer(c_tgmpi_out))
tgmpi_out := C.GoString(c_tgmpi_out)
return tgmpi_out
Expand Down Expand Up @@ -144,7 +144,7 @@ func NewTGeomPointSeqSet(tgmpi_in string) *TGeomPointSeqSet {
}

func (tgmpi *TGeomPointSeqSet) TPointOut(maxdd int) string {
c_tgmpi_out := C.tpoint_as_text(tgmpi._inner, C.int(maxdd))
c_tgmpi_out := C.tspatial_as_text(tgmpi._inner, C.int(maxdd))
defer C.free(unsafe.Pointer(c_tgmpi_out))
tgmpi_out := C.GoString(c_tgmpi_out)
return tgmpi_out
Expand Down
2 changes: 1 addition & 1 deletion main_tnumber.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func TNumberDeltaValue[TN TNumber](tn TN) Temporal {

// DistanceTNumberTNumber returns the temporal distance between two temporal numbers.
func DistanceTNumberTNumber[TN1 TNumber, TN2 TNumber](tn1 TN1, tn2 TN2) Temporal {
c_temp := C.distance_tnumber_tnumber(tn1.Inner(), tn2.Inner())
c_temp := C.tdistance_tnumber_tnumber(tn1.Inner(), tn2.Inner())
return CreateTemporal(c_temp)
}

Expand Down
Loading