Details
-
New Feature
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
With minor changes, we can modify the existing JSON writer to produce a GeoJSON `FeatureCollection` for ever SolrDocumentList. We can then pick a field to use as the geometry type, and use that for the Feature#geometry
"response":{"type":"FeatureCollection","numFound":1,"start":0,"features":[ {"type":"Feature", "geometry":{"type":"Point","coordinates":[1,2]}, "properties":{ ... the normal solr doc fields here ...}}] }}
This will allow adding solr results directly to various mapping clients like Leaflet
This patch will work with Documents that have a spatial field the either:
1. Extends AbstractSpatialFieldType
2. has a stored value with geojson
2. has a stored value that can be parsed by spatial4j (WKT, etc)
The spatial field is identified with the parameter `geojson.field`