Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.2, 7.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      Working with Polygon is a bit tricky today because you typically
      must use an external dependency to convert e.g. a GeoJSON string into
      Lucene's Polygon class ... I think this is a weakness in our API, and
      it clearly confuses users: http://markmail.org/thread/mpge4wqo7cfqm4i5

      So I created a simplistic GeoJSON parser to extract a single Polygon
      or MultiPolygon from a GeoJSON string, without any dependencies. The
      parser only handles the various ways that a single Polygon or
      MultiPolygon can appear in a GeoJSON string, and throws an exception
      otherwise.

      1. LUCENE-7380.patch
        27 kB
        Michael McCandless
      2. LUCENE-7380.patch
        27 kB
        Michael McCandless

        Activity

        Hide
        mikemccand Michael McCandless added a comment -

        Patch; I think it's close.

        It adds just one public API: Polygon.fromGeoJSON(String) returning Polygon[] because the MultiPolygon case allows more than one Polygon.

        Also, I confirmed it correctly parses the large polygons from
        https://github.com/hugoledoux/BIGpolygons

        Show
        mikemccand Michael McCandless added a comment - Patch; I think it's close. It adds just one public API: Polygon.fromGeoJSON(String) returning Polygon[] because the MultiPolygon case allows more than one Polygon . Also, I confirmed it correctly parses the large polygons from https://github.com/hugoledoux/BIGpolygons
        Hide
        rcmuir Robert Muir added a comment -

        I think we should advertise the method better at the top of the class?

        It makes the class way more usable: the ctor taking arrays of doubles might be useful for some generic framework like a server but its too hard (especially for more complicated cases like holes).

        Show
        rcmuir Robert Muir added a comment - I think we should advertise the method better at the top of the class? It makes the class way more usable: the ctor taking arrays of doubles might be useful for some generic framework like a server but its too hard (especially for more complicated cases like holes).
        Hide
        mikemccand Michael McCandless added a comment -

        Thanks Robert Muir, I added class level javadocs, and improved the ParseException throwing. I think it's ready.

        Show
        mikemccand Michael McCandless added a comment - Thanks Robert Muir , I added class level javadocs, and improved the ParseException throwing. I think it's ready.
        Hide
        rcmuir Robert Muir added a comment -

        +1

        Show
        rcmuir Robert Muir added a comment - +1
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 343f374b530fa71dc6102d74725b536f5f1367f3 in lucene-solr's branch refs/heads/master from Mike McCandless
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=343f374 ]

        LUCENE-7380: add Polygon.fromGeoJSON

        Show
        jira-bot ASF subversion and git services added a comment - Commit 343f374b530fa71dc6102d74725b536f5f1367f3 in lucene-solr's branch refs/heads/master from Mike McCandless [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=343f374 ] LUCENE-7380 : add Polygon.fromGeoJSON
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 573aaf75f52f446c8b7ab915eefd420013c544a1 in lucene-solr's branch refs/heads/branch_6x from Mike McCandless
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=573aaf7 ]

        LUCENE-7380: add Polygon.fromGeoJSON

        Show
        jira-bot ASF subversion and git services added a comment - Commit 573aaf75f52f446c8b7ab915eefd420013c544a1 in lucene-solr's branch refs/heads/branch_6x from Mike McCandless [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=573aaf7 ] LUCENE-7380 : add Polygon.fromGeoJSON
        Hide
        mikemccand Michael McCandless added a comment -

        Bulk close resolved issues after 6.2.0 release.

        Show
        mikemccand Michael McCandless added a comment - Bulk close resolved issues after 6.2.0 release.

          People

          • Assignee:
            mikemccand Michael McCandless
            Reporter:
            mikemccand Michael McCandless
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development