using System;
using GeoAPI.Geometries;
namespace GisSharpBlog.NetTopologySuite.Geometries{
/// <summary>
/// Indicates an invalid or inconsistent topological situation encountered during processing
/// </summary>
public class TopologyException : SystemException
{
/// <summary>
///
/// </summary>
/// <param name="msg"></param>
/// <param name="pt"></param>
/// <returns></returns>
private static string MsgWithCoord(string msg, ICoordinate pt)
{
if (pt != null)
return msg + " [ " + pt + " ]";
return msg;
}
private ICoordinate pt = null;
/// <summary>
///
/// </summary>
/// <param name="msg"></param>
public TopologyException(string msg) : base(msg) { }
/// <summary>
///
/// </summary>
/// <param name="msg"></param>
/// <param name="pt"></param>
public TopologyException(string msg, ICoordinate pt)
: base (MsgWithCoord(msg, pt))
{
this.pt = new Coordinate(pt);
}
/// <summary>
///
/// </summary>
public ICoordinate Coordinate
{
get
{
return pt;
}
}
}
}
|