38 lines
959 B
C#
38 lines
959 B
C#
using NetTopologySuite.Geometries;
|
|
using NetTopologySuite.Operation.Overlay;
|
|
using WorkerService1.Domains;
|
|
using WorkerService1.Utils;
|
|
using Polygon = WorkerService1.Domains.Polygon;
|
|
|
|
namespace TestProject1;
|
|
|
|
[TestClass]
|
|
public class UnitTest1
|
|
{
|
|
[TestMethod]
|
|
public void TestMethod1()
|
|
{
|
|
Points points = new Points(121.43779625955115, 31.26871446396198);
|
|
Polygon polygon = new Polygon()
|
|
{
|
|
Name = "",
|
|
Points = new List<List<Points>>
|
|
{
|
|
new List<Points>
|
|
{
|
|
new(121.435776, 31.269835),
|
|
new(121.435361, 31.268672),
|
|
new Points(121.435854, 31.267829),
|
|
new Points(121.439541, 31.268048),
|
|
new Points(121.439324, 31.269312),
|
|
}
|
|
}
|
|
};
|
|
|
|
var res = Utilities.IsPointInsidePolygon(points, polygon);
|
|
|
|
|
|
}
|
|
|
|
|
|
} |