Version Information:
- SF GeoJSON Java Version: 3.3.3
Expected Results:
According to the specification the following fields should be printed as an empty array inside the JSON:
features in FeatureCollection
coordinates in all geometries
geometries in GeometryCollection
Observed Results:
The fields are omitted entirely inside the JSON.
This causes parse errors in other spec-compliant software such as maplibre.
Relevant Code:
static void main() {
System.out.println(FeatureConverter.toStringValue(new FeatureCollection()));
}
Additional Information:
This is caused by @JsonInclude(Include.NON_EMPTY) in the GeoJsonObject class. It should probably be added on the individual fields where it's needed only.
Version Information:
Expected Results:
According to the specification the following fields should be printed as an empty array inside the JSON:
featuresinFeatureCollectioncoordinatesin all geometriesgeometriesinGeometryCollectionObserved Results:
The fields are omitted entirely inside the JSON.
This causes parse errors in other spec-compliant software such as maplibre.
Relevant Code:
Additional Information:
This is caused by
@JsonInclude(Include.NON_EMPTY)in theGeoJsonObjectclass. It should probably be added on the individual fields where it's needed only.