tile38 icon indicating copy to clipboard operation
tile38 copied to clipboard

How to access GEOJSON object data with nearby query?

Open fmr683 opened this issue 7 years ago • 6 comments

Let's say I've GEO JSON data like this:

{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [6.892769, 79.855802] }, "properties": { "status": "F" } }

Now if I try the following query it's working:

NEARBY driver-info LIMIT 10 DISTANCE POINT 6.892769 79.855802

But I want to look for properties status value for each NEARBY query, how can do that? I tried many methods but nothing work.

fmr683 avatar May 30 '17 10:05 fmr683

Hi @fmr683, Currently it's not possible to get only the property status from the results. You must retrieve the entire object and filter on the client side.

tidwall avatar May 30 '17 17:05 tidwall

Hi tidwall,

Thanks for the quick response, is there a other way that I can save the status parameter and use it in the Nearby query and filter it by where clause? i.e NEARBY driver-info WHERE status = "F" POINT 6.892768 79.855809 2000 (I know this query won't work, but I'm just stating how am I expecting the result). Because I'm dealing with large number of data if I've to do in client end, I'm little afraid it'll be slow for the long run.

fmr683 avatar May 31 '17 09:05 fmr683

Unfortunately there isn't a way to do what you describe. The closest thing is the WHERE clause, but it's only for the numerical FIELD data. But I can see some real benefit for filtering on JSON data, and I'm going to consider this feature in a future release.

tidwall avatar May 31 '17 16:05 tidwall

Thanks for the quick response.

fmr683 avatar Jun 01 '17 06:06 fmr683

I would like to ask:

  • what are your thougths about this filtering feature - do you still think i would be good?
  • do you think about implementing it?
  • what would be your workaround for a use case like this?

Thanks!

supersexy avatar Mar 05 '19 10:03 supersexy

Any solution for the above issue..? Any example? @tidwall @fmr683.

Help Needed ..!

vishnutm avatar May 16 '20 04:05 vishnutm