コード例 #1
0
        /// <summary>Converts the specified <paramref name="geometry" /> into a <see cref="SqlGeography" />.</summary>
        /// <param name="geometry">The geometry to convert.</param>
        /// <returns>The converted geometry.</returns>
        public static SqlGeography ToGeography(ISimpleGeometry geometry)
        {
            var sg = geometry as SqlGeography;

            if (sg != null)
            {
                return(sg);
            }

            var sgb = new SqlGeographyBuilderWrapper();

            geometry.Populate(sgb);
            return(sgb.ConstructedGeometry);
        }
コード例 #2
0
ファイル: SqlGeography.cs プロジェクト: mcartoixa/GeoSIK
        /// <summary>Converts the specified <paramref name="geometry" /> into a <see cref="SqlGeography" />.</summary>
        /// <param name="geometry">The geometry to convert.</param>
        /// <returns>The converted geometry.</returns>
        public static SqlGeography ToGeography(ISimpleGeometry geometry)
        {
            var sg=geometry as SqlGeography;
            if (sg!=null)
                return sg;

            var sgb=new SqlGeographyBuilderWrapper();
            geometry.Populate(sgb);
            return sgb.ConstructedGeometry;
        }