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
usingGeoJSON.Net.Geometry;usingMicrosoft.SqlServer.Types;usingGeoJSON.Net.Contrib.MsSqlSpatial;// SqlGeometry sample pointSqlGeometrysimplePoint=SqlGeometry.Point(1,47,4326);// SqlGeometry -> GeoJSON examplePointpoint=simplePoint.ToGeoJSONObject<Point>();// GeoJSON -> SqlGeometry exampleSqlGeometrysqlPoint=point.ToSqlGeometry(4326);usingGeoJSON.Net.Contrib.MsSqlSpatial;usingGeoJSON.Net.Geometry;// LineString from WKTLineStringlineString=WktConvert.GeoJSONObject<LineString>("LINESTRING(1 47,1 46,0 46,0 47,1 47)");// LineString IGeometryObject from WKTIGeometryObjectlineStringGeom=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
usingGeoJSON.Net.Geometry;usingGeoJSON.Net.Contrib.EntityFramework;// DbGeography sample pointvardbGeographyPoint=DbGeography.FromText("POINT(30 10)",4326);// DbGeography -> GeoJSON examplePointpoint=dbGeographyPoint.ToGeoJSONObject<Point>();// GeoJSON -> DbGeography exampleDbGeographydbGeographyPoint=point.ToDbGeography();Allows conversion from / to Wkb binary types. Only X,Y,Z coordinates are supported, attempting to convert a geometry with M coordinates will throw an Exception.
NuGet package:
Install-Package GeoJSON.Net.Contrib.Wkb
usingGeoJSON.Net.Geometry;usingGeoJSON.Net.Contrib.Wkb;// GeoJson sample pointPointpoint=newPoint(newPosition(53.2455662,90.65464646));// GeoJson -> Wkb examplebyte[]wkbPoint=point.ToWkb();// Wkb -> GeoJson examplePointpointFromWkb=wkbPoint.ToGeoJSONObject<Point>();- Git client 2.0+
- .NET Core SDK 3.0+
- (Optional) Development IDE, common choices are:
Use shell of your choice (cmd.exe, powershell.exe, pwsh, bash, etc) to run the following commands:
# verify .NET SDK
dotnet --info
# => .NET Core SDK (reflecting any global.json):# => Version: 3.1.301# => ...# download repositorycd<development-directory-root>
git clone https://github.com/GeoJSON-Net/GeoJSON.Net.Contrib.git
cd GeoJSON.Net.Contrib
# build ("Debug" configuration)
dotnet build src/GeoJSON.Net.Contrib.sln
# test ("Debug" configuration)
dotnet test src/GeoJSON.Net.Contrib.sln
# package ("Release" configuration)
git clean -dfx
dotnet pack --configuration Release src/GeoJSON.Net.Contrib.sln
# push all projects to NuGet server (requires "package" step above to be run first)# note: in addition to ".nupkg", the command below will automatically# detect ".snupkg" symbol package and push both ".nupkg" and ".snupkg"# to the specified NuGet server; for more information see# https://docs.microsoft.com/en-us/nuget/create-packages/symbol-packages-snupkg
dotnet nuget push **/*.nupkg --api-key SECRET --source https://api.nuget.org/v3/index.json