Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-7153

give GeoPoint and LatLonPoint full polygon support


    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 6.1, 7.0
    • None
    • None
    • New


      These two geo impls have a very limited polygon support that does not support inner rings (holes) or multiple outer rings efficiently.

      Basically if you want to do this, you are left building crazy logic with booleanquery which will send memory into the gigabytes for a single query, needlessly.

      For example Russia polygon from geonames is 250KB of geojson and over a thousand outer rings.

      We should instead support this stuff with the queries themselves, especially it will allow us to implement things more efficiently in the future.

      I think instead of newPolygonQuery(double[], double[]) it should look like newPolygonQuery(Polygon...). A polygon can be a single outer ring (shape) with 0 or more inner rings (holes). No nesting, you just use multiply polygons if you e.g. have an island.

      See http://esri.github.io/geometry-api-java/doc/Polygon.html for visuals and examples. I indented their GeoJSON example:

        "coordinates": [
           // first polygon (order does not matter could have been last instead)
             // clockwise => outer ring
             // hole
           // second polygon (order does not matter, could have been first instead)
             // island


        1. LUCENE-7153.patch
          78 kB
          Robert Muir
        2. LUCENE-7153.patch
          73 kB
          Robert Muir
        3. LUCENE-7153.patch
          62 kB
          Robert Muir

        Issue Links



              Unassigned Unassigned
              rcmuir Robert Muir
              0 Vote for this issue
              4 Start watching this issue