hobuinc / greyhound

Greyhound is a point cloud streaming server. It should be considered deprecated for now. Use Entwine and Entwine Point Tile directly if you just want to serve point cloud web services.
https://greyhound.io
Apache License 2.0
131 stars 51 forks source link

Add query filtering. #32

Closed connormanning closed 8 years ago

connormanning commented 8 years ago

This PR allows Mongo-style comparison query operators and logical query operators to be passed to read requests to filter data. Filters can apply arbitrarily nested logic to select points, and are passed via the filter query parameter.

An error handling case has also been improved, and a case that could cause streaming to hang has been fixed.

Samples: Select a tile by its origin ID:

filter={"Origin": 5}

Select a tile by a substring of its original path:

filter={"Path":"tile-845.laz"}

Select multiple tiles with classification filter:

filter={"Path":{"$in":["tile-845.laz", "tile-846.laz"]}, "Classification":{"$ne":18}}

Logical OR:

filter={"$or":[
    {"Red":{"$gt":200}},
    {"Blue":{"$gt":120,"$lt":130}},
    {"Classification":{"$nin":[2,3]}}
]}