Fluxera.Spatial.LiteDB 7.1.0

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
.NET 7.0
dotnet add package Fluxera.Spatial.LiteDB --version 7.1.0
NuGet\Install-Package Fluxera.Spatial.LiteDB -Version 7.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Fluxera.Spatial.LiteDB" Version="7.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Fluxera.Spatial.LiteDB --version 7.1.0
#r "nuget: Fluxera.Spatial.LiteDB, 7.1.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Fluxera.Spatial.LiteDB as a Cake Addin
#addin nuget:?package=Fluxera.Spatial.LiteDB&version=7.1.0

// Install Fluxera.Spatial.LiteDB as a Cake Tool
#tool nuget:?package=Fluxera.Spatial.LiteDB&version=7.1.0

Build Status

Fluxera.Spatial

A libary that provides spatial types based on GeoJSON defined in RFC 7946.

Usage

Just use the provied structs to define your classes that need gep-spatial informations in it.

public sealed class Restaurant
{
	public string Name { get; set; }

	public Point Location { get; set; }
}

Supported GeoJSON objects

This libary privide an inclomple implementation of RFC 7946 at the moment. The basic geometries are supported.

  • Point
  • MultiPoint
  • LineString
  • MultiLineString
  • Polygon
  • MultiPolygon
  • GeometryCollection

Please refer to the documentation of RFC 7946 for details.

Serialization Support

At the moment serialization support is available for:

The serializers make sure that the objects are serialized in the GeoJSON format and in case of databases also stored im the correct format to support indexing and geo queries.

Newtonsoft.Json (JSON.NET)

To support the GeoJSON objects in JSON.NET use the UseSpatial extension method on the JsonSerializerSettings.

JsonSerializerSettings settings = new JsonSerializerSettings();

// Use the serialization support for GeoJSON objects.
settings.UseSpatial();

JsonConvert.DefaultSettings = () => settings;

LiteDB

To support the GeoJSON objects in LiteDB use the UseSpatial extension method on the global BsonMapper.

BsonMapper.Global.UseSpatial();

MongoDB

To support the GeoJSON objects in MongoDB use the UseSpatial extension method on a ConventionPack.

ConventionPack pack = new ConventionPack();
pack.UseSpatial();
ConventionRegistry.Register("ConventionPack", pack, t => true);

System.Text.Json

To support the GeoJSON objects in System.Text.Json use the UseSpatial extension method on the JsonSerializerOptions.

private JsonSerializerOptions options;

this.options = new JsonSerializerOptions
{
	WriteIndented = false
};
this.options.UseSpatial();

JsonSerializer.Serialize(Point.Empty, this.options);

References

RFC 7946

Future

We plan to add support for EFCore and OData and to add the missing pieces of the RFC Specification.

Product Versions
.NET net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Fluxera.Spatial.LiteDB:

Package Downloads
Fluxera.Repository.LiteDB The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

A LiteDB repository implementation.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
7.1.0 121 1/18/2023
7.0.6 182 12/22/2022
7.0.5 120 12/13/2022
7.0.4 157 12/9/2022
7.0.3 179 11/15/2022
7.0.2 172 11/12/2022
7.0.0 153 11/9/2022
6.1.4 928 9/15/2022
6.1.3 369 7/30/2022
6.1.2 378 6/30/2022
6.1.1 367 6/15/2022
6.1.0 452 6/7/2022
6.0.9 1,121 5/28/2022
6.0.8 237 5/28/2022
6.0.7 913 5/5/2022
6.0.5 410 4/20/2022
6.0.4 603 3/26/2022
6.0.3 244 3/24/2022
6.0.2 259 2/25/2022