Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Coordinates from string to double or float

$
0
0

Hi everyone!

I'm working with an API-Rest that generates me a JSON with a polygon (every coordinates of that polygon, shape).

Well, I deserialize it in classes, but the coordinates deserialize in string (I mean, x and y coordinates as string) so I can't use it, because I need to put each point with lat and with long.

How can I deserialize it in a double or float to use my coordinates?

That is the JSON: shape\":[\"52.5139618,13.3210087\",\"52.5139618,13.3222961\",\"52.5141335,13.3228111\",\"52.5144768,13.3231544\",\"52.5146484,13.3236694\",\"52.5146484,13.3243561\",\"52.5144768,13.3248711\",\"52.5141335,13.3252144\",

And that is my class:

public class Component
{
public int id { get; set; }
public string[] shape { get; set; }
}

Thank you in advance


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>