-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_tgeogpoint.go
176 lines (142 loc) · 3.79 KB
/
main_tgeogpoint.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
package gomeos
/*
#include "meos.h"
#include <stdio.h>
#include <stdlib.h>
#include "cast.h"
*/
import "C"
import (
"time"
"unsafe"
)
type TGeogPointInst struct {
_inner *C.Temporal
}
func NewTGeogPointInst(tgmpi_in string) *TGeogPointInst {
c_tgmpi_in := C.CString(tgmpi_in)
defer C.free(unsafe.Pointer(c_tgmpi_in))
c_tgmpi := C.tgeogpoint_in(c_tgmpi_in)
g_tgmpi := TGeogPointInst{_inner: c_tgmpi}
return &g_tgmpi
}
func (tgmpi *TGeogPointInst) TPointOut(maxdd int) string {
c_tgmpi_out := C.tpoint_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 *TGeogPointInst) Inner() *C.Temporal {
return tgmpi._inner
}
func (tgmpi *TGeogPointInst) Init(c_temp *C.Temporal) {
tgmpi._inner = c_temp
}
func (tgmpi *TGeogPointInst) IsTGeogPoint() bool {
return true
}
func (tgmpi *TGeogPointInst) IsTPoint() bool {
return true
}
func (tgmpi *TGeogPointInst) String() string {
return tgmpi.TPointOut(10)
}
func (tgmpi *TGeogPointInst) Type() string {
return "TGeogPointInst"
}
func (tgmpi *TGeogPointInst) IsTInstant() bool {
return true
}
func (tgmpi *TGeomPointInst) Timestamptz() time.Time {
c_inst := C.cast_temporal_to_tinstant(tgmpi._inner)
return TimestamptzToDatetime(c_inst.t)
}
func (tgmpi *TGeomPointInst) TimestampOut() string {
c_inst := C.cast_temporal_to_tinstant(tgmpi._inner)
return C.GoString(C.pg_timestamptz_out(c_inst.t))
}
type TGeogPointSeq struct {
_inner *C.Temporal
}
func NewTGeogPointSeq(tgmpi_in string) TGeogPointSeq {
c_tgmpi_in := C.CString(tgmpi_in)
defer C.free(unsafe.Pointer(c_tgmpi_in))
c_tgmpi := C.tgeogpoint_in(c_tgmpi_in)
g_tgmpi := TGeogPointSeq{_inner: c_tgmpi}
return g_tgmpi
}
func (tgmpi *TGeogPointSeq) TPointOut(maxdd int) string {
c_tgmpi_out := C.tpoint_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 *TGeogPointSeq) Inner() *C.Temporal {
return tgmpi._inner
}
func (tgmpi *TGeogPointSeq) Init(c_temp *C.Temporal) {
tgmpi._inner = c_temp
}
func (tgmpi *TGeogPointSeq) IsTGeogPoint() bool {
return true
}
func (tgmpi *TGeogPointSeq) IsTPoint() bool {
return true
}
func (tgmpi *TGeogPointSeq) String() string {
return tgmpi.TPointOut(10)
}
func (tgmpi *TGeogPointSeq) Type() string {
return "TGeogPointSeq"
}
func (tgmpi *TGeogPointSeq) IsTSequence() bool {
return true
}
type TGeogPointSeqSet struct {
_inner *C.Temporal
}
func NewTGeogPointSeqSet(tgmpi_in string) *TGeogPointSeqSet {
c_tgmpi_in := C.CString(tgmpi_in)
defer C.free(unsafe.Pointer(c_tgmpi_in))
c_tgmpi := C.tgeogpoint_in(c_tgmpi_in)
g_tgmpi := &TGeogPointSeqSet{_inner: c_tgmpi}
return g_tgmpi
}
func (tgmpi *TGeogPointSeqSet) TPointOut(maxdd int) string {
c_tgmpi_out := C.tpoint_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 *TGeogPointSeqSet) Inner() *C.Temporal {
return tgmpi._inner
}
func (tgmpi *TGeogPointSeqSet) Init(c_temp *C.Temporal) {
tgmpi._inner = c_temp
}
func (tgmpi *TGeogPointSeqSet) IsTGeogPoint() bool {
return true
}
func (tgmpi *TGeogPointSeqSet) IsTPoint() bool {
return true
}
func (tgmpi *TGeogPointSeqSet) String() string {
return tgmpi.TPointOut(10)
}
func (tgmpi *TGeogPointSeqSet) Type() string {
return "TGeogPointSeqSet"
}
func TGeogPointIn[TG TGeogPoint](input string, output TG) TG {
c_str := C.CString(input)
defer C.free(unsafe.Pointer(c_str))
c_geogpoint := C.tgeogpoint_in(c_str)
output.Init(c_geogpoint)
return output
}
func TGeogPointFromMFJSON[TG TGeogPoint](input string, output TG) TG {
c_str := C.CString(input)
defer C.free(unsafe.Pointer(c_str))
c_geogpoint := C.tgeogpoint_from_mfjson(c_str)
output.Init(c_geogpoint)
return output
}