本文整理汇总了C#中IEnvelope.Copy方法的典型用法代码示例。如果您正苦于以下问题:C# IEnvelope.Copy方法的具体用法?C# IEnvelope.Copy怎么用?C# IEnvelope.Copy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEnvelope
的用法示例。
在下文中一共展示了IEnvelope.Copy方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExpandEnvelope
/// <summary>
/// Expands the given Envelope to include the coordinates in the sequence.
/// Does not modify the original envelope, but rather returns a copy of the
/// original envelope after being modified.
/// </summary>
/// <param name="env">The envelope use as the starting point for expansion. This envelope will not be modified.</param>
/// <returns>The newly created envelope that is the expanded version of the original.</returns>
public IEnvelope ExpandEnvelope(IEnvelope env)
{
IEnvelope temp = env.Copy();
foreach (Coordinate coord in _internalList)
{
temp.ExpandToInclude(coord);
}
return temp;
}
示例2: Select
/// <summary>
/// returns only the features that have envelopes that
/// intersect with the specified envelope. If in indexMode, this uses the ShapeIndices to create
/// features on demand, rather than loading all the features. It is much faster to use selectIndices
/// when in index mode.
/// </summary>
/// <param name="region">The specified region to test for intersect with</param>
/// <param name="affectedRegion">This returns the geographic extents that contains the modified contents.</param>
/// <returns>A List of the IFeature elements that are contained in this region</returns>
public virtual List<IFeature> Select(IEnvelope region, out IEnvelope affectedRegion)
{
List<IFeature> result = new List<IFeature>();
if(IndexMode)
{
ShapeRange aoi = new ShapeRange(new Extent(region));
IEnvelope env = region.Copy();
Extent affected = new Extent();
List<ShapeRange> shapes = ShapeIndices;
if(shapes != null)
{
for(int shp = 0; shp < shapes.Count; shp++)
{
if (!shapes[shp].Intersects(aoi)) continue;
IFeature f = GetFeature(shp);
affected.ExpandToInclude(shapes[shp].Extent);
result.Add(f);
}
}
affectedRegion = affected.ToEnvelope();
return result;
}
affectedRegion = new Envelope();
foreach (IFeature feature in Features)
{
if (!feature.Envelope.Intersects(region)) continue;
result.Add(feature);
affectedRegion.ExpandToInclude(feature.Envelope);
}
return result;
}
示例3: Union
/// <summary>
/// Calculates the union of the current box and the given box.
/// </summary>
public static IEnvelope Union(this IEnvelope self, IEnvelope box)
{
if (box == null) return self.Copy();
if (box.IsNull) return self.Copy();
if (self == null) return box.Copy();
if (self.IsNull) return box.Copy();
IEnvelope result = self.Copy();
result.ExpandToInclude(box);
return result;
}
示例4: DrawWindow
/// <summary>
/// Constructs a new DrawWindow based on the specified IEnvelope. The envelope becomes
/// the GeographicView for this DrawWindow.
/// </summary>
/// <param name="env"></param>
public DrawWindow(IEnvelope env)
: base(env)
{
_geographicView = env.Copy();
}
示例5: ExpandEnvelope
/// <summary>
/// Expands the given Envelope to include the coordinates in the sequence.
/// Does not modify the original envelope, but rather returns a copy of the
/// original envelope after being modified.
/// </summary>
/// <param name="env">The envelope use as the starting point for expansion. This envelope will not be modified.</param>
/// <returns>The newly created envelope that is the expanded version of the original.</returns>
public virtual IEnvelope ExpandEnvelope(IEnvelope env)
{
IEnvelope cEnv = env.Copy();
for (int i = 0; i < _coordinates.Length; i++)
{
cEnv.ExpandToInclude(_coordinates[i]);
}
return cEnv;
}