sibartlett / Geo

A geospatial library for .NET
https://www.nuget.org/packages/Geo/
GNU Lesser General Public License v3.0
176 stars 39 forks source link

Failed to load geometry objects using GeoJsonReader #13

Closed jeduardocosta closed 9 years ago

jeduardocosta commented 9 years ago

Hi,

I'm having problems with the new API version (v0.12.0).

The geometry type objects (like Polygon, MultiPolygon, Point and many others) do not implement the interface 'IGeoJsonObject'. Now, they implement only the interface 'IGeometry'.

I can not load a GeoJSON object ('IGeoJsonObject') from a GeoJSON (in string format) with only the geometry data.

Using the latest API version (v0.12.0) the reading sample using GeoJsonReader class does not work: https://github.com/sibartlett/Geo/wiki/GeoJSON

This code does not work:

' const string geojson = @"{""type"":""Point"",""coordinates"":[0,0]}"; var reader = new GeoJsonReader(); var point = reader.Read(geojson); '

Can you help me?

Thanks.

sibartlett commented 9 years ago

Sorry, about this! Not sure how I didn't catch this issue. I'm trying to simplify the interfaces in Geo.

It should now be fixed in 0.12.1; I updated IGeometry to implement IGeoJsonObject.