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


C# IMultiPolygon类代码示例

本文整理汇总了C#中IMultiPolygon的典型用法代码示例。如果您正苦于以下问题:C# IMultiPolygon类的具体用法?C# IMultiPolygon怎么用?C# IMultiPolygon使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: AddMultiPolygon

        private void AddMultiPolygon(IMultiPolygon geometry, GraphicsPath graphicsPath)
        {
            if (geometry == null)
                throw new ArgumentNullException("geometry");

            foreach (var geom in geometry.Geometries)
                this.AddPolygon((IPolygon)geom, graphicsPath);
        }
开发者ID:PedroMaitan,项目名称:sharpmap,代码行数:8,代码来源:GraphicsPathBuilder.cs

示例2: Write

 /// <summary>
 /// 
 /// </summary>
 /// <param name="multiPolygon"></param>
 /// <param name="writer"></param>
 protected void Write(IMultiPolygon multiPolygon, BinaryWriter writer)
 {
     WriteByteOrder(writer);     // LittleIndian
     if (Double.IsNaN(multiPolygon.Coordinate.Z))
          writer.Write((int)WKBGeometryTypes.WKBMultiPolygon);
     else writer.Write((int)WKBGeometryTypes.WKBMultiPolygonZ);
     writer.Write((int) multiPolygon.NumGeometries);
     for (int i = 0; i < multiPolygon.NumGeometries; i++)
         Write(multiPolygon.Geometries[i] as IPolygon, writer);
 }
开发者ID:ExRam,项目名称:DotSpatial-PCL,代码行数:15,代码来源:WKBWriter.cs

示例3: SetByteStream

        /// <summary>
        /// 
        /// </summary>
        /// <param name="geometry"></param>
        /// <returns></returns>
        protected int SetByteStream(IMultiPolygon geometry)
        {
			// 4-byte count + subgeometries
			return 4 + SetByteStream(geometry.Geometries);
		}
开发者ID:lishxi,项目名称:_SharpMap,代码行数:10,代码来源:PostGisWriter.cs

示例4: Write

 /// <summary>
 /// 
 /// </summary>
 /// <param name="multiPolygon"></param>
 /// <param name="writer"></param>
 protected void Write(IMultiPolygon multiPolygon, BinaryWriter writer)
 {
     WriteByteOrder(writer);     // LittleIndian
     writer.Write((int) WKBGeometryTypes.WKBMultiPolygon);
     writer.Write((int) multiPolygon.NumGeometries);
     for (int i = 0; i < multiPolygon.NumGeometries; i++)
         Write(multiPolygon.Geometries[i] as IPolygon, writer);
 }
开发者ID:izambakci,项目名称:tf-net,代码行数:13,代码来源:WKBWriter.cs

示例5: SetByteStreamLength

 /// <summary>
 /// 
 /// </summary>
 /// <param name="multiPolygon"></param>
 /// <returns></returns>
 protected int SetByteStreamLength(IMultiPolygon multiPolygon)
 {            
     int numParts = multiPolygon.NumGeometries;               // Exterior rings count            
     foreach (IPolygon polygon in multiPolygon.Geometries)    // Adding interior rings count            
         numParts += polygon.NumInteriorRings;
     int numPoints = multiPolygon.NumPoints;
     return CalculateLength(numParts, numPoints);
 }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:13,代码来源:ShapeWriter.cs

示例6: SetByteStreamLength

 /// <summary>
 /// 
 /// </summary>
 /// <param name="multiPolygon"></param>
 /// <returns></returns>
 protected int SetByteStreamLength(IMultiPolygon multiPolygon)
 {
     int count = InitValue;
     foreach (IPolygon p in multiPolygon.Geometries)
         count += SetByteStreamLength(p);
     return count;
 }
开发者ID:ste10k41,项目名称:nettopologysuite,代码行数:12,代码来源:GMLWriter.cs

示例7: TransformMultiPolygon

 /// <summary>
 /// 
 /// </summary>
 /// <param name="geom"></param>
 /// <param name="parent"></param>
 /// <returns></returns>
 protected override IGeometry TransformMultiPolygon(IMultiPolygon geom, IGeometry parent)
 {
     IGeometry roughGeom = base.TransformMultiPolygon(geom, parent);
     return CreateValidArea(roughGeom);
 }
开发者ID:ste10k41,项目名称:nettopologysuite,代码行数:11,代码来源:DouglasPeuckerSimplifier.cs

示例8: Write

 /// <summary>
 ///
 /// </summary>
 /// <param name="multiPolygon"></param>
 /// <param name="writer"></param>
 protected virtual void Write(IMultiPolygon multiPolygon, BinaryWriter writer)
 {
     WriteByteOrder(writer);
     writer.Write((int)WkbGeometryType.MultiPolygon);
     writer.Write(multiPolygon.NumGeometries);
     for (int i = 0; i < multiPolygon.NumGeometries; i++)
         Write(multiPolygon.Geometries[i] as Polygon, writer);
 }
开发者ID:ExRam,项目名称:DotSpatial-PCL,代码行数:13,代码来源:WkbWriter.cs

示例9: FromMultiPolygon

        private static DSMultiPolygon FromMultiPolygon(IMultiPolygon geometry, DSGeometryFactory factory, bool setUserData)
        {
            var dsPolygons = new DotSpatial.Topology.IPolygon[geometry.NumGeometries];

            for (var i = 0; i < dsPolygons.Length; i++)
                dsPolygons[i] = FromPolygon((IPolygon)geometry.GetGeometryN(i), factory, setUserData);

            var result = factory.CreateMultiPolygon(dsPolygons);
            if (setUserData)
                result.UserData = geometry.UserData;
            return result;
        }
开发者ID:ste10k41,项目名称:nettopologysuite,代码行数:12,代码来源:GeometryConverterToDotSpatial.cs

示例10: FromMultiPolygon

        private static GeoAPIMultiPolygon FromMultiPolygon(IMultiPolygon geometry, GeoAPIGeometryFactory factory, bool copyUserData)
        {
            var dsPolygons = new GeoAPI.Geometries.IPolygon[geometry.NumGeometries];

            for (var i = 0; i < dsPolygons.Length; i++)
                dsPolygons[i] = FromPolygon((IPolygon)geometry.GetGeometryN(i), factory, copyUserData);

            var result = factory.CreateMultiPolygon(dsPolygons);
            if (copyUserData)
                result.UserData = geometry.UserData;
            return result;
        }
开发者ID:Walt-D-Cat,项目名称:NetTopologySuite,代码行数:12,代码来源:GeometryConverterToGeoAPI.cs

示例11: CheckShellsNotNested

 /// <summary>
 /// Tests that no element polygon is wholly in the interior of another element polygon.
 /// Preconditions:
 /// Shells do not partially overlap.
 /// Shells do not touch along an edge.
 /// No duplicate rings exists.
 /// This routine relies on the fact that while polygon shells may touch at one or
 /// more vertices, they cannot touch at ALL vertices.
 /// </summary>
 private void CheckShellsNotNested(IMultiPolygon mp, GeometryGraph graph)
 {            
     for (int i = 0; i < mp.NumGeometries; i++)
     {                
         IPolygon p = (IPolygon) mp.GetGeometryN(i);
         ILinearRing shell = p.Shell;
         for (int j = 0; j < mp.NumGeometries; j++)
         {                    
             if (i == j)
                 continue;
             IPolygon p2 = (IPolygon) mp.GetGeometryN(j);                    
             CheckShellNotNested(shell, p2, graph);
             if (validErr != null) return;
         }                
     }         
 }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:25,代码来源:IsValidOp.cs

示例12: CheckValid

        /// <summary>
        /// 
        /// </summary>
        /// <param name="g"></param>
        private void CheckValid(IMultiPolygon g)
        {
            foreach(IPolygon p in g.Geometries)
            {                                                
                CheckInvalidCoordinates(p);
                if (validErr != null) return;
                CheckClosedRings(p);
                if (validErr != null) return;
            }

            GeometryGraph graph = new GeometryGraph(0, g);
            CheckTooFewPoints(graph);
            if (validErr != null) return;
            CheckConsistentArea(graph);
            if (validErr != null) return;
            if (!IsSelfTouchingRingFormingHoleValid)
            {
                CheckNoSelfIntersectingRings(graph);
                if (validErr != null) return;
            }
            foreach(IPolygon p in g.Geometries)
            {                
                CheckHolesInShell(p, graph);
                if (validErr != null) return;
            }
            foreach (IPolygon p in g.Geometries)
            {                                
                CheckHolesNotNested(p, graph);
                if (validErr != null) return;
            }
            CheckShellsNotNested(g, graph);
            if (validErr != null) return;
            CheckConnectedInteriors(graph);
        }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:38,代码来源:IsValidOp.cs

示例13: Write

        /// <summary>
        /// Method to write a multi polygon geometry to the <paramref name="writer"/>
        /// </summary>
        /// <param name="areas">The multi polygon geometry</param>
        /// <param name="writer">The JSON writer</param>
        public static void Write(IMultiPolygon areas, TextWriter writer)
        {
            if (areas == null)
                return;
            if (writer == null)
                throw new ArgumentNullException("writer", "A valid text writer object is required");

            Write(areas, CreateWriter(writer));
        }
开发者ID:geobabbler,项目名称:SharpMap,代码行数:14,代码来源:GeoJSONWriter.cs

示例14: DrawMultiPolygon

 public static void DrawMultiPolygon(D2D1.RenderTarget renderTarget, D2D1.Factory factory, IMultiPolygon pols, D2D1.Brush brush, D2D1.Brush pen, float penWidth, D2D1.StrokeStyle penStrokeStyle, bool clip, Map map)
 {
     for (var i = 0; i < pols.NumGeometries; i++)
     {
         var p = (IPolygon)pols[i];
         DrawPolygon(renderTarget, factory, p, brush, pen, penWidth, penStrokeStyle, clip, map);
     }
 }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:8,代码来源:SharpDXVectorRenderer.cs

示例15: WriteMultiPolygon

        /// <summary>
        /// Writes a multipolygon.
        /// </summary>
        /// <param name="mp">The mulitpolygon to be written.</param>
        /// <param name="bWriter">Stream to write to.</param>
        /// <param name="byteorder">Byte order</param>
        private static void WriteMultiPolygon(IMultiPolygon mp, BinaryWriter bWriter, WkbByteOrder byteorder)
        {
            //Write the number of polygons.
            int num = mp.NumGeometries;
            WriteUInt32((uint) num, bWriter, byteorder);

            //Loop on the number of polygons.
            //NOTE: by contract, the first item returned 
            //      from GetEnumerator (i.e. using foreach) is the IMultiPolygon itself!
            for (int i = 0; i < num; i++)
            {
                IPolygon poly = (IPolygon) mp.GetGeometryN(i);
                //Write polygon header
                bWriter.Write((byte) byteorder);
                WriteUInt32((uint) WKBGeometryType.wkbPolygon, bWriter, byteorder);
                //Write each polygon.
                WritePolygon(poly, bWriter, byteorder);
            }
        }
开发者ID:geobabbler,项目名称:SharpMap,代码行数:25,代码来源:GeometryToWKB.cs


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