本文整理汇总了C#中IMultiPolygon类的典型用法代码示例。如果您正苦于以下问题:C# IMultiPolygon类的具体用法?C# IMultiPolygon怎么用?C# IMultiPolygon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IMultiPolygon类属于命名空间,在下文中一共展示了IMultiPolygon类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: TransformMultiPolygon
/// <summary>
/// Transforms a <see cref="GeoAPI.Geometries.IMultiPolygon"/>.
/// </summary>
/// <param name="polys">MultiPolygon to transform</param>
/// <param name="from">Source Projection</param>
/// <param name="to">Target Projection</param>
/// <param name="toFactory">The factory to create geometries for <paramref name="to"/></param>
/// <returns>Transformed MultiPolygon</returns>
public static IMultiPolygon TransformMultiPolygon(IMultiPolygon polys, ProjectionInfo from, ProjectionInfo to, IGeometryFactory toFactory)
{
var pOut = new IPolygon[polys.Count];
for (var i = 0; i < polys.Count; i++)
pOut[i] = TransformPolygon((IPolygon)polys.GetGeometryN(i), from, to, toFactory);
return toFactory.CreateMultiPolygon(pOut);
}
开发者ID:PedroMaitan,项目名称:sharpmap,代码行数:16,代码来源:GeometryTransformDotSpatial.cs
示例17: Write
private void Write(IMultiPolygon multiPoly)
{
EnsureGeometryFactory(multiPoly);
int contentLength = ContentLength(multiPoly);
_writerIndex.WriteBE(_filePos);
_writerIndex.WriteBE(contentLength);
_writerShape.WriteBE(_recordNumber++);
_writerShape.WriteBE(contentLength);
_writerShape.Write((int)ShapefileGeometryType.Polygon);
Write(multiPoly.EnvelopeInternal);
int numParts = multiPoly.Geometries.Cast<IPolygon>().Sum(g => g.Holes.Length + 1);
int numPoints = multiPoly.NumPoints;
_writerShape.Write(numParts);
_writerShape.Write(numPoints);
// write the offsets to the points
int offset = 0;
foreach (IPolygon poly in multiPoly.Geometries)
{
// offset to the shell points
_writerShape.Write(offset);
offset = offset + poly.Shell.NumPoints;
// offstes to the holes
foreach (ILinearRing ring in poly.Holes)
{
_writerShape.Write(offset);
offset = offset + ring.NumPoints;
}
}
// write the points
foreach (IPolygon poly in multiPoly.Geometries)
{
Write(poly.Shell.Coordinates);
foreach (ILinearRing ring in poly.Holes)
Write(ring.Coordinates);
}
_filePos += 4 + contentLength;
}
开发者ID:interworks,项目名称:FastShapefile,代码行数:47,代码来源:ShapefileWriter.cs
示例18: SetByteStream
/// <summary>
///
/// </summary>
/// <param name="geometry"></param>
/// <returns></returns>
protected virtual int SetByteStream(IMultiPolygon geometry)
{
int count = INIT_COUNT;
count += 4;
foreach (Polygon geom in geometry.Geometries)
count += SetByteStream(geom);
return count;
}
开发者ID:ExRam,项目名称:DotSpatial-PCL,代码行数:13,代码来源:WkbWriter.cs
示例19: ContentLength
public int ContentLength(IMultiPolygon poly)
{
int numParts = poly.Geometries.Cast<IPolygon>().Sum(g => g.Holes.Length + 1);
return (22 + (2 * numParts) + (poly.NumPoints * 8)); // 22 => shapetype(2) + bbox(4*4) + numparts(2) + numpoints(2)
}
开发者ID:interworks,项目名称:FastShapefile,代码行数:5,代码来源:ShapefileWriter.cs
示例20: Write
/// <summary>
///
/// </summary>
/// <param name="multiPolygon"></param>
/// <param name="writer"></param>
protected void Write(IMultiPolygon multiPolygon, XmlTextWriter writer)
{
writer.WriteStartElement("MultiPolygon", GMLElements.gmlNS);
for (int i = 0; i < multiPolygon.NumGeometries; i++)
{
writer.WriteStartElement("polygonMember", GMLElements.gmlNS);
Write(multiPolygon.Geometries[i] as IPolygon, writer);
writer.WriteEndElement();
}
writer.WriteEndElement();
}
开发者ID:ste10k41,项目名称:nettopologysuite,代码行数:16,代码来源:GMLWriter.cs
注:本文中的IMultiPolygon类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论