本文整理汇总了C#中IPrecisionModel类的典型用法代码示例。如果您正苦于以下问题:C# IPrecisionModel类的具体用法?C# IPrecisionModel怎么用?C# IPrecisionModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPrecisionModel类属于命名空间,在下文中一共展示了IPrecisionModel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: DensifyPoints
/// <summary>
/// Densifies a coordinate sequence.
/// </summary>
/// <param name="pts">The coordinate sequence to densify</param>
/// <param name="distanceTolerance">The distance tolerance (<see cref="DistanceTolerance"/>)</param>
/// <param name="precModel">The precision model to apply on the new coordinates</param>
/// <returns>The densified coordinate sequence</returns>
private static Coordinate[] DensifyPoints(Coordinate[] pts,
double distanceTolerance, IPrecisionModel precModel)
{
var seg = new LineSegment();
var coordList = new CoordinateList();
for (int i = 0; i < pts.Length - 1; i++)
{
seg.P0 = pts[i];
seg.P1 = pts[i + 1];
coordList.Add(seg.P0, false);
double len = seg.Length;
int densifiedSegCount = (int) (len/distanceTolerance) + 1;
if (densifiedSegCount > 1)
{
double densifiedSegLen = len/densifiedSegCount;
for (int j = 1; j < densifiedSegCount; j++)
{
double segFract = (j*densifiedSegLen)/len;
var p = seg.PointAlong(segFract);
precModel.MakePrecise(p);
coordList.Add(p, false);
}
}
}
coordList.Add(pts[pts.Length - 1], false);
return coordList.ToCoordinateArray();
}
开发者ID:Walt-D-Cat,项目名称:NetTopologySuite,代码行数:34,代码来源:Densifier.cs
示例2: GeometryFactory
/// <summary>
/// Constructs a GeometryFactory that generates Geometries having the given
/// PrecisionModel, spatial-reference ID, and CoordinateSequence implementation.
/// </summary>
/// <param name="precisionModel"></param>
/// <param name="SRID"></param>
/// <param name="coordinateSequenceFactory"></param>
public GeometryFactory(IPrecisionModel precisionModel, int SRID,
ICoordinateSequenceFactory coordinateSequenceFactory)
{
this.precisionModel = precisionModel;
this.coordinateSequenceFactory = coordinateSequenceFactory;
this.srid = SRID;
}
开发者ID:izambakci,项目名称:tf-net,代码行数:14,代码来源:GeometryFactory.cs
示例3: OffsetCurveBuilder
public OffsetCurveBuilder(
IPrecisionModel precisionModel,
IBufferParameters bufParams
)
{
_precisionModel = precisionModel;
_bufParams = bufParams;
}
开发者ID:leoliusg,项目名称:NetTopologySuite,代码行数:8,代码来源:OffsetCurveBuilder.cs
示例4: OffsetCurveBuilder
/// <summary>
///
/// </summary>
/// <param name="precisionModel"></param>
/// <param name="quadrantSegments"></param>
public OffsetCurveBuilder(IPrecisionModel precisionModel, int quadrantSegments)
{
this.precisionModel = precisionModel;
// compute intersections in full precision, to provide accuracy
// the points are rounded as they are inserted into the curve line
li = new RobustLineIntersector();
var limitedQuadSegs = quadrantSegments < 1 ? 1 : quadrantSegments;
filletAngleQuantum = Math.PI / 2.0 / limitedQuadSegs;
}
开发者ID:maxm,项目名称:osmuy,代码行数:14,代码来源:OffsetCurveBuilder.cs
示例5: PreciseCoordinateTester
private static void PreciseCoordinateTester(IPrecisionModel pm,
double x1, double y1,
double x2, double y2)
{
var p = new Coordinate(x1, y1);
pm.MakePrecise(p);
var pPrecise = new Coordinate(x2, y2);
Assert.IsTrue(p.Equals2D(pPrecise), "Expected {0}, but got {1}", pPrecise, p);
}
开发者ID:Walt-D-Cat,项目名称:NetTopologySuite,代码行数:10,代码来源:PrecisionModelTest.cs
示例6: OffsetSegmentGenerator
public OffsetSegmentGenerator(IPrecisionModel precisionModel,
IBufferParameters bufParams, double distance)
{
_precisionModel = precisionModel;
_bufParams = bufParams;
// compute intersections in full precision, to provide accuracy
// the points are rounded as they are inserted into the curve line
_li = new RobustLineIntersector();
_filletAngleQuantum = Math.PI / 2.0 / bufParams.QuadrantSegments;
/**
* Non-round joins cause issues with short closing segments, so don't use
* them. In any case, non-round joins only really make sense for relatively
* small buffer distances.
*/
if (bufParams.QuadrantSegments >= 8
&& bufParams.JoinStyle == JoinStyle.Round)
_closingSegLengthFactor = MaxClosingSegLenFactor;
Init(distance);
}
开发者ID:ste10k41,项目名称:nettopologysuite,代码行数:21,代码来源:OffsetSegmentGenerator.cs
示例7: OldOffsetCurveBuilder
public OldOffsetCurveBuilder(
IPrecisionModel precisionModel,
IBufferParameters bufParams
)
{
_precisionModel = precisionModel;
_bufParams = bufParams;
// compute intersections in full precision, to provide accuracy
// the points are rounded as they are inserted into the curve line
_li = new RobustLineIntersector();
_filletAngleQuantum = Math.PI / 2.0 / bufParams.QuadrantSegments;
/**
* Non-round joins cause issues with short closing segments,
* so don't use them. In any case, non-round joins
* only really make sense for relatively small buffer distances.
*/
if (bufParams.QuadrantSegments >= 8
&& bufParams.JoinStyle == JoinStyle.Round)
closingSegFactor = MAX_CLOSING_SEG_FRACTION;
}
开发者ID:ste10k41,项目名称:nettopologysuite,代码行数:22,代码来源:OldOffsetCurveBuilder.cs
示例8: IteratedNoder
/// <summary>
/// Initializes a new instance of the <see cref="IteratedNoder"/> class.
/// </summary>
/// <param name="pm"></param>
public IteratedNoder(IPrecisionModel pm)
{
_li = new RobustLineIntersector {PrecisionModel = pm};
}
开发者ID:barentswatch,项目名称:NetTopologySuite,代码行数:8,代码来源:IteratedNoder.cs
示例9: BufferFixedPrecision
/// <summary>
///
/// </summary>
/// <param name="fixedPM"></param>
private void BufferFixedPrecision(IPrecisionModel fixedPM)
{
INoder noder = new ScaledNoder(new MCIndexSnapRounder(new PrecisionModel(1.0)), fixedPM.Scale);
var bufBuilder = new BufferBuilder
{
WorkingPrecisionModel = fixedPM,
Noder = noder,
QuadrantSegments = quadrantSegments,
EndCapStyle = endCapStyle
};
// this may throw an exception, if robustness errors are encountered
resultGeometry = bufBuilder.Buffer(argGeom, distance);
}
开发者ID:lishxi,项目名称:_SharpMap,代码行数:18,代码来源:BufferOp.cs
示例10: RandomOrdinate
private static double RandomOrdinate(Ordinate o, IPrecisionModel pm)
{
switch (o)
{
case Ordinate.X:
return pm.MakePrecise(-180 + 360 * Rnd.NextDouble());
case Ordinate.Y:
return pm.MakePrecise(-90 + 180 * Rnd.NextDouble());
case Ordinate.Z:
return 200 * Rnd.NextDouble();
case Ordinate.M:
return 200 + 200 * Rnd.NextDouble();
default:
throw new NotSupportedException();
}
}
开发者ID:Walt-D-Cat,项目名称:NetTopologySuite,代码行数:16,代码来源:ShapefileWriteTest.cs
示例11: MCIndexSnapRounder
/// <summary>
/// Initializes a new instance of the <see cref="MCIndexSnapRounder"/> class.
/// </summary>
/// <param name="pm">The <see cref="PrecisionModel" /> to use.</param>
public MCIndexSnapRounder(IPrecisionModel pm)
{
_li = new RobustLineIntersector { PrecisionModel = pm };
_scaleFactor = pm.Scale;
}
开发者ID:barentswatch,项目名称:NetTopologySuite,代码行数:9,代码来源:MCIndexSnapRounder.cs
示例12: GeometryNoder
//private bool isValidityChecked = false;
/// <summary>
/// Creates a new noder which snap-rounds to a grid specified by the given <see cref="IPrecisionModel"/>
/// </summary>
/// <param name="pm">The precision model for the grid to snap-round to.</param>
public GeometryNoder(IPrecisionModel pm)
{
_pm = pm;
}
开发者ID:ste10k41,项目名称:nettopologysuite,代码行数:10,代码来源:GeometryNoder.cs
示例13: GetEnvelopeExternal
/// <summary>
/// Get Envelope in external coordinates.
/// </summary>
/// <param name="precisionModel">The precision model to use</param>
/// <param name="envelope">The envelope to get</param>
/// <returns></returns>
public static Envelope GetEnvelopeExternal(IPrecisionModel precisionModel, Envelope envelope)
{
// Get envelope in external coordinates
var min = new Coordinate(envelope.MinX, envelope.MinY);
precisionModel.MakePrecise(min);
var max = new Coordinate(envelope.MaxX, envelope.MaxY);
precisionModel.MakePrecise(max);
var bounds = new Envelope(min.X, max.X, min.Y, max.Y);
return bounds;
//return GetEnvelopeExternal(envelope);
}
开发者ID:Walt-D-Cat,项目名称:NetTopologySuite,代码行数:19,代码来源:ShapeHandler.cs
示例14: CompareTo
/// <summary>
///
/// </summary>
/// <param name="other"></param>
/// <returns></returns>
public int CompareTo(IPrecisionModel other)
{
int sigDigits = MaximumSignificantDigits;
int otherSigDigits = other.MaximumSignificantDigits;
return (sigDigits).CompareTo(otherSigDigits);
}
开发者ID:Walt-D-Cat,项目名称:NetTopologySuite,代码行数:11,代码来源:PrecisionModel.cs
示例15: GetNoder
/// <summary>
///
/// </summary>
/// <param name="precisionModel"></param>
/// <returns></returns>
private INoder GetNoder(IPrecisionModel precisionModel)
{
if (workingNoder != null)
return workingNoder;
// otherwise use a fast (but non-robust) noder
LineIntersector li = new RobustLineIntersector();
li.PrecisionModel = precisionModel;
MCIndexNoder noder = new MCIndexNoder(new IntersectionAdder(li));
return noder;
}
开发者ID:ExRam,项目名称:DotSpatial-PCL,代码行数:16,代码来源:BufferBuilder.cs
示例16: GeometryFactory
/// <summary>
/// Constructs a GeometryFactory that generates Geometries having the given
/// {PrecisionModel} and the default CoordinateSequence
/// implementation.
/// </summary>
/// <param name="precisionModel">The PrecisionModel to use.</param>
public GeometryFactory(IPrecisionModel precisionModel)
: this(precisionModel, 0, GetDefaultCoordinateSequenceFactory()) { }
开发者ID:DIVEROVIEDO,项目名称:DotSpatial,代码行数:8,代码来源:GeometryFactory.cs
示例17: WriteEnvelope
/// <summary>
/// Method to write the bounding box of x- and y- ordinates (aka envelope)
/// </summary>
/// <param name="writer">The writer to use</param>
/// <param name="precisionModel">The precision model to precise</param>
/// <param name="envelope">The envelope to write</param>
protected static void WriteEnvelope(BinaryWriter writer, IPrecisionModel precisionModel, Envelope envelope)
{
//precise the envelope
envelope = GetEnvelopeExternal(precisionModel, envelope);
writer.Write(envelope.MinX);
writer.Write(envelope.MinY);
writer.Write(envelope.MaxX);
writer.Write(envelope.MaxY);
}
开发者ID:Walt-D-Cat,项目名称:NetTopologySuite,代码行数:16,代码来源:ShapeHandler.cs
示例18: ComputeNodedEdges
/// <summary>
///
/// </summary>
/// <param name="bufferSegStrList"></param>
/// <param name="precisionModel"></param>
private void ComputeNodedEdges(IList bufferSegStrList, IPrecisionModel precisionModel)
{
INoder noder = GetNoder(precisionModel);
noder.ComputeNodes(bufferSegStrList);
IList nodedSegStrings = noder.GetNodedSubstrings();
foreach(object obj in nodedSegStrings)
{
SegmentString segStr = (SegmentString) obj;
Label oldLabel = (Label) segStr.Data;
Edge edge = new Edge(segStr.Coordinates, new Label(oldLabel));
InsertEdge(edge);
}
}
开发者ID:ExRam,项目名称:DotSpatial-PCL,代码行数:19,代码来源:BufferBuilder.cs
示例19: AppendPointTaggedText
/// <summary>
/// Converts a <c>Coordinate</c> to Point Tagged Text format,
/// then appends it to the writer.
/// </summary>
/// <param name="coordinate">The <c>Coordinate</c> to process.</param>
/// <param name="level"></param>
/// <param name="writer">The output writer to append to.</param>
/// <param name="precisionModel">
/// The <c>PrecisionModel</c> to use to convert
/// from a precise coordinate to an external coordinate.
/// </param>
private void AppendPointTaggedText(ICoordinate coordinate, int level, TextWriter writer, IPrecisionModel precisionModel)
{
writer.Write("POINT");
AppendPointText(coordinate, level, writer, precisionModel);
}
开发者ID:lishxi,项目名称:_SharpMap,代码行数:16,代码来源:WKTWriter.cs
示例20: Equals
/// <summary>
///
/// </summary>
/// <param name="otherPrecisionModel"></param>
/// <returns></returns>
public bool Equals(IPrecisionModel otherPrecisionModel)
{
return _modelType == otherPrecisionModel.PrecisionModelType &&
_scale == otherPrecisionModel.Scale;
}
开发者ID:Walt-D-Cat,项目名称:NetTopologySuite,代码行数:10,代码来源:PrecisionModel.cs
注:本文中的IPrecisionModel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论