9

I'm trying to find a .NET GeoJSON library which I can use to export my SqlServer2008 spatial boundaries (in binary format -> eg. STAsBinary()) from my .NET code to my HTML frontend to display on a google map.

At first I felt that it might be a StackOverflow question, but this site I feel is more specialised to helping me out.

Does anyone know of any?

NOTE: This dll does NOT have to be imported into SqlServer2008. In fact, it will not. I'll use it in my C# MVC WebSite.

3

Take a look at this article: SQL Server 2008 + VirtualEarth made easier and building a REST API

2

The C# bindings for gdal/ogr are always an option. You can create a geometry instance using WKB, and then export to JSON.

http://www.gdal.org/ogr/classOGRGeometry.html

  • @user980 - can this WKB data .. which will be transported over the wire as JSON .. be loaded into google maps? – Pure.Krome Jun 13 '11 at 5:19
1

If you are using MVC, it is fairly easy to setup a few classes for FeatureCollection, Feature, and then your Geometry type then serialize them using JsonResult. For Json arrays like "features" you can use an arraylist, and for a feature's "properties" use a dictionary with strings for keys and objects for values.

If not MVC, you can do something similar with Json.NET.

Hope that helps, David

0

You can use GeoJSON.Net. I have no experience with it yet. But I'm planning to work with it. I'll let you know it's usefulness when I do.

  • Are you a bot? I've seen this answer across multiple questions? When are you going to get back and update everyone with it's usefulness? – BenCr Mar 11 '16 at 15:39
  • I'm not a bot. And I didn't use it so I can't tell it's usefulness. – Mahmoodvcs Mar 13 '16 at 6:51
  • It's not a particularly useful answer then. – BenCr Mar 14 '16 at 10:25
  • In looking at that library, it does not appear to have any facilities to read from WKT, WKB, or GML, which are the formats I have seen supported for exporting to from SqlGeography. – N8allan May 26 '16 at 5:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.