SqlSpatial.Simplify 1.0.2

dotnet add package SqlSpatial.Simplify --version 1.0.2
                    
NuGet\Install-Package SqlSpatial.Simplify -Version 1.0.2
                    
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="SqlSpatial.Simplify" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SqlSpatial.Simplify" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="SqlSpatial.Simplify" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SqlSpatial.Simplify --version 1.0.2
                    
#r "nuget: SqlSpatial.Simplify, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=SqlSpatial.Simplify&version=1.0.2
                    
Install SqlSpatial.Simplify as a Cake Addin
#tool nuget:?package=SqlSpatial.Simplify&version=1.0.2
                    
Install SqlSpatial.Simplify as a Cake Tool

Polygon + LineString Simplification SqlClr for SQL Server Spatial Geographies

Install

DROP ASSEMBLY IF EXISTS SqlSpatialClr; 

CREATE ASSEMBLY SqlSpatialClr FROM '/where/uploaded/to/mssql/server/SqlSpatial.Simplify.dll' WITH PERMISSION_SET = SAFE; 

CREATE FUNCTION dbo.SimplifyByArea(@polygon GEOGRAPHY, @tolerance FLOAT) RETURNS GEOGRAPHY AS EXTERNAL NAME SqlSpatialClr.[SqlSpatial.Simplify.SqlClrWrapper].SimplifyByMinimumArea; GO
CREATE FUNCTION dbo.SimplifyByPercentage(@polygon GEOGRAPHY, @perentage FLOAT) RETURNS GEOGRAPHY AS EXTERNAL NAME SqlSpatialClr.[SqlSpatial.Simplify.SqlClrWrapper].SimplifyByPercentagePointsRetained; GO
 
GO


Update

You may need to DROP the functions first if the code's C# signatures have changed.

ALTER ASSEMBLY SqlSpatialClr FROM '/where/uploaded/to/mssql/server/SqlSpatial.Simplify.dll'; 

Uninnstall

DROP FUNCTION IF EXISTS dbo.SimplifyByArea; GO
DROP FUNCTION IF EXISTS dbo.SimplifyByPercentage; GO

DROP ASSEMBLY IF EXISTS SqlSpatialClr; 

Example usage


-- simplify by retaining 5% of the largest-area points
DECLARE @percentage FLOAT = 5.0;
DECLARE @geography GEOGRAPHY = (SELECT SomeHugeBoundary FROM lovely_big_city_table WHERE id = 31415);
SELECT dbo.SimplifyByPercentage(@geography, @percentage) AS simplified; 

-- simplify by dropping points with a triangular area under 200m
DECLARE @tolerance FLOAT = 200.0;
DECLARE @geography GEOGRAPHY = (SELECT SomeHugeBoundary FROM lovely_big_city_table WHERE id = 31415);
SELECT dbo.SimplifyByArea(@geography, @tolerance) AS simplified;
Product Compatible and additional computed target framework versions.
.NET Framework net481 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.2 128 10 months ago
1.0.1 110 10 months ago