private static SMGeometry SqlGeometryToSharpMapMultiPoint(SqlGeometry geometry, Factory factory) { var fact = factory ?? Services.CreateGeometryFactory((int)geometry.STSrid); var points = new SMPoint[(int)geometry.STNumGeometries()]; for (var i = 1; i <= geometry.STNumGeometries(); i++) { points[i - 1] = (SMPoint)SqlGeometryToSharpMapPoint(geometry.STGeometryN(i), fact); } return(fact.CreateMultiPoint(points)); }
internal static NTSMultiPoint ToNTSMultiPoint(Geometries.MultiPoint geom, IGeometryFactory factory) { NTSPoint[] points = new NTSPoint[geom.Points.Count]; int index = 0; foreach (Geometries.Point point in geom.Points) { points[index++] = ToNTSPoint(point, factory); } return(factory.CreateMultiPoint(points) as NTSMultiPoint); }
internal static DotSpatial.Topology.Point ToDotSpatialPoint(GeoAPI.Geometries.IPoint point) { return(new DotSpatial.Topology.Point(point.X, point.Y)); }
private static void SharpMapPointToSqlGeometry(SqlGeometryBuilder geomBuilder, SMPoint point) { geomBuilder.BeginGeometry(OpenGisGeometryType.Point); geomBuilder.BeginFigure(point.X, point.Y); geomBuilder.EndFigure(); geomBuilder.EndGeometry(); }
internal static Geometries.Point ToSharpMapPoint(NTSPoint geom) { Debug.Assert(geom.Coordinates.Length == 1); return(ToSharpMapPoint((geom.Coordinate as Coordinate))); }
private static SMGeometry SqlGeometryToSharpMapMultiPoint(SqlGeometry geometry, Factory factory) { var fact = factory ?? Services.CreateGeometryFactory((int)geometry.STSrid); var points = new SMPoint[(int)geometry.STNumGeometries()]; for (var i = 1; i <= geometry.STNumGeometries(); i++) points[i-1] = (SMPoint) SqlGeometryToSharpMapPoint(geometry.STGeometryN(i), fact); return fact.CreateMultiPoint(points); }
internal static Geometries.Point ToSharpMapPoint(NTSPoint geom) { Debug.Assert(geom.Coordinates.Length == 1); return ToSharpMapPoint((geom.Coordinate as Coordinate)); }
private static void SharpMapPointToSqlGeography(SqlGeographyBuilder geogBuilder, SMPoint point) { geogBuilder.BeginGeography(OpenGisGeographyType.Point); geogBuilder.BeginFigure(point.Y, point.X); geogBuilder.EndFigure(); geogBuilder.EndGeography(); }
internal static NTSMultiPoint ToNTSMultiPoint(Geometries.MultiPoint geom, IGeometryFactory factory) { NTSPoint[] points = new NTSPoint[geom.Points.Count]; int index = 0; foreach (Geometries.Point point in geom.Points) points[index++] = ToNTSPoint(point, factory); return factory.CreateMultiPoint(points) as NTSMultiPoint; }
private readonly bool empty;//cached /// <summary> /// A simple constructor without normalization / validation. /// </summary> public NtsPoint(GeoAPI.Geometries.IPoint pointGeom, SpatialContext ctx) { this.ctx = ctx; this.pointGeom = pointGeom; this.empty = pointGeom.IsEmpty; }
private static IPoint ReProject(this IPoint point, ICoordinateTransformation transformator) { return(new Point(point.Coordinate.ReProject(transformator))); }
/// <summary> /// Calculate distance between two points /// </summary> /// <param name="p1"></param> /// <param name="p2"></param> /// <returns></returns> public static double Distance(this IPoint p1, IPoint p2) { return(Math.Sqrt(Math.Pow((p2.X - p1.X), 2) + Math.Pow((p2.Y - p1.Y), 2))); }
/// <summary> /// Cast point to webpoint /// </summary> /// <param name="point"></param> /// <returns></returns> public static WebPoint ToWebPoint(this IPoint point) { return(new WebPoint(point.X, point.Y)); }