synw / geojson

Utilities to work with geojson data in Dart
MIT License
37 stars 51 forks source link

Serialization format mismatch #14

Closed duzenko closed 4 years ago

duzenko commented 4 years ago

Compare this two JSON's. The former is what I feed to geojson.parse and the latter is what I receive from GeoJsonFeatureCollection.serialize when I reconstruct the polygon to send back to the web.

{
  "id": 18,
  "name": "map-project-good.geojson",
  "data": {
    "type": "FeatureCollection",
    "features": [
      {
...
      }
    ]
  }
}
{
  "id": 23,
  "name": "Project 1.geojson",
  "data": {
    "name": "null",
    "type": "FeatureCollection",
    "features": [
      [
        {
...
        }
      ]
    ]
  }
}
synw commented 4 years ago

Thanks, good catch. About the serialization features I wrote them a while ago thinking that this lib needs serialization but I did not use them seriously already and did not write tests for it. That"s why it is not even documented yet.

As you are the guy that handles serialization in this library please let me know when you think that the serialization features work well and are clean, so we can document them publicly (and write tests!)

duzenko commented 4 years ago

Regret I only use a small portion of your library functionality so I can't really tell in general. It seems to work with coordinates but I also need custom properties as per https://github.com/synw/geojson/issues/15