public void ThrowIfMeasureIsNotInRangeTest() { const int measure = 10; var startPoint = "POINT(1 2 0)".GetGeom(); var endPoint = "POINT(2 2 5)".GetGeom(); try { SpatialExtensions.ThrowIfMeasureIsNotInRange(measure, startPoint, endPoint); } catch (ArgumentException) { } }
// Start the geometry. public void BeginGeometry(OpenGisGeometryType type) { if (type == OpenGisGeometryType.Point) { return; } if (type != OpenGisGeometryType.LineString) { SpatialExtensions.ThrowException(ErrorMessage.LineStringCompatible); } if (_isFirstPoint) { _isFirstPoint = false; _target.BeginGeometry(OpenGisGeometryType.MultiLineString); } _target.BeginGeometry(type); _linesCount--; }
public void ThrowIfNotOfTypeTest() { var geom = "POINT EMPTY".GetGeom(); try { SpatialExtensions.ThrowIfNotLineOrMultiLine(geom); } catch (ArgumentException) { } try { SpatialExtensions.ThrowIfNotLine(geom); } catch (ArgumentException) { } geom = "LINESTRING EMPTY".GetGeom(); try { SpatialExtensions.ThrowIfNotPoint(geom); } catch (ArgumentException) { } try { SpatialExtensions.ThrowException("Test : {0}", "Test Message"); } catch (ArgumentException) { } }
/// <summary> /// Gets the distance from point. /// </summary> /// <param name="nextPoint">The next point.</param> /// <returns>Offset Point.</returns> internal double GetDistance(LRSPoint nextPoint) { return(SpatialExtensions.GetDistance(X, Y, nextPoint.X, nextPoint.Y)); }