mirror of https://github.com/tidwall/tile38.git
parent
d9c46a3f29
commit
29634f86ba
|
@ -55,11 +55,11 @@ type scanWriter struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type ScanWriterParams struct {
|
type ScanWriterParams struct {
|
||||||
id string
|
id string
|
||||||
o geojson.Object
|
o geojson.Object
|
||||||
fields []float64
|
fields []float64
|
||||||
distance float64
|
distance float64
|
||||||
noLock bool
|
noLock bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Controller) newScanWriter(
|
func (c *Controller) newScanWriter(
|
||||||
|
@ -386,16 +386,17 @@ func (sw *scanWriter) writeObject(opts ScanWriterParams) bool {
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
fvs := orderFields(sw.fmap, opts.fields)
|
if sw.hasFieldsOutput() {
|
||||||
if len(fvs) > 0 {
|
fvs := orderFields(sw.fmap, opts.fields)
|
||||||
fvals := make([]resp.Value, 0, len(fvs)*2)
|
if len(fvs) > 0 {
|
||||||
for i, fv := range fvs {
|
fvals := make([]resp.Value, 0, len(fvs)*2)
|
||||||
fvals = append(fvals, resp.StringValue(fv.field), resp.StringValue(strconv.FormatFloat(fv.value, 'f', -1, 64)))
|
for i, fv := range fvs {
|
||||||
i++
|
fvals = append(fvals, resp.StringValue(fv.field), resp.StringValue(strconv.FormatFloat(fv.value, 'f', -1, 64)))
|
||||||
|
i++
|
||||||
|
}
|
||||||
|
vals = append(vals, resp.ArrayValue(fvals))
|
||||||
}
|
}
|
||||||
vals = append(vals, resp.ArrayValue(fvals))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if opts.distance > 0 {
|
if opts.distance > 0 {
|
||||||
vals = append(vals, resp.FloatValue(opts.distance))
|
vals = append(vals, resp.FloatValue(opts.distance))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue