Skip to content

Commit 927bfda

Browse files
committed
ApplyGeometryMask debug and optims
1 parent 5635ec2 commit 927bfda

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

DEM.Net.Core/Services/Geometry/GeometryService.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,9 +562,21 @@ public static bool IsCovered(this BoundingBox bbox, IEnumerable<BoundingBox> bbo
562562
public static HeightMap ApplyGeometryMask(this HeightMap heightMap, string bbox)
563563
{
564564
var geom = ParseWKTAsGeometry(bbox);
565+
var ntsPoint = new Point(0, 0);
565566
heightMap.Coordinates = heightMap.Coordinates.Select(pt =>
566567
{
567-
pt.Elevation = geom.Contains(new Point(pt.Longitude, pt.Latitude)) ? pt.Elevation : 0;
568+
ntsPoint.X = pt.Longitude;
569+
ntsPoint.Y = pt.Latitude;
570+
if (geom.Contains(ntsPoint))
571+
{
572+
pt.Elevation=0;
573+
}
574+
#if DEBUG // for breakpoints
575+
else
576+
{
577+
pt.Elevation = pt.Elevation;
578+
}
579+
#endif
568580
return pt;
569581
});
570582
return heightMap;

0 commit comments

Comments
 (0)