-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GeoJSON Reader and FeatureCollection json #16
Comments
I try to take a look as soon as possible. |
as suspected, reader expects "geometry" property before "properties" property. |
I see, I am going to try with that. On Wed Nov 05 2014 at 1:00:58 PM Diego Guidi notifications@github.com
|
should be fixed now |
Many thanks. |
actually, no nuget release is planned yet. my suggest: "use the source", that should be close to latest nuget release. |
Any nuget release planned for this bugfix yet? I can build from source, but it would be much easier to just install a new bugfix release from nuget... 😄 |
as said here... actually, no. |
One thing you can try is to use a serializer, remove the broken converter and replace it (I am replacing geometry converter, you would probably replace featureconverter) |
The reader still expects 'properties' to come after 'type'. It's still valid geojson if 'properties' comes before 'type'. Can we fix this? |
@xivk can you post some sample code? I've made some checks but I'm unable to reproduce the error... |
It was this geojson file: https://gist.github.com/xivk/43308e73c29356e8c17f399ba68ca196 I'm not able to create a test-project right now... on holiday sorry. But if I remember correctly this failed to deserialise. I see now that the 'properties' part is missing entirely. |
looks that the json you posted isn't related to issue you experienced. enjoy the holiday and maybe post a unit test when you return at work :) |
Hello,
I am having problem when I try to deserialize below FeatureCollection.
{"type":"FeatureCollection","features":[{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[-2.537841796875,53.50111704294316],[-2.537841796875,54.226707764386695],[-1.0986328125,54.226707764386695],[-1.0986328125,53.50111704294316],[-2.537841796875,53.50111704294316]]]}},{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[-2.724609375,52.34205163638784],[-2.724609375,53.08082737207479],[-0.9667968749999999,53.08082737207479],[-0.9667968749999999,52.34205163638784],[-2.724609375,52.34205163638784]]]}}]}
According to http://geojsonlint.com/ the geoJSON is valid.
Here is the unit test:
I get this exception:
System.ArgumentException : Expected token 'geometry' not found.
at NetTopologySuite.IO.Converters.FeatureConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader)
at NetTopologySuite.IO.Converters.FeatureCollectionConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader)
at NetTopologySuite.IO.GeoJsonReader.Read(String json)
at WebCoreMap.Test.Basemap.Geo.GeoJSONTest.NtsFeatureCollectionDeserializeBug() in GeoJSONTest.cs: line 26
Thank you
The text was updated successfully, but these errors were encountered: