dellisd / spatial-k

Spatial K - A set of Kotlin Multiplatform Libraries for working with geospatial data
https://dellisd.github.io/spatial-k
MIT License
65 stars 11 forks source link

Add support for GeoJSON foreign members #128

Open tukez opened 6 months ago

tukez commented 6 months ago

Could this library support GeoJSON foreign members? https://datatracker.ietf.org/doc/html/rfc7946#section-6.1

In short, Feature, FeatureCollection and Geometry should allow custom fields of any type in addition to the fields defined in the spec. This would allow this library to work with GeoJSON extensions.

As implementation, a field: foreignMembers: Map<String, JsonElement>, would be enough.

P72B commented 3 weeks ago

You can still put your foreignMembers into the properties field.

I see a danger in having foreignMembers allowed in this lib because other geojson libs/parser will may break during schema validation.