Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Select locations in range of longitude and latitude as well as categories matching one of many

I have locations saved in the database, each of which having a longitude and latitude and a category. I run a query that passes a maximum and minimum longitude/latitude and selects all the locations inside that range (longitude is less than max longitude and greater than max longitude and same for latitude). This works fine but the problem I am having is also adding a filter that will select locations that also only have the categories supplied. For example the categories could be outdoors and food and I want to select all the locations in that range with those categories. I have selecting the locations within the latitude/longitude range working however adding filters for the categories I am struggling with. At first this is what I tried in the filters section with those categories
(AND) latitude <= maxLatitude
(AND) latitude >= minLatitude
(AND) longitude <= maxLongitude
(AND) longitude >= minLongitude
(AND) category == Outdoors
(OR) category == Food.
This results in all the locations in that range AS WELL AS any other locations with the categories of outdoors or food whether they are in that search area or not. This is exactly what I expected to have happen and I was wondering if there was any way to make the logic more like: latitude in range && longitude in range && (category == food || category == outdoors).

If anything was unclear let me know and I can clear it up. Basically I am trying to select locations in a certain longitude and latitude range that have one of many possible categories. Thanks!

Tagged:

Comments

  • (AND) latitude <= maxLatitude
    (AND) latitude >= minLatitude
    (AND) longitude <= maxLongitude
    (AND) longitude >= minLongitude
    (AND) category == Outdoors
    (OR) category == Food.
    This results in all the locations in that range AS WELL AS any other locations with the > categories of outdoors or food whether they are in that search area or not.

    I was wrong. This results in all the locations in the range that are of category outdoors as well as any other locations with the category 'food' whether it be in or out of the range.

  • Hey Coal175 - are you still working on this issue? Be sure to drop a line to support@kumulos.com so we can look into it.

This discussion has been closed.