private System.Spatial.GeographyMultiPoint CreateGeographyMultipoint(Esri.ArcGISRuntime.Geometry.Multipoint multipoint, System.Spatial.CoordinateSystem cs) { var b = System.Spatial.SpatialBuilder.Create(); if (cs != null) { b.GeographyPipeline.SetCoordinateSystem(cs); } b.GeographyPipeline.BeginGeography(System.Spatial.SpatialType.MultiPoint); foreach (var p in multipoint.Points) { b.GeographyPipeline.BeginGeography(System.Spatial.SpatialType.Point); b.GeographyPipeline.BeginFigure(ToGeographyPosition(p)); b.GeographyPipeline.EndFigure(); b.GeographyPipeline.EndGeography(); } b.GeographyPipeline.EndGeography(); return((System.Spatial.GeographyMultiPoint)b.ConstructedGeography); }
private static Microsoft.SqlServer.Types.SqlGeometry CreateGeometryMultipoint(Esri.ArcGISRuntime.Geometry.Multipoint multipoint, int cs) { var b = new Microsoft.SqlServer.Types.SqlGeometryBuilder(); b.SetSrid(cs); b.BeginGeometry(Microsoft.SqlServer.Types.OpenGisGeometryType.MultiPoint); foreach (var p in multipoint.Points) { b.BeginGeometry(Microsoft.SqlServer.Types.OpenGisGeometryType.Point); b.BeginFigure(p.X, p.Y, p.HasZ ? (double?)p.Z : null, p.HasM ? (double?)p.M : null); b.EndFigure(); b.EndGeometry(); } b.EndGeometry(); return(b.ConstructedGeometry); }