René Voorburg created SOLR-9964:
-----------------------------------

             Summary: GeoJSONResponseWriter produces multiple 
GeometryCollections
                 Key: SOLR-9964
                 URL: https://issues.apache.org/jira/browse/SOLR-9964
             Project: Solr
          Issue Type: Bug
      Security Level: Public (Default Security Level. Issues are Public)
          Components: Response Writers, spatial
    Affects Versions: 6.3
         Environment: solr:latest in Docker for Mac (1.13.0-rc5-beta35 (14875))
            Reporter: René Voorburg
            Priority: Minor


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)





--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to