Closed mrisney closed 5 years ago
I'm not sure I want to change from null to {} by default. From the spec it's clear that null is valid. What is the issue you are having with GeoTools?
org.geotools.data.geojson.GeoJSONDataStore bombs out when trying to pass in a GeoJSON with properties:null. Workaround is
GeoJSONWriter writer = new GeoJSONWriter(); GeoJSON geoJSONObj = writer.write(features); String geoJSONStr = geoJSONObj.toString().replaceAll("null", "{}");
This is ugly.
To me, this seems like an issue with GeoTools.
Running into an issue when using Geotools, GeoDataFactory. When parsing the GeoJSON, if no properties are present, getting a null instead of an empty pair of brackets. Is there a way the properties map could be configured so that properties : {} could be output instead of properties:null ?
Jackson 2.9 adds new properties to existing (but rarely used) @JsonSetter annotation to allow specifying one of common alternatives.
propose that org.wololo.geojson.Feature use the @JsonSetter annotation :