Repository for all GeoJSON.Net *.Contrib projects
Allows conversion from / to Microsoft Sql Server geometry and geography data types.
NuGet package:
Install-Package GeoJSON.Net.Contrib.MsSqlSpatial
using GeoJSON.Net.Geometry;
using Microsoft.SqlServer.Types;
using GeoJSON.Net.Contrib.MsSqlSpatial;
// SqlGeometry sample point
SqlGeometry simplePoint = SqlGeometry.Point(1, 47, 4326);
// SqlGeometry -> GeoJSON example
Point point = simplePoint.ToGeoJSONObject<Point>();
// GeoJSON -> SqlGeometry example
SqlGeometry sqlPoint = point.ToSqlGeometry(4326);
using GeoJSON.Net.Contrib.MsSqlSpatial;
using GeoJSON.Net.Geometry;
// LineString from WKT
LineString lineString = WktConvert.GeoJSONObject<LineString>("LINESTRING(1 47,1 46,0 46,0 47,1 47)");
// LineString IGeometryObject from WKT
IGeometryObject lineStringGeom = WktConvert.GeoJSONGeometry("LINESTRING(1 47,1 46,0 46,0 47,1 47)");
Allows conversion from / to EntityFramework geometry and geography data types.
NuGet package:
Install-Package GeoJSON.Net.Contrib.EntityFramework
using GeoJSON.Net.Geometry;
using GeoJSON.Net.Contrib.EntityFramework;
// DbGeography sample point
var dbGeographyPoint = DbGeography.FromText("POINT(30 10)", 4326);
// DbGeography -> GeoJSON example
Point point = dbGeographyPoint.ToGeoJSONObject<Point>();
// GeoJSON -> DbGeography example
DbGeography dbGeographyPoint = point.ToDbGeography();
Allows conversion from / to Wkb binary types.
NuGet package:
Install-Package GeoJSON.Net.Contrib.Wkb
using GeoJSON.Net.Geometry;
using GeoJSON.Net.Contrib.Wkb;
// GeoJson sample point
Point point = new Point(new Position(53.2455662, 90.65464646));
// GeoJson -> Wkb example
byte[] wkbPoint = point.ToWkb();
// Wkb -> GeoJson example
Point pointFromWkb = wkbPoint.ToGeoJSONObject<Point>();