-
-
Notifications
You must be signed in to change notification settings - Fork 314
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 support #1638
Comments
I'll note that there seem to be two geojson files in the repository:
... but apparently they're not being used anywhere. Fun fact on the side: Opening the first link actually visualizes the city pins on a (mapbox) world map, so apparently GitHub itself has GeoJSON support ;) |
Isn't it possible to use the NTS extension NetTopologySuite.IO.GeoJSON to read all the data and then show on a map? |
That looks like a good option. |
Yes, good point. That would already cover a big part of my proposed |
ah yes. I have not looked into NetTopologySuite.Features.IFeature at all so far. I assume there are other NTS data sources that use it as well. The namespace NetTopologySuite.Features is not included anywhere in Mapsui. Perhaps it is possible to resolve this with a ToMapsui extension method. |
I am curious about supporting locating a geojson file. I have one sitting around and I am currently having to use the geojson.net nuget to read in the FeatureCollection and then convert it to mapsui geometry, but they are basically all the same names/object types, so would be nice to just throw in a json file and then create the layers. |
I actually ended up using the
Then I convert this to a list of GeometryFeatures manually (with a custom style) and display those via a MemoryLayer. @jamesmontemagno, I assume this is basically the same thing that you do. And yes, I agree it would be nice to have some sort of convenience wrapper in Mapsui for this kind of functionality (maybe via a |
Yup that is what i did basically. I guess that one is built in already as a dependency so maybe i will try that out. |
GeoJSON support was added by @inforithmics in Mapsui.Extension. See the online sample by selecting 'GeoJson' under 'Data Formats'. |
It would be very useful if Mapsui had intrinsic support for the GeoJSON format.
To implement this, one could simply set up a
GeoJsonProvider
(implementing theIProvider
) interface, much like theShapeFile
orWmsProvider
. This would read & parse a GeoJSON file (could be a local file or remote URL) and spit out the corresponding list of features, which could then be rendered via some layer.Any comments on this idea or how to implement it? I am slightly surprised that no one has started this kind of thing yet :D
The text was updated successfully, but these errors were encountered: