当前位置: 首页>>代码示例>>C#>>正文


C# SqlGeometry.STInteriorRingN方法代码示例

本文整理汇总了C#中SqlGeometry.STInteriorRingN方法的典型用法代码示例。如果您正苦于以下问题:C# SqlGeometry.STInteriorRingN方法的具体用法?C# SqlGeometry.STInteriorRingN怎么用?C# SqlGeometry.STInteriorRingN使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SqlGeometry的用法示例。


在下文中一共展示了SqlGeometry.STInteriorRingN方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetPolygonPointSequence

        static List<GeometryPointSequence> GetPolygonPointSequence(SqlGeometry geom)
        {
            List<GeometryPointSequence> pointsList = new List<GeometryPointSequence>();
            int numInteriorRing = (int)geom.STNumInteriorRing();
            GeometryPointSequence points = new GeometryPointSequence();
            points.PointList = geom.STExteriorRing().ToPointsFArray();
            points.InnerRing = false;
            pointsList.Add(points);
            if (numInteriorRing > 1)

                for (int i = 1; i <= numInteriorRing; i++)
                {
                    points.PointList = geom.STInteriorRingN(i).ToPointsFArray();
                    points.InnerRing = true;
                    pointsList.Add(points);
                }

            return pointsList;
        }
开发者ID:MoonDav,项目名称:TileRendering,代码行数:19,代码来源:GeometryExtension.cs

示例2: SqlGeometryToSharpMapPolygon

 private static SMGeometry SqlGeometryToSharpMapPolygon(SqlGeometry geometry)
 {
     //exterior ring
     SMLinearRing exterior = new SMLinearRing(GetPoints(geometry.STExteriorRing()));
     SMLinearRing[] interior = null;
     if (geometry.STNumInteriorRing() > 0)
     {
         interior = new SMLinearRing[(int)geometry.STNumInteriorRing()];
         for (int i = 1; i <= geometry.STNumInteriorRing(); i++)
             interior[i - 1] = new SMLinearRing(GetPoints(geometry.STInteriorRingN(i)));
     }
     return new SMPolygon(exterior, interior);
 }
开发者ID:Giszpenc,项目名称:ProjNet,代码行数:13,代码来源:SpatialDataFactoryNew.cs

示例3: SqlGeometryToSharpMapPolygon

 private static SMGeometry SqlGeometryToSharpMapPolygon(SqlGeometry geometry, Factory factory)
 {
     var fact = factory ?? Services.CreateGeometryFactory((int)geometry.STSrid);
     //exterior ring
     var exterior = fact.CreateLinearRing(GetPoints(geometry.STExteriorRing()));
     SMLinearRing[] interior = null;
     if (geometry.STNumInteriorRing()>0)
     {
         interior = new SMLinearRing[(int)geometry.STNumInteriorRing()];
         for (var i = 1; i <= geometry.STNumInteriorRing(); i++)
             interior[i - 1] = fact.CreateLinearRing(GetPoints(geometry.STInteriorRingN(i)));
     }
     return Services.CreateGeometryFactory((int)geometry.STSrid).CreatePolygon(exterior, interior);
 }
开发者ID:PedroMaitan,项目名称:sharpmap,代码行数:14,代码来源:SqlGeometryConverter.cs

示例4: SqlGeometryToGeometryPolygon

        private static IPolygon SqlGeometryToGeometryPolygon(SqlGeometry geometry, GeometryFactory factory)
        {
            ILinearRing exterior = factory.CreateLinearRing(GetPoints(geometry.STExteriorRing()));

            ILinearRing[] interior = null;
            if (geometry.STNumInteriorRing() > 0)
            {
                interior = new ILinearRing[geometry.STNumInteriorRing().Value];
                for (int i = 1; i <= interior.Length; i++)
                    interior[i - 1] = factory.CreateLinearRing(GetPoints(geometry.STInteriorRingN(i)));
            }

            return factory.CreatePolygon(exterior, interior);
        }
开发者ID:interworks,项目名称:FastShapefile,代码行数:14,代码来源:ConvertToGeometry.cs

示例5: AddMultiLineStringFromPolygon

        private void AddMultiLineStringFromPolygon(SqlGeometryBuilder geomBuilder, SqlGeometry poly)
        {

            int intnum = (int) poly.STNumInteriorRing();
            var exteriorRing = poly.STExteriorRing();

            if (intnum > 0) geomBuilder.BeginGeometry(OpenGisGeometryType.MultiLineString);
            geomBuilder.BeginGeometry(OpenGisGeometryType.LineString);
            var startpoint = exteriorRing.STStartPoint();
            geomBuilder.BeginFigure((double) startpoint.STX, (double) startpoint.STY);
            for (int i = 2; i <= exteriorRing.STNumPoints(); i++)
                geomBuilder.AddLine((double) exteriorRing.STPointN(i).STX, (double) exteriorRing.STPointN(i).STY);
            geomBuilder.EndFigure();
            geomBuilder.EndGeometry();
            if (intnum > 0)
            {
                SqlGeometry intRing;
                SqlGeometry point;
                for (int i = 1; i <= intnum; i++)
                {
                    intRing = poly.STInteriorRingN(i);
                    geomBuilder.BeginGeometry(OpenGisGeometryType.LineString);
                    startpoint = intRing.STStartPoint();
                    geomBuilder.BeginFigure((double) startpoint.STX, (double) startpoint.STY);
                    for (int p = 2; p <= intRing.STNumPoints(); p++)
                    {
                        point = intRing.STPointN(p);
                        geomBuilder.AddLine((double) point.STX, (double) point.STY);
                    }
                    geomBuilder.EndFigure();
                    geomBuilder.EndGeometry();
                }

                geomBuilder.EndFigure();
                geomBuilder.EndGeometry();
            }
        }
开发者ID:MoonDav,项目名称:TileRendering,代码行数:37,代码来源:ShapeToTileRendering.cs

示例6: RepeatPolygon

        private static void RepeatPolygon(SqlGeometryBuilder builder, SqlGeometry shape)
        {
            try
            {
                builder.BeginGeometry(OpenGisGeometryType.Polygon);
                var internalRingsNum = (int)shape.STNumInteriorRing();
                var exteriorRing = shape.STExteriorRing();

                // Proceed shortening external ring
                AddRingByBuilder(builder, exteriorRing);
                // Proceed interior rings
                if (internalRingsNum > 0)
                    for (int i = 1; i <= internalRingsNum; i++)
                    {
                        AddRingByBuilder(builder, shape.STInteriorRingN(i));
                    }
                builder.EndGeometry();
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format(" RepeatPolygon: {0}", ex.Message));
            }
        }
开发者ID:MoonDav,项目名称:TileRendering,代码行数:23,代码来源:ShortLineExcluding.cs

示例7: ReprojectPolygon

        private void ReprojectPolygon(SqlGeometry geometry, SqlGeometryBuilder bldr)
        {
            bldr.BeginGeometry(OpenGisGeometryType.Polygon);

            ReprojectFigure(geometry.STExteriorRing(), bldr);

            if (geometry.STNumInteriorRing() > 0)
            {
                for (int i = 1, c = geometry.STNumInteriorRing().Value; i <= c; i++)
                    ReprojectFigure(geometry.STInteriorRingN(i), bldr);
            }

            bldr.EndGeometry();
        }
开发者ID:interworks,项目名称:FastShapefile,代码行数:14,代码来源:ReprojectSqlServer.cs


注:本文中的SqlGeometry.STInteriorRingN方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。