예제 #1
0
 public virtual void OffsetPolygon_(double distance, com.epl.geometry.OperatorOffset.JoinType joins)
 {
     com.epl.geometry.Polygon polygon = new com.epl.geometry.Polygon();
     polygon.StartPath(0, 0);
     polygon.LineTo(0, 16);
     polygon.LineTo(16, 16);
     polygon.LineTo(16, 11);
     polygon.LineTo(10, 10);
     polygon.LineTo(10, 12);
     polygon.LineTo(3, 12);
     polygon.LineTo(3, 4);
     polygon.LineTo(10, 4);
     polygon.LineTo(10, 6);
     polygon.LineTo(16, 5);
     polygon.LineTo(16, 0);
     com.epl.geometry.OperatorOffset offset     = (com.epl.geometry.OperatorOffset)com.epl.geometry.OperatorFactoryLocal.GetInstance().GetOperator(com.epl.geometry.Operator.Type.Offset);
     com.epl.geometry.Geometry       outputGeom = offset.Execute(polygon, null, distance, joins, 2, 0, null);
     NUnit.Framework.Assert.IsNotNull(outputGeom);
     if (distance > 2)
     {
         NUnit.Framework.Assert.IsTrue(outputGeom.IsEmpty());
     }
 }
예제 #2
0
 public override com.epl.geometry.Geometry Execute(com.epl.geometry.Geometry inputGeometry, com.epl.geometry.SpatialReference sr, double distance, com.epl.geometry.OperatorOffset.JoinType joins, double bevelRatio, double flattenError, com.epl.geometry.ProgressTracker progressTracker
                                                   )
 {
     com.epl.geometry.SimpleGeometryCursor inputCursor = new com.epl.geometry.SimpleGeometryCursor(inputGeometry);
     com.epl.geometry.GeometryCursor       outCursor   = Execute(inputCursor, sr, distance, joins, bevelRatio, flattenError, progressTracker);
     return(outCursor.Next());
 }
예제 #3
0
 public override com.epl.geometry.GeometryCursor Execute(com.epl.geometry.GeometryCursor inputGeometries, com.epl.geometry.SpatialReference sr, double distance, com.epl.geometry.OperatorOffset.JoinType joins, double bevelRatio, double flattenError, com.epl.geometry.ProgressTracker
                                                         progressTracker)
 {
     return(new com.epl.geometry.OperatorOffsetCursor(inputGeometries, sr, distance, joins, bevelRatio, flattenError, progressTracker));
 }
 internal OperatorOffsetCursor(com.epl.geometry.GeometryCursor inputGeometries, com.epl.geometry.SpatialReference sr, double distance, com.epl.geometry.OperatorOffset.JoinType joins, double bevelRatio, double flattenError, com.epl.geometry.ProgressTracker progressTracker)
 {
     m_index            = -1;
     m_inputGeoms       = inputGeometries;
     m_spatialReference = (com.epl.geometry.SpatialReferenceImpl)sr;
     m_distance         = distance;
     m_joins            = joins;
     m_miterLimit       = bevelRatio;
     m_flattenError     = flattenError;
     m_progressTracker  = progressTracker;
 }
예제 #5
0
 /// <summary>Creates offset version of the input geometries.</summary>
 /// <remarks>
 /// Creates offset version of the input geometries.
 /// The offset operation creates a geometry that is a constant distance from
 /// an input polyline or polygon. It is similar to buffering, but produces a
 /// one sided result. If offsetDistance &gt; 0, then the offset geometry is
 /// constructed to the right of the oriented input geometry, otherwise it is
 /// constructed to the left. For a simple polygon, the orientation of outer
 /// rings is clockwise and for inner rings it is counter clockwise. So the
 /// "right side" of a simple polygon is always its inside. The bevelRatio is
 /// multiplied by the offset distance and the result determines how far a
 /// mitered offset intersection can be from the input curve before it is
 /// beveled.
 /// </remarks>
 /// <param name="inputGeometries">
 /// The geometries to calculate offset for. Point and MultiPoint
 /// are not supported.
 /// </param>
 /// <param name="sr">The SpatialReference of the Geometries.</param>
 /// <param name="distance">The offset distance for the Geometries.</param>
 /// <param name="joins">The join type of the offset geometry.</param>
 /// <param name="bevelRatio">
 /// The ratio used to produce a bevel join instead of a miter join
 /// (used only when joins is Miter)
 /// </param>
 /// <param name="flattenError">
 /// The maximum distance of the resulting segments compared to the
 /// true circular arc (used only when joins is Round). If
 /// flattenError is 0, tolerance value is used. Also, the
 /// algorithm never produces more than around 180 vertices for
 /// each round join.
 /// </param>
 /// <returns>Returns the result of the offset operation.</returns>
 public abstract com.epl.geometry.GeometryCursor Execute(com.epl.geometry.GeometryCursor inputGeometries, com.epl.geometry.SpatialReference sr, double distance, com.epl.geometry.OperatorOffset.JoinType joins, double bevelRatio, double flattenError, com.epl.geometry.ProgressTracker
                                                         progressTracker);