Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

How to get an Object back from a Nearby() #60

Open
prune998 opened this issue Feb 22, 2023 · 0 comments
Open

How to get an Object back from a Nearby() #60

prune998 opened this issue Feb 22, 2023 · 0 comments

Comments

@prune998
Copy link

prune998 commented Feb 22, 2023

It feels a Nearby() request can only be formated as t38c.FormatPoints.

My data is a GeoJson feature like:

NEARBY restos POINT 37.400900 -79.178500 6000
{"ok":true,"objects":[{"id":"node/5807785416","object":{"type":"Feature","geometry":{"type":"Point","coordinates":[-79.2233665,37.3977684]},"id":"node/5807785416","properties":{"@id":"node/5807785416","amenity":"fast_food","brand":"Chipotle","brand:wikidata":"Q465751","brand:wikipedia":"en:Chipotle Mexican Grill","cuisine":"mexican","diet:vegan":"yes","diet:vegetarian":"yes","name":"Chipotle","official_name":"Chipotle Mexican Grill","opening_hours":"Mo-Su 10:45-22:00","outdoor_seating":"yes","takeaway":"yes","toilets:access":"customers"}}}],"count":1,"cursor":0,"elapsed":"211.209µs"}

So how can I do to use the other fields like brand out of a command like

	response, err := db.Search.Nearby("restos", lat, lon, 60000).
        Format(t38c.FormatPoints).  <----------------------------------------
	Do(context.TODO())

Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant