Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-9964

GeoJSONResponseWriter produces multiple GeometryCollections

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 6.3
    • None
    • Response Writers, spatial
    • None
    • solr:latest in Docker for Mac (1.13.0-rc5-beta35 (14875))

    Description

      When this SpatialRecursivePrefixTreeFieldType

      "GEOMETRYCOLLECTION (POINT (5.184892 52.043278), MULTILINESTRING ((5.12150188 52.0912345, 5.12151772 52.091203, 5.12158176 52.0912144), (5.12154184 52.0900637, 5.121529 52.090092)))"

      is retrieved using the GeoJSONRepsonseWriter JSON is returned that included multiple GeometryCollections while only one GeometryCollection should have been created.

      The output I get is
      {"type":"GeometryCollection","geometries": [

      {"type":"Point","coordinates":[5.184892,52.043278]}

      ,{"type":"GeometryCollection","geometries": [

      {"type":"LineString","coordinates": [[5.121502,52.091234],[5.121518,52.091203],[5.121582,52.091214]]}

      ,

      {"type":"LineString","coordinates": [[5.121542,52.090064],[5.121529,52.090092]]}

      ]}]}

      The expected output would be

      {"type":"GeometryCollection","geometries":[

      {"type":"Point","coordinates":[5.184892,52.043278]}

      ,

      {"type":"MultiLineString","coordinates":[[[5.12150188,52.0912345],[5.12151772,52.091203],[5.12158176,52.0912144]],[[5.12154184,52.0900637],[5.121529,52.090092]]]}

      ]}

      or optionally

      {"type":"GeometryCollection","geometries": [

      {"type":"Point","coordinates":[5.184892,52.043278]}

      ,

      {"type":"LineString","coordinates": [[5.121502,52.091234],[5.121518,52.091203],[5.121582,52.091214]]}

      ,

      {"type":"LineString","coordinates": [[5.121542,52.090064],[5.121529,52.090092]]}

      ]}

      The most recent GeoJSON spec states:

      "To maximize interoperability, implementations SHOULD avoid nested
      GeometryCollections. " (https://tools.ietf.org/html/rfc7946)

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            renevoorburg René Voorburg

            Dates

              Created:
              Updated:

              Slack

                Issue deployment