venicegeo/geojson-go

Empty properties not handled correctly

Closed this issue · 3 comments

When a feature is marshalled and has a nil (or otherwise empty) map for its properties, then the properties field is omitted. This is invalid geojson as per https://datatracker.ietf.org/doc/rfc7946/?include_text=1 :

A Feature object has a member with the name "properties".  The
      value of the properties member is an object (any JSON object or a
      JSON null value).

This causes the generated geojson to be rejected by some parsers, e.g. the one at geojson.io.

#10 merged, so this should be fixed.

Thank you! :D