如何使用gorethinkdb的地理空间命令在Go语言中创建圆形?

huangapple go评论71阅读模式
英文:

How to make circle in go using gorethinkdb's geospatial commands

问题

如何使用gorethinkdb在Go语言中编写以下代码:

r.Circle([-117.220406, 32.719464], 10, map[string]interface{}{"unit": "mi"})
英文:

How to write the following code in go using gorethinkdb

r.circle([-117.220406,32.719464], 10, {:unit => 'mi'})

答案1

得分: 2

在这种特殊情况下,你可以按照以下方式使用r.Circle

import r "gopkg.in/dancannon/gorethink.v2"
...

r.Circle(r.Point(-117.220406, 32.719464), r.Expr(10), r.CircleOpts{Unit: "mi"})

你可以直接从文档中查看更多示例。

英文:

In this particular case, you can use r.Circle as follows:

import r "gopkg.in/dancannon/gorethink.v2"
...

r.Circle(r.Point(-117.220406, 32.719464), r.Expr(10), r.CircleOpts{Unit: "mi"})

You can check out more examples directly from the documentation

huangapple
  • 本文由 发表于 2016年11月15日 13:52:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/40602933.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定