-
-
Notifications
You must be signed in to change notification settings - Fork 167
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
adds generic FeatureCollection #105
Conversation
Looks good to me. Actuallty, it would be nice to have a non-generic |
It would be cool to have generic version of |
@matt-lethargic would this be possible to include in the next RC if I were to adjust it a bit to the latest codebase? I'm using strongly-typed properties in my features, which is a real pain to configure with the serializer/deserializer mechanism right now. |
Hey @YaroslavKormushyn forgive my memory, what would be the goal be for this? |
This is a change to the existing rigid typing of FeatureCollection and Feature to make them extendable, e.g. define strongly-typed properties for features and allow to follow the L in SOLID. Right now (for me at least) to have a strongly-typed properties object in the features and make it work with the json serializer means recreating the collection and feature classes with the necessary types and using those. This PR makes this easier by having generic interfaces. This still should have a default implementation, so that existing code works without change. |
On that note: is there a way to define a I may be missing something here because I didn't read through all the available types and how they were written. |
Nice to see this get some traction 👍 TBH I've since switched to different library, but would be happy to help. @YaroslavKormushyn: regarding your last comment, I'm not sure I follow… |
@wagich yeah, you followed it perfectly, the PR covers everything we need :) |
I will be creating a PR with these changes to the current codebase later today. I'll mention the original authors so that we can trace these changes correctly and add a mention to this PR. |
This PR adds a generic
FeatureCollection<TProps>
(and creates an interface forFeature
to implement becauseTGeometry
needs to be covariant). This enables the property objects in each feature to be directly serialized using JSON.NET instead of manually using a dictionary. See #104 for use-case.