Hello and I hope you can help here.
Using Xamarin Forms and I am new to your products.
I have some data I want to load into Features. My classes have the Geometry type which is a GeoJson format. We are using the NuGet GeoJSON.net (https://github.com/GeoJSON-Net).
I assumed that I can create a feature from that GeoJson string using the Feature.CreateFeatureFromGeoJson. But I get an exception of:
System.InvalidCastException: Specified cast is not valid.
at ThinkGeo.Core.Feature.CreateFeatureFromGeoJson (System.String geoJson) [0x00006] in <88a93a0ef8fd40b6b3125d2895e99794>:0
My assumption is that method would take a GeoJSON geometry and create a feature but it appears it wants the string to be based from one of your Features converted to GeoJson.
My starting JSON is:
"{\"type\":\"Point\",\"coordinates\":[2.0,1.0,3.0]}"
Now I did create a feature based on a point and called its GetGeoJson() and I get back a format of:
"{\"geometry\":{\"coordinates\":[1,2],\"type\":\"Point\"},\"properties\":{},\"bbox\":[0.999995,1.999995,1.000005,2.000005],\"id\":\"b11b5b0f-d8c5-41cb-9bdd-9281486c114a\",\"type\":\"Feature\"}"
Quite a different string to the one I am wanting to use.
My questions:
-
So it appears that your GeoJson get and create are for a specific format and not the GeoJson RFC standard?
-
I assume to create features from my data feed I will need to create a Point from my GeoJson and then create a Feature based on that Point?
Or is there some other way to get my data into a set of features?
My data is a class with a Geometry using the NuGet GeoJSON.net.
I hope I have explained myself well enough for you to answer.
Regards
Chris …