本文整理汇总了C#中IEnvelope类的典型用法代码示例。如果您正苦于以下问题:C# IEnvelope类的具体用法?C# IEnvelope怎么用?C# IEnvelope使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IEnvelope类属于命名空间,在下文中一共展示了IEnvelope类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateAois
/// <summary>
/// Takes the users large AOI and breaks it down to smaller 1x1 degree AOI's to query all information in the larger one.
/// </summary>
/// <param name="env">
/// The envelope of the large AOI
/// </param>
/// <returns>
/// Returns a list of polygons that are used to query GBD.
/// </returns>
public static List<GbdPolygon> CreateAois(IEnvelope env)
{
try
{
env.Project(Jarvis.ProjectedCoordinateSystem);
List<GbdPolygon> polygons = new List<GbdPolygon>();
IPoint startingPoint = env.UpperLeft;
if (startingPoint.IsEmpty)
{
return null;
}
while (startingPoint.Y != env.LowerLeft.Y)
{
var temp = ProcessRow(new List<GbdPolygon>(), startingPoint, env);
polygons.AddRange(temp);
var newY = GetY(startingPoint, env);
startingPoint.Y = newY;
}
return polygons;
}
catch (Exception error)
{
return null;
}
}
示例2: Insert
/// <summary>
/// Insert an item into the quadtree this is the root of.
/// </summary>
public virtual void Insert(IEnvelope itemEnv, object item)
{
int index = GetSubnodeIndex(itemEnv, origin);
// if index is -1, itemEnv must cross the X or Y axis.
if (index == -1)
{
Add(item);
return;
}
/*
* the item must be contained in one quadrant, so insert it into the
* tree for that quadrant (which may not yet exist)
*/
Node node = Nodes[index];
/*
* If the subquad doesn't exist or this item is not contained in it,
* have to expand the tree upward to contain the item.
*/
if (node == null || ! node.Envelope.Contains(itemEnv))
{
Node largerNode = Node.CreateExpanded(node, itemEnv);
Nodes[index] = largerNode;
}
/*
* At this point we have a subquad which exists and must contain
* contains the env for the item. Insert the item into the tree.
*/
InsertContained(Nodes[index], itemEnv, item);
}
示例3: InMemoryCache
/// <summary>
/// Constructor
/// </summary>
/// <param name="repository">The repository</param>
/// <param name="fullExtent">Full Extent</param>
/// <param name="featureClass">FeatureClass name</param>
public InMemoryCache(IRepository repository, IEnvelope fullExtent, string featureClass)
{
this._repository = repository;
this._featureName = featureClass;
this.BuildGrid(fullExtent);
}
示例4: Remove
/// <summary>
/// Remove the row
/// </summary>
/// <param name="itemEnv"></param>
/// <param name="item"></param>
/// <returns></returns>
public bool Remove(IEnvelope itemEnv, int item)
{
bool retValue = base.Remove(itemEnv, item);
if (retValue)
AdjustNodesForDeletedItem(Root, item);
return retValue;
}
示例5: Identify
private void Identify(IEnumerable<ILayer> layers, IEnvelope strict, IEnvelope tolerant)
{
foreach (IMapLayer layer in layers)
{
IGroup grp = layer as IGroup;
if (grp != null)
{
Identify(grp, strict, tolerant);
}
else
{
IMapFeatureLayer gfl = layer as IMapFeatureLayer;
if (gfl != null)
{
if (gfl.DataSet.FeatureType == FeatureTypes.Polygon)
{
frmFeatureIdentifier.Add(gfl, strict);
}
else
{
frmFeatureIdentifier.Add(gfl, tolerant);
}
}
}
}
}
示例6: boundingBox
/// <summary> Class to handle a boundingbox, that make sure it is within Flanderers
/// and return string string in the wanted format from arcgis IEnvelope </summary>
/// <param name="arcgisBbox">arcgis IEnvelope </param>
public boundingBox(IEnvelope arcgisBbox)
{
//handle SRS
inSRS = arcgisBbox.SpatialReference;
//Set maxbounds
Type factoryType = Type.GetTypeFromProgID("esriGeometry.SpatialReferenceEnvironment");
System.Object obj = Activator.CreateInstance(factoryType);
ISpatialReferenceFactory3 spatialReferenceFactory = obj as ISpatialReferenceFactory3;
ISpatialReference lam72 = spatialReferenceFactory.CreateSpatialReference(31370);
IEnvelope maxBounds = geopuntHelper.makeExtend(17750, 23720, 297240, 245340, lam72); //not outside flanders
if (inSRS.FactoryCode != lam72.FactoryCode)
{
maxBounds = geopuntHelper.Transform(maxBounds as IGeometry, inSRS) as IEnvelope;
}
if (arcgisBbox.XMin > maxBounds.XMin) Xmin = arcgisBbox.XMin;
else Xmin = maxBounds.XMin;
if (arcgisBbox.YMin > maxBounds.YMin) Ymin = arcgisBbox.YMin;
else Ymin = maxBounds.YMin;
if (arcgisBbox.XMax < maxBounds.XMax) Xmax = arcgisBbox.XMax;
else Xmax = maxBounds.XMax;
if (arcgisBbox.YMax < maxBounds.YMax) Ymax = arcgisBbox.YMax;
else Ymax = maxBounds.YMax;
}
示例7: DrawStratCorDiagram
public static void DrawStratCorDiagram(IEnvelope Envelope)
{
double Text2BoxY = 0.2; //Y distance between the bottom of text and the next box
double Text2BoxX = 0.1; //X distance between a box and the text that describes it
double ColumnX = 0.1; //Space between columns
DrawMapUnits(Envelope, false, ColumnX);
}
示例8: GetGeometriesInView
public Collection<IGeometry> GetGeometriesInView(IEnvelope bbox, double minGeometrySize)
{
Collection<IGeometry> features = new Collection<IGeometry>();
using (SQLiteConnection conn = new SQLiteConnection(_ConnectionString))
{
string BoxIntersect = GetBoxClause(bbox);
string strSQL = "SELECT " + this.GeometryColumn + " AS Geom ";
strSQL += "FROM " + this.Table + " WHERE ";
strSQL += BoxIntersect;
if (!String.IsNullOrEmpty(_defintionQuery))
strSQL += " AND " + this.DefinitionQuery;
using (SQLiteCommand command = new SQLiteCommand(strSQL, conn))
{
conn.Open();
using (SQLiteDataReader dr = command.ExecuteReader())
{
while (dr.Read())
{
if (dr[0] != DBNull.Value)
{
IGeometry geom = SharpMap.Converters.WellKnownText.GeometryFromWKT.Parse((string)dr[0]);
if (geom != null)
features.Add(geom);
}
}
}
conn.Close();
}
}
return features;
}
示例9: GetFeatures
//Why ask the renderer when you know already?
public override IList GetFeatures(IEnvelope box, ILayer layer)
{
var coverage = ((NetworkCoverageSegmentLayer)layer).Coverage;
var segments = coverage.Segments.Values
.Where(networkLocation => networkLocation.Geometry.EnvelopeInternal.Intersects(box)).ToList();
return segments;
}
示例10: SimplePointCursor
public SimplePointCursor(string filePath, IFields fields, int OID,
System.Array fieldMap, IEnvelope queryEnv, esriGeometryType geomType)
{
//HIGHLIGHT: 0 - Set up cursor
m_bIsFinished = false;
m_pStreamReader = new System.IO.StreamReader(filePath);
m_fields = fields;
m_iOID = OID;
m_fieldMap = fieldMap;
m_searchEnv = queryEnv;
switch (geomType)
{
case esriGeometryType.esriGeometryPolygon:
m_wkGeom = new Polygon() as IGeometry;
m_workPts = new PointClass[5];
for (int i = 0; i < m_workPts.Length; i++)
m_workPts[i] = new PointClass();
break;
case esriGeometryType.esriGeometryPolyline:
m_wkGeom = new PolylineClass() as IGeometry;
m_workPts = new PointClass[5];
for (int i = 0; i < m_workPts.Length; i++)
m_workPts[i] = new PointClass();
break;
case esriGeometryType.esriGeometryPoint:
m_wkGeom = new PointClass() as IGeometry;
break;
default: //doesn't need to set worker geometry if it is table
break;
}
//advance cursor so data is readily available
this.NextRecord();
}
示例11: GetPersistentSubscriptionStats
public GetPersistentSubscriptionStats(IEnvelope envelope, string eventStreamId, string groupName)
{
Ensure.NotNull(envelope, "envelope");
Envelope = envelope;
_eventStreamId = eventStreamId;
_groupName = groupName;
}
示例12: EnsureExtent
/// <summary>
/// Ensure that the envelope for the inserted item has non-zero extents.
/// Use the current minExtent to pad the envelope, if necessary.
/// </summary>
/// <param name="itemEnv"></param>
/// <param name="minExtent"></param>
public static IEnvelope EnsureExtent(IEnvelope itemEnv, double minExtent)
{
//The names "ensureExtent" and "minExtent" are misleading -- sounds like
//this method ensures that the extents are greater than minExtent.
//Perhaps we should rename them to "ensurePositiveExtent" and "defaultExtent".
//[Jon Aquino]
double minx = itemEnv.MinX;
double maxx = itemEnv.MaxX;
double miny = itemEnv.MinY;
double maxy = itemEnv.MaxY;
// has a non-zero extent
if (minx != maxx && miny != maxy)
return itemEnv;
// pad one or both extents
if (minx == maxx)
{
minx = minx - minExtent / 2.0;
maxx = minx + minExtent / 2.0;
}
if (miny == maxy)
{
miny = miny - minExtent / 2.0;
maxy = miny + minExtent / 2.0;
}
return new Envelope(minx, maxx, miny, maxy);
}
示例13: RetriveData
public bool RetriveData(IEnvelope envelop, ref IList<IGeometry> outerData)
{
IEnvelope affected = envelop;
var toUpdate = new List<ICache>();
bool found = false;
foreach (var cache in this.Caches)
{
var has = cache.RetriveData(affected, ref outerData, ref affected);
if(!has)
{
toUpdate.Add(cache);
}
else
{
found = true;
break;
}
}
if (found && toUpdate.Count > 0)
{
IEnumerable<IGeometry> cursor = outerData;
toUpdate.ForEach(x => x.BuildCursor(cursor));
var first = this.Caches.First();
first.RetriveData(envelop, ref outerData, ref affected);
}
return true;
}
示例14: Snap
///// <summary>
///// snapping specific for a tool. Called before layer specific snappping is applied.
///// </summary>
///// <param name="sourceLayer"></param>
///// <param name="snapSource"></param>
///// <param name="worldPos"></param>
///// <param name="Envelope"></param>
///// <returns></returns>
public void Snap(ILayer sourceLayer, IGeometry snapSource, ICoordinate worldPos, IEnvelope Envelope)
{
SnapResult = null;
IFeature sourceFeature = MapControl.SelectTool.FeatureEditors[0].SourceFeature;
if (sourceFeature.Geometry != snapSource)
return;
SnapRole snapRole = SnapRole.FreeAtObject;
if ((Control.ModifierKeys & Keys.Control) == Keys.Control)
snapRole = SnapRole.Free;
ISnapRule snapRule = new SnapRule
{
SourceLayer = sourceLayer,
TargetLayer = sourceLayer,
Obligatory = true,
SnapRole = snapRole,
PixelGravity = 4
};
SnapResult = MapControl.SnapTool.ExecuteSnapRule(
snapRule,
sourceFeature,
sourceFeature.Geometry,
new List<IFeature>
{
sourceFeature
},
worldPos,
-1);
}
示例15: GetObjectIDsInView
public System.Collections.ObjectModel.Collection<uint> GetObjectIDsInView(IEnvelope bbox)
{
Collection<uint> objectlist = new Collection<uint>();
using (SQLiteConnection conn = new SQLiteConnection(_ConnectionString))
{
string strSQL = "SELECT " + this.ObjectIdColumn + " ";
strSQL += "FROM " + this.Table + " WHERE ";
strSQL += GetBoxClause(bbox);
if (!String.IsNullOrEmpty(_defintionQuery))
strSQL += " AND " + this.DefinitionQuery + " AND ";
using (SQLiteCommand command = new SQLiteCommand(strSQL, conn))
{
conn.Open();
using (SQLiteDataReader dr = command.ExecuteReader())
{
while (dr.Read())
{
if (dr[0] != DBNull.Value)
{
uint ID = (uint)(int)dr[0];
objectlist.Add(ID);
}
}
}
conn.Close();
}
}
return objectlist;
}