Vishful thinking…

GeoJSON.NET – A .NET library to produce GeoJSON output

Posted in Uncategorized by viswaug on May 11, 2008

I have been working on a .NET library to produce GeoJSON output from GIS data. To have the GeoJSON serialization and rehydration be independent of any paid software, I decided to build the framework to produce the GeoJSON output from the geometry types in the NetTopologySuite open source library. Also, for the JSON serialization in .NET, I am using the JayRock open source library. Although, I had to make a little change to the JayRock build script to have the assemblies be strongly named.

The library for the GeoJSON serialization is also open source and can be found here (at Assembla, which I love by the way). The library has also been unit tested using the MbUnit framework.

CropperCapture[65]

CropperCapture[3]

About these ads

16 Responses

Subscribe to comments with RSS.

  1. [...] Property Manager « GeoJSON.NET – A .NET library to produce GeoJSON output [...]

  2. Diego Guidi said, on May 12, 2008 at 8:11 am

    Looks cool!
    BTW: why not use NewtonSoft JSON lib, that looks actively developed and stable? JayRock lib is good for your uses?

  3. viswaug said, on May 12, 2008 at 1:01 pm

    Hi Diego,

    No special reason for using JayRock. I have been using it quite a while now and i like it and haven’t found it to be lacking any features that I needed.

    Thank You,
    Vish

  4. Diego Guidi said, on May 12, 2008 at 3:07 pm

    An interesting link :)
    http://www.codeplex.com/SharpMap/Thread/View.aspx?ThreadId=27551

  5. Vish said, on May 12, 2008 at 5:55 pm

    Thanks for that link. I think I will add support for the SharpMap Geometries in GeoJSON.NET too.

    Thank You,
    Vish

  6. Ruprict said, on May 13, 2008 at 2:49 pm

    Vish…did you look at the GeoJSON stuff in the ArcDeveloper REST API? We have (at least the beginnings of) a GeoJSON formatter (and JSONP) that does this very thing.

    We used the Json.NET library, based on active dev and LINQ support, which I thought was cool.

    Maybe we’ll use your stuff now….

  7. Dylan said, on May 13, 2008 at 4:14 pm

    Very nice. I’ve also been using the NetTopologySuite. Internally I’m using their IGeometry and IGeometryCollection to spit out WKT and GML on demand (for dealing with ST_GEOMETRY in Oracle via WCF that accepts GML). The GeoJSON is a really nice addition. Thanks for sharing.

  8. [...] delivered by the server in a GeoJSON format making it easy to interpret. Please take a look at the GeoJSON.NET library if you are interested in generating GeoJSON yourselves. I will also soon be posting about a [...]

  9. [...] I could have also loaded the data as GeoJSON and used JSON.Net or Vish’s outstanding GeoJSON.Net library but CSV suited my needs in this case. Here is a screen shot showing the GISP [...]

  10. Tim Croydon said, on March 10, 2011 at 7:51 am

    Hi there, looks interesting. What licence do you release your source code under? NetTopologySuite and JayRock seem to be LGPL. Does that apply to your code too? Cheers

    • viswaug said, on March 10, 2011 at 5:55 pm

      Hey Tom,

      Yes, the code is also licensed under LGPL

      Vish

  11. Gmaps said, on June 22, 2011 at 12:04 pm

    Are there any samples ?

    I want to produce following:

    {
    “type”: “FeatureCollection”,
    “features”: [
    {“geometry”: {
    “type”: “GeometryCollection”,
    “geometries”: [
    {
    “type”: “LineString”,
    “coordinates”:
    [[11.0878902207, 45.1602390564],
    [15.01953125, 48.1298828125]]
    },
    {
    “type”: “Polygon”,
    “coordinates”:
    [[[11.0878902207, 45.1602390564],
    [14.931640625, 40.9228515625],
    [0.8251953125, 41.0986328125],
    [7.63671875, 48.96484375],
    [11.0878902207, 45.1602390564]]]
    },
    {
    “type”:”Point”,
    “coordinates”:[15.87646484375, 44.1748046875]
    }
    ]
    },
    “type”: “Feature”,
    “properties”: {}}
    ]
    };

  12. steve said, on October 14, 2011 at 12:27 am

    did you ever get around to writing CRS into your geojson.net project?

  13. fobermaier said, on October 18, 2011 at 9:40 pm

    Do you mind me adding your GeoJSONReader/-Writer to NetTopologySuite.IO library?

    • viswaug said, on October 18, 2011 at 11:09 pm

      No problems. I am all for it.

      Thank You,
      Vish

  14. Diego Guidi (@D_Guidi) said, on October 19, 2011 at 6:49 am

    I’ve worked a little bit on customizing GeoJSON writer and reader for NTS/SharpMap.
    You can find some code here, that maybe can be helpful:
    https://sharpmap.svn.codeplex.com/svn/Branches/0.9-GeoJSON/SharpMap/Rendering/GeoJSON


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: