Solr
  1. Solr
  2. SOLR-2609

Allow arbitrary bbox lat-lon, not limited to circle

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 3.1
    • Fix Version/s: None
    • Component/s: spatial
    • Labels:

      Description

      The Spatial Search documentation states that you can create your own bounding box using a range query:
      "Since the LatLonType field also supports field queries and range queries, one can manually create their own bounding box rather than using bbox: ...&q=:&fq=store:[45,-94 TO 46,-93]"

      This works unless your range covers an area where longitude goes from 180 to -180. For instance I want all items in the longitude range of
      178 to -177 which of course gives no results (it is not a valid numeric range). It's not really surprising that this doesn't work as it is just a standard range query with no spatial filters being applied.

      UPDATE
      Updated issue to be an enhancement, title changed.

      Desired functionality is for bbox to accept coordinate parameters for an arbitrary size bounding box. The bbox should take into account the prime meridians, in particular the 180th meridian.
      Documentation also needs to be updated to remove incorrect query example.

        Activity

        Hide
        David Smiley added a comment -

        I highly doubt this can be fixed, based on how it works. The documentation/wiki should be updated to note this problem.

        I recommend you use bbox: http://wiki.apache.org/solr/SpatialSearch#bbox_-_Bounding-box_filter
        Granted you cannot specify an arbitrary bounding box, only one based on a point-distance, but this may be good enough.

        Show
        David Smiley added a comment - I highly doubt this can be fixed, based on how it works. The documentation/wiki should be updated to note this problem. I recommend you use bbox: http://wiki.apache.org/solr/SpatialSearch#bbox_-_Bounding-box_filter Granted you cannot specify an arbitrary bounding box, only one based on a point-distance, but this may be good enough.
        Hide
        Zac Smith added a comment -

        It would be really great if there was support for creating arbitrary bounding boxes that do work over the 180th meridian.
        Should this be changed from a bug to a feature request to that end?

        Show
        Zac Smith added a comment - It would be really great if there was support for creating arbitrary bounding boxes that do work over the 180th meridian. Should this be changed from a bug to a feature request to that end?
        Hide
        David Smiley added a comment -

        Yes, this should be a feature request for "Allow arbitrary bbox lat-lon, not limited to circle". Under the hood, I recall the first order of business is resolving the point-radius to a bounding box. At that point the special prime-meridian logic is handled. It seems it would not be hard to make a patch that ads new parameters for explicit lat-lon bbox params.

        Show
        David Smiley added a comment - Yes, this should be a feature request for "Allow arbitrary bbox lat-lon, not limited to circle". Under the hood, I recall the first order of business is resolving the point-radius to a bounding box. At that point the special prime-meridian logic is handled. It seems it would not be hard to make a patch that ads new parameters for explicit lat-lon bbox params.
        Hide
        Zac Smith added a comment -

        Thanks David, I have updated this to be a feature request.

        Show
        Zac Smith added a comment - Thanks David, I have updated this to be a feature request.

          People

          • Assignee:
            Unassigned
            Reporter:
            Zac Smith
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development