@@ -20,7 +20,7 @@ func TestFeature(t *testing.T) {
20
20
unmarshalErr : `unknown geometry type: ""` ,
21
21
},
22
22
"Point" : {
23
- ft : Feature {}.WithPoint (& Point {- 170.0 , 40.0 }),
23
+ ft : Feature {}.WithPoint (Point {- 170.0 , 40.0 }),
24
24
json : `{"type":"Feature","geometry":{"coordinates":[-170,40],"type":"Point"}}` ,
25
25
raw : []float64 {- 170 , 40 },
26
26
},
@@ -30,28 +30,28 @@ func TestFeature(t *testing.T) {
30
30
Properties : map [string ]any {
31
31
"foo" : "bar" ,
32
32
},
33
- }.WithPoint (& Point {- 170.0 , 40.0 }),
33
+ }.WithPoint (Point {- 170.0 , 40.0 }),
34
34
json : `{"id":"abc","type":"Feature","geometry":{"coordinates":[-170,40],"type":"Point"},"properties":{"foo":"bar"}}` ,
35
35
},
36
36
"MultiPoint" : {
37
37
ft : Feature {}.WithMultiPoint (
38
- & MultiPoint {
38
+ MultiPoint {
39
39
{- 170.0 , 40.0 },
40
40
}),
41
41
raw : [][]float64 {{- 170 , 40 }},
42
42
json : `{"type":"Feature","geometry":{"coordinates":[[-170,40]],"type":"MultiPoint"}}` ,
43
43
},
44
44
"LineString" : {
45
45
ft : Feature {}.WithLineString (
46
- & LineString {
46
+ LineString {
47
47
{- 170.0 , 40.0 },
48
48
}),
49
49
raw : [][]float64 {{- 170 , 40 }},
50
50
json : `{"type":"Feature","geometry":{"coordinates":[[-170,40]],"type":"LineString"}}` ,
51
51
},
52
52
"MultiLineString" : {
53
53
ft : Feature {}.WithMultiLineString (
54
- & MultiLineString {
54
+ MultiLineString {
55
55
{
56
56
{- 170.0 , 40.0 },
57
57
},
@@ -61,7 +61,7 @@ func TestFeature(t *testing.T) {
61
61
},
62
62
"Polygon" : {
63
63
ft : Feature {}.WithPolygon (
64
- & Polygon {
64
+ Polygon {
65
65
{
66
66
{- 170.0 , 40.0 },
67
67
},
@@ -71,7 +71,7 @@ func TestFeature(t *testing.T) {
71
71
},
72
72
"MultiPolygon" : {
73
73
ft : Feature {}.WithMultiPolygon (
74
- & MultiPolygon {
74
+ MultiPolygon {
75
75
{
76
76
{
77
77
{- 170.0 , 40.0 },
@@ -84,9 +84,9 @@ func TestFeature(t *testing.T) {
84
84
"GeometryCollection" : {
85
85
ft : Feature {}.WithGeometryCollection (
86
86
GeometryCollection {}.AppendPoint (
87
- & Point {- 170.0 , 40.0 },
87
+ Point {- 170.0 , 40.0 },
88
88
).AppendPolygon (
89
- & Polygon {
89
+ Polygon {
90
90
{
91
91
{- 170.0 , 40.0 },
92
92
},
@@ -119,42 +119,42 @@ func TestFeature(t *testing.T) {
119
119
case GeometryTypePoint :
120
120
got , ok := tt .ft .AsPoint ()
121
121
assert .True (t , ok )
122
- assert .IsType (t , & Point {}, got )
122
+ assert .IsType (t , Point {}, got )
123
123
if tt .raw != nil {
124
124
assert .Equal (t , tt .raw , got .Raw ())
125
125
}
126
126
case GeometryTypeMultiPoint :
127
127
got , ok := tt .ft .AsMultiPoint ()
128
128
assert .True (t , ok )
129
- assert .IsType (t , & MultiPoint {}, got )
129
+ assert .IsType (t , MultiPoint {}, got )
130
130
if tt .raw != nil {
131
131
assert .Equal (t , tt .raw , got .Raw ())
132
132
}
133
133
case GeometryTypeLineString :
134
134
got , ok := tt .ft .AsLineString ()
135
135
assert .True (t , ok )
136
- assert .IsType (t , & LineString {}, got )
136
+ assert .IsType (t , LineString {}, got )
137
137
if tt .raw != nil {
138
138
assert .Equal (t , tt .raw , got .Raw ())
139
139
}
140
140
case GeometryTypeMultiLineString :
141
141
got , ok := tt .ft .AsMultiLineString ()
142
142
assert .True (t , ok )
143
- assert .IsType (t , & MultiLineString {}, got )
143
+ assert .IsType (t , MultiLineString {}, got )
144
144
if tt .raw != nil {
145
145
assert .Equal (t , tt .raw , got .Raw ())
146
146
}
147
147
case GeometryTypePolygon :
148
148
got , ok := tt .ft .AsPolygon ()
149
149
assert .True (t , ok )
150
- assert .IsType (t , & Polygon {}, got )
150
+ assert .IsType (t , Polygon {}, got )
151
151
if tt .raw != nil {
152
152
assert .Equal (t , tt .raw , got .Raw ())
153
153
}
154
154
case GeometryTypeMultiPolygon :
155
155
got , ok := tt .ft .AsMultiPolygon ()
156
156
assert .True (t , ok )
157
- assert .IsType (t , & MultiPolygon {}, got )
157
+ assert .IsType (t , MultiPolygon {}, got )
158
158
if tt .raw != nil {
159
159
assert .Equal (t , tt .raw , got .Raw ())
160
160
}
@@ -176,59 +176,59 @@ func TestFeatureIDJSONMarshall(t *testing.T) {
176
176
err string
177
177
}{
178
178
"string" : {
179
- ft : Feature {ID : "1" }.WithPoint (& Point {0 , 0 }),
179
+ ft : Feature {ID : "1" }.WithPoint (Point {0 , 0 }),
180
180
json : `{"id":"1","type":"Feature","geometry":{"coordinates":[0,0],"type":"Point"}}` ,
181
181
},
182
182
"uint" : {
183
- ft : Feature {ID : uint (1 )}.WithPoint (& Point {0 , 0 }),
183
+ ft : Feature {ID : uint (1 )}.WithPoint (Point {0 , 0 }),
184
184
json : `{"id":1,"type":"Feature","geometry":{"coordinates":[0,0],"type":"Point"}}` ,
185
185
},
186
186
"uint8" : {
187
- ft : Feature {ID : uint8 (1 )}.WithPoint (& Point {0 , 0 }),
187
+ ft : Feature {ID : uint8 (1 )}.WithPoint (Point {0 , 0 }),
188
188
json : `{"id":1,"type":"Feature","geometry":{"coordinates":[0,0],"type":"Point"}}` ,
189
189
},
190
190
"uint16" : {
191
- ft : Feature {ID : uint16 (1 )}.WithPoint (& Point {0 , 0 }),
191
+ ft : Feature {ID : uint16 (1 )}.WithPoint (Point {0 , 0 }),
192
192
json : `{"id":1,"type":"Feature","geometry":{"coordinates":[0,0],"type":"Point"}}` ,
193
193
},
194
194
"uint32" : {
195
- ft : Feature {ID : uint32 (1 )}.WithPoint (& Point {0 , 0 }),
195
+ ft : Feature {ID : uint32 (1 )}.WithPoint (Point {0 , 0 }),
196
196
json : `{"id":1,"type":"Feature","geometry":{"coordinates":[0,0],"type":"Point"}}` ,
197
197
},
198
198
"uint64" : {
199
- ft : Feature {ID : uint64 (1 )}.WithPoint (& Point {0 , 0 }),
199
+ ft : Feature {ID : uint64 (1 )}.WithPoint (Point {0 , 0 }),
200
200
json : `{"id":1,"type":"Feature","geometry":{"coordinates":[0,0],"type":"Point"}}` ,
201
201
},
202
202
"int" : {
203
- ft : Feature {ID : int (1 )}.WithPoint (& Point {0 , 0 }),
203
+ ft : Feature {ID : int (1 )}.WithPoint (Point {0 , 0 }),
204
204
json : `{"id":1,"type":"Feature","geometry":{"coordinates":[0,0],"type":"Point"}}` ,
205
205
},
206
206
"int8" : {
207
- ft : Feature {ID : int8 (1 )}.WithPoint (& Point {0 , 0 }),
207
+ ft : Feature {ID : int8 (1 )}.WithPoint (Point {0 , 0 }),
208
208
json : `{"id":1,"type":"Feature","geometry":{"coordinates":[0,0],"type":"Point"}}` ,
209
209
},
210
210
"int16" : {
211
- ft : Feature {ID : int16 (1 )}.WithPoint (& Point {0 , 0 }),
211
+ ft : Feature {ID : int16 (1 )}.WithPoint (Point {0 , 0 }),
212
212
json : `{"id":1,"type":"Feature","geometry":{"coordinates":[0,0],"type":"Point"}}` ,
213
213
},
214
214
"int32" : {
215
- ft : Feature {ID : int32 (1 )}.WithPoint (& Point {0 , 0 }),
215
+ ft : Feature {ID : int32 (1 )}.WithPoint (Point {0 , 0 }),
216
216
json : `{"id":1,"type":"Feature","geometry":{"coordinates":[0,0],"type":"Point"}}` ,
217
217
},
218
218
"int64" : {
219
- ft : Feature {ID : int64 (1 )}.WithPoint (& Point {0 , 0 }),
219
+ ft : Feature {ID : int64 (1 )}.WithPoint (Point {0 , 0 }),
220
220
json : `{"id":1,"type":"Feature","geometry":{"coordinates":[0,0],"type":"Point"}}` ,
221
221
},
222
222
"float32" : {
223
- ft : Feature {ID : float32 (1 )}.WithPoint (& Point {0 , 0 }),
223
+ ft : Feature {ID : float32 (1 )}.WithPoint (Point {0 , 0 }),
224
224
json : `{"id":1,"type":"Feature","geometry":{"coordinates":[0,0],"type":"Point"}}` ,
225
225
},
226
226
"float64" : {
227
- ft : Feature {ID : float64 (1 )}.WithPoint (& Point {0 , 0 }),
227
+ ft : Feature {ID : float64 (1 )}.WithPoint (Point {0 , 0 }),
228
228
json : `{"id":1,"type":"Feature","geometry":{"coordinates":[0,0],"type":"Point"}}` ,
229
229
},
230
230
"other type than int or string" : {
231
- ft : Feature {ID : true }.WithPoint (& Point {0 , 0 }),
231
+ ft : Feature {ID : true }.WithPoint (Point {0 , 0 }),
232
232
err : `json: error calling MarshalJSON for type joejson.Feature: invalid type "bool" for id, expected string or numeric` ,
233
233
},
234
234
}
@@ -258,15 +258,15 @@ func TestFeatureIDJSONUnmarshall(t *testing.T) {
258
258
}{
259
259
"string" : {
260
260
json : `{"id":"1","type":"Feature","geometry":{"coordinates":[0,0],"type":"Point"}}` ,
261
- ft : Feature {ID : "1" }.WithPoint (& Point {0 , 0 }),
261
+ ft : Feature {ID : "1" }.WithPoint (Point {0 , 0 }),
262
262
},
263
263
"integer" : {
264
264
json : `{"id":1,"type":"Feature","geometry":{"coordinates":[0,0],"type":"Point"}}` ,
265
- ft : Feature {ID : float64 (1 )}.WithPoint (& Point {0 , 0 }),
265
+ ft : Feature {ID : float64 (1 )}.WithPoint (Point {0 , 0 }),
266
266
},
267
267
"decimal" : {
268
268
json : `{"id":1.5,"type":"Feature","geometry":{"coordinates":[0,0],"type":"Point"}}` ,
269
- ft : Feature {ID : float64 (1.5 )}.WithPoint (& Point {0 , 0 }),
269
+ ft : Feature {ID : float64 (1.5 )}.WithPoint (Point {0 , 0 }),
270
270
},
271
271
"other type than numeric or string" : {
272
272
json : `{"id":true,"type":"Feature","geometry":{"coordinates":[0,0],"type":"Point"}}` ,
0 commit comments