Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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

share|improve this answer
@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

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

share|improve this answer

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.

share|improve this answer
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 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 at 6:51
It's not a particularly useful answer then. – BenCr Mar 14 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 at 5:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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