本文整理汇总了C#中IMultiLineString类的典型用法代码示例。如果您正苦于以下问题:C# IMultiLineString类的具体用法?C# IMultiLineString怎么用?C# IMultiLineString使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IMultiLineString类属于命名空间,在下文中一共展示了IMultiLineString类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ComputeBoundaryCoordinates
//private Map endpointMap;
private Coordinate[] ComputeBoundaryCoordinates(IMultiLineString mLine)
{
IList<Coordinate> bdyPts = new List<Coordinate>();
_endpointMap = new OrderedDictionary<Coordinate, Counter>();
for (int i = 0; i < mLine.NumGeometries; i++)
{
ILineString line = (ILineString)mLine.GetGeometryN(i);
if (line.NumPoints == 0)
continue;
AddEndpoint(line.GetCoordinateN(0));
AddEndpoint(line.GetCoordinateN(line.NumPoints - 1));
}
foreach (KeyValuePair<Coordinate, Counter> entry in _endpointMap)
{
Counter counter = entry.Value;
int valence = counter.Count;
if (_bnRule.IsInBoundary(valence))
{
bdyPts.Add(entry.Key);
}
}
return CoordinateArrays.ToCoordinateArray(bdyPts);
}
示例2: DrawMultiLineString
public static void DrawMultiLineString(D2D1.RenderTarget renderTarget, D2D1.Factory factory, IMultiLineString lines, D2D1.Brush pen, float penWidth, D2D1.StrokeStyle penStrokeStyle, Map map, float offset)
{
for (var i = 0; i < lines.NumGeometries; i++)
{
var line = (ILineString)lines[i];
DrawLineString(renderTarget, factory, line, pen, penWidth, penStrokeStyle, map, offset);
}
}
示例3: DrawMultiLineString
public static void DrawMultiLineString(Graphics g, IMultiLineString lines, Pen pen, Map map, float offset)
{
for(var i = 0; i < lines.NumGeometries; i++)
{
var line = (ILineString) lines[i];
DrawLineString(g, line, pen, map, offset);
}
}
示例4: GeometryToSqlGeometry
private static void GeometryToSqlGeometry(IMultiLineString geom, SqlGeometryBuilder bldr)
{
bldr.BeginGeometry(OpenGisGeometryType.MultiLineString);
for (int i = 0, c = geom.NumGeometries; i < c; i++)
GeometryToSqlGeometry(geom.Geometries[i] as ILineString, bldr);
bldr.EndGeometry();
}
示例5: BoundaryMultiLineString
private IGeometry BoundaryMultiLineString(IMultiLineString mLine)
{
if (_geom.IsEmpty)
{
return GetEmptyMultiPoint();
}
Coordinate[] bdyPts = ComputeBoundaryCoordinates(mLine);
// return Point or MultiPoint
if (bdyPts.Length == 1)
{
return _geomFact.CreatePoint(bdyPts[0]);
}
// this handles 0 points case as well
return _geomFact.CreateMultiPoint(bdyPts);
}
示例6: SetByteStream
/// <summary>
///
/// </summary>
/// <param name="geometry"></param>
/// <returns></returns>
protected int SetByteStream(IMultiLineString geometry)
{
// 4-byte count + subgeometries
return 4 + SetByteStream(geometry.Geometries);
}
示例7: Write
/// <summary>
///
/// </summary>
/// <param name="multiLineString"></param>
/// <param name="writer"></param>
protected void Write(IMultiLineString multiLineString, BinaryWriter writer)
{
WriteByteOrder(writer); // LittleIndian
writer.Write((int) WKBGeometryTypes.WKBMultiLineString);
writer.Write((int) multiLineString.NumGeometries);
for (int i = 0; i < multiLineString.NumGeometries; i++)
Write(multiLineString.Geometries[i] as ILineString, writer);
}
示例8: SetByteStreamLength
/// <summary>
///
/// </summary>
/// <param name="multiLineString"></param>
/// <returns></returns>
protected int SetByteStreamLength(IMultiLineString multiLineString)
{
int numParts = multiLineString.NumGeometries;
int numPoints = multiLineString.NumPoints;
return CalculateLength(numParts, numPoints);
}
示例9: SetByteStreamLength
/// <summary>
///
/// </summary>
/// <param name="multiLineString"></param>
/// <returns></returns>
protected int SetByteStreamLength(IMultiLineString multiLineString)
{
int count = InitValue;
foreach (ILineString ls in multiLineString.Geometries)
count += SetByteStreamLength(ls);
return count;
}
示例10: IsSimple
public bool IsSimple(IMultiLineString geom)
{
return IsSimpleLinearGeometry(geom);
}
示例11: Write
/// <summary>
///
/// </summary>
/// <param name="multiLineString"></param>
/// <param name="writer"></param>
protected virtual void Write(IMultiLineString multiLineString, BinaryWriter writer)
{
WriteByteOrder(writer);
writer.Write((int)WkbGeometryType.MultiLineString);
writer.Write(multiLineString.NumGeometries);
for (int i = 0; i < multiLineString.NumGeometries; i++)
Write(multiLineString.Geometries[i] as LineString, writer);
}
示例12: FromMultiLineString
private static GeoAPIMultiLineString FromMultiLineString(IMultiLineString geometry, GeoAPIGeometryFactory factory, bool copyUserData)
{
var dsLineStrings = new GeoAPILineString[geometry.NumGeometries];
for (var i = 0; i < dsLineStrings.Length; i++)
dsLineStrings[i] = FromLineString((ILineString)geometry.GetGeometryN(i), factory, copyUserData);
var result = factory.CreateMultiLineString(dsLineStrings);
if (copyUserData)
result.UserData = geometry.UserData;
return result;
}
示例13: Write
/// <summary>
/// Method to write a multi linestring geometry to the <paramref name="writer"/>
/// </summary>
/// <param name="lines">The multi linestring geometry</param>
/// <param name="writer">The JSON writer</param>
public static void Write(IMultiLineString lines, TextWriter writer)
{
if (lines == null)
return;
if (writer == null)
throw new ArgumentNullException("writer", "A valid text writer object is required");
Write(lines, CreateWriter(writer));
}
示例14: Write
/// <summary>
///
/// </summary>
/// <param name="multiLineString"></param>
/// <param name="writer"></param>
protected void Write(IMultiLineString multiLineString, BinaryWriter writer)
{
WriteByteOrder(writer); // LittleIndian
if (Double.IsNaN(multiLineString.Coordinate.Z))
writer.Write((int)WKBGeometryTypes.WKBMultiLineString);
else writer.Write((int)WKBGeometryTypes.WKBMultiLineStringZ);
writer.Write((int) multiLineString.NumGeometries);
for (int i = 0; i < multiLineString.NumGeometries; i++)
Write(multiLineString.Geometries[i] as ILineString, writer);
}
示例15: WriteMultiLineString
/// <summary>
/// Writes a multilinestring.
/// </summary>
/// <param name="mls">The multilinestring to be written.</param>
/// <param name="bWriter">Stream to write to.</param>
/// <param name="byteorder">Byte order</param>
private static void WriteMultiLineString(IMultiLineString mls, BinaryWriter bWriter, WkbByteOrder byteorder)
{
//Write the number of linestrings.
int num = mls.NumGeometries;
WriteUInt32((uint) num, bWriter, byteorder);
//Loop on the number of linestrings.
//NOTE: by contract, the first item returned
// from GetEnumerator (i.e. using foreach) is the IMultiLineString itself!
for (int i = 0; i < num; i++)
{
ILineString ls = (ILineString) mls.GetGeometryN(i);
//Write LineString Header
bWriter.Write((byte)byteorder);
WriteUInt32((uint)WKBGeometryType.wkbLineString, bWriter, byteorder);
//Write each linestring.
WriteLineString(ls, bWriter, byteorder);
}
}