Skip to content

Commit 329b8a0

Browse files
committed
Added Geometry Validation methods with flags parameter
1 parent d2f695b commit 329b8a0

File tree

1 file changed

+38
-6
lines changed

1 file changed

+38
-6
lines changed

LinqToDBPostGisNetTopologySuite/GeometryValidation.cs

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,61 @@ namespace LinqToDBPostGisNetTopologySuite
1515
public static class GeometryValidation
1616
{
1717
/// <summary>
18-
/// Returns true if geometry value is well-formed in 2D according to the OGC rules.
18+
/// Returns true if input geometry is well-formed in 2D according to the OGC rules.
1919
/// </summary>
2020
/// <remarks>
2121
/// See https://postgis.net/docs/manual-3.0/ST_IsValid.html
2222
/// </remarks>
2323
/// <param name="geometry">Input geometry</param>
24-
/// <returns>Is valid</returns>
24+
/// <returns>Geometry is valid</returns>
2525
[Sql.Function("ST_IsValid", ServerSideOnly = true)]
26-
public static bool? STIsValid(this NTSG geometry) // TODO: flags version
26+
public static bool? STIsValid(this NTSG geometry)
2727
{
2828
throw new InvalidOperationException();
2929
}
3030

3131
/// <summary>
32-
/// Returns text stating if a geometry is valid or not an if not valid, a reason why.
32+
/// Returns true if input geometry is well-formed in 2D according to the OGC rules.
33+
/// </summary>
34+
/// <remarks>
35+
/// See https://postgis.net/docs/manual-3.0/ST_IsValid.html
36+
/// </remarks>
37+
/// <param name="geometry">Input geometry</param>
38+
/// <param name="flags">Consider self-intersecting rings forming holes as valid = 1</param>
39+
/// <returns>Geometry is valid</returns>
40+
[Sql.Function("ST_IsValid", ServerSideOnly = true)]
41+
public static bool? STIsValid(this NTSG geometry, int flags)
42+
{
43+
throw new InvalidOperationException();
44+
}
45+
46+
// TODO: ST_IsValidDetail return type: row, how to use with linq2db ?
47+
48+
/// <summary>
49+
/// Returns text stating if input geometry is valid or not an if not valid, a reason why.
50+
/// </summary>
51+
/// <remarks>
52+
/// See https://postgis.net/docs/manual-3.0/ST_IsValidReason.html
53+
/// </remarks>
54+
/// <param name="geometry">Input geometry</param>
55+
/// <returns>Valid message or reason if invalid</returns>
56+
[Sql.Function("ST_IsValidReason", ServerSideOnly = true)]
57+
public static string STIsValidReason(this NTSG geometry)
58+
{
59+
throw new InvalidOperationException();
60+
}
61+
62+
/// <summary>
63+
/// Returns text stating if input geometry is valid or not an if not valid, a reason why.
3364
/// </summary>
3465
/// <remarks>
3566
/// See https://postgis.net/docs/manual-3.0/ST_IsValidReason.html
3667
/// </remarks>
3768
/// <param name="geometry">Input geometry</param>
38-
/// <returns>Valid reason</returns>
69+
/// <param name="flags">Consider self-intersecting rings forming holes as valid = 1</param>
70+
/// <returns>Valid message or reason if invalid</returns>
3971
[Sql.Function("ST_IsValidReason", ServerSideOnly = true)]
40-
public static string STIsValidReason(this NTSG geometry) // TODO: flags version
72+
public static string STIsValidReason(this NTSG geometry, int flags)
4173
{
4274
throw new InvalidOperationException();
4375
}

0 commit comments

Comments
 (0)