-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSqlClrWrapper.cs
More file actions
20 lines (17 loc) · 937 Bytes
/
SqlClrWrapper.cs
File metadata and controls
20 lines (17 loc) · 937 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;
using Microsoft.SqlServer.Types;
namespace SqlSpatial.Simplify;
public class SqlClrWrapper
{
[SqlFunction( DataAccess = DataAccessKind.None, SystemDataAccess = SystemDataAccessKind.None, IsDeterministic = true, IsPrecise = true)]
public static SqlGeography SimplifyByMinimumArea(SqlGeography sourceGeography, SqlDouble minimumArea)
{
return Simplifier.Simplify(sourceGeography, SimplifyMode.MinimumArea, minimumArea.Value);
}
[SqlFunction( DataAccess = DataAccessKind.None, SystemDataAccess = SystemDataAccessKind.None, IsDeterministic = true, IsPrecise = true)]
public static SqlGeography SimplifyByPercentagePointsRetained(SqlGeography sourceGeography, SqlDouble percentage)
{
return Simplifier.Simplify(sourceGeography, SimplifyMode.PercentagePointsRetained, percentage.Value);
}
}