What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 12875 |  Welcome, Guest!   Register  Login
  Home > Community Home >

Json question - not sure if DataContractJsonSerializer supports this

 Author: Jabb | Posted on: 6/8/2008 6:03:13 PM | Views: 96

Recommend an Articles | Recommended Articles | Search Resources | Community Home |





I have an app where I want to parse GeoJSON objects, but I don't see how DataContractJsonSerializer can support this. I've written a custom Json parser which works fine but I'd like to know if anyone has any other suggestions.

The main problem is that GeoJSON defines types such as:


// Point type
{
"type": "Point",
"coordinates": [100.0, 0.0]
}

// LineString type
{
   "type": "LineString",


"coordinates": [
[100.0, 0.0], [101.0, 1.0]
]
}
And so on. I don't think I can deserialize to a simple Geometry C# class because, in the first case, coordinates is a double[], while in the second case, coordinates is a double[][]. For multi-linestrings and polygons it's a double[][ ... Go to the complete details ...

Found interesting? Add this to:


About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/25/2013 1:11:18 PM