Skip to content

Commit

Permalink
intervisibility contains points
Browse files Browse the repository at this point in the history
  • Loading branch information
xfischer committed Jan 29, 2020
1 parent fec8070 commit 7cfb763
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
// THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Linq;

namespace DEM.Net.Core
{
Expand All @@ -33,18 +34,19 @@ namespace DEM.Net.Core
/// </summary>
public class IntervisibilityReport
{
public GeoPoint Origin { get; set; }
public GeoPoint Target { get; set; }
public GeoPoint Origin { get; internal set; }
public GeoPoint Target { get; internal set; }
public bool HasObstacles => Metrics?.Intervisible == false;
public int ObstacleCount => Metrics?.Obstacles?.Count ?? 0;
//public List<GeoPoint> GeoPoints { get; set; }
public IntervisibilityMetrics Metrics { get; set; }
public List<GeoPoint> GeoPoints { get; internal set; }
public IntervisibilityMetrics Metrics { get; internal set; }

public IntervisibilityReport(GeoPoint origin, GeoPoint target, IntervisibilityMetrics visibilityMetrics)
public IntervisibilityReport(List<GeoPoint> pointsWithElevation, IntervisibilityMetrics visibilityMetrics)
{
this.Origin = origin;
this.Target = target;
this.Origin = pointsWithElevation.First();
this.Target = pointsWithElevation.Last();
this.Metrics = visibilityMetrics;
this.GeoPoints = pointsWithElevation;
}
}
}
2 changes: 1 addition & 1 deletion DEM.Net.Core/Services/Elevation/ElevationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ public IntervisibilityReport GetIntervisibilityReport(GeoPoint source, GeoPoint

var metrics = geoPoints.ComputeVisibilityMetrics();

return new IntervisibilityReport(geoPoints.First(), geoPoints.Last(), metrics);
return new IntervisibilityReport(geoPoints, metrics);
}
catch (Exception ex)
{
Expand Down

0 comments on commit 7cfb763

Please sign in to comment.