Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Depending on the granularity you need in your queries (and the variability of that granularity), one way to handle this would be to slice up your map into a grid, where all your locations belong inside a grid square with a defined lat/lon bounding box. You can then do your initial query for grid square IDs, followed by locations inside those squares, with a representation something like this:</p> <pre><code>GridSquareLat { key: [very_coarse_lat_value] { [square_lat_boundary]:[GridSquareIDList] [square_lat_boundary]:[GridSquareIDList] } ... } GridSquareLon { key: [very_coarse_lon_value] { [square_lon_boundary]:[GridSquareIDList] [square_lon_boundary]:[GridSquareIDList] } ... } Location { key: [locationID] { GridSquareID: [GridSquareID] &lt;-- put a secondary index on this col Lat: [exact_lat] Lon: [exact_lon] ... } ... } </code></pre> <p>You can then give Cassandra the GridSquareLat/Lon keys representing the very coarse grain lat/lon values, along with a column slice range that will reduce the columns returned to only those squares within your boundaries. You'll get two lists, one of grid square IDs for lat and one for lon. The intersection of these lists will be the grid squares in your range. </p> <p>To get the locations in these squares, query the Location CF, filtering on GridSquareID (using a secondary index, which will be efficient as long as your total grid square count is reasonable). You now have a reasonably sized list of locations with only a few very efficient queries, and you can easily reduce them to your exact list inside your application.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload