Skip to content

How to get Geometry data. #414

@xiaoyusilen

Description

@xiaoyusilen

(。・∀・)ノ゙Hi, I'm using rethinkDB to storage geometry data. But when I want to get data from rethinkdb, I got trouble.
My code:

		resp, err = r.DB(db).Table(table).Filter(map[string]string{
			"id": id,
		}).Field("gps").Field("location").Run(c)

		var re interface{}

		err = resp.One(&re)

		if err != nil {
			log.Error(err)
		}

I got data like below, type was nil,

{Point {116.77940333333333 39.948335} [] []}

I change the type of re to types.Geometry, error message I got like this,

gorethink: could not decode type types.Geometry into Go value of type *types.Geometry: pseudo-type GEOMETRY object is not valid

Or, how to use ToGeoJSON?
Thx~ @dancannon

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions