本文整理汇总了C#中IEnvelope.Project方法的典型用法代码示例。如果您正苦于以下问题:C# IEnvelope.Project方法的具体用法?C# IEnvelope.Project怎么用?C# IEnvelope.Project使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEnvelope
的用法示例。
在下文中一共展示了IEnvelope.Project方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: OGRCursor
public OGRCursor(OGRDataset parent, String whereClause, System.Array esriQueryFieldMap, IEnvelope env = null, int onlyOneID = -1)
{
m_isFinished = false;
m_pDataset = parent;
m_whereClause = whereClause;
if (m_whereClause != null && m_whereClause.Length > 0)
m_pDataset.ogrLayer.SetAttributeFilter(m_whereClause);
else
m_pDataset.ogrLayer.SetAttributeFilter(null);
m_envelope = env;
if (m_envelope != null)
{
m_envelope.Project(m_pDataset.SpatialReference);
m_pDataset.ogrLayer.SetSpatialFilterRect(m_envelope.XMin, m_envelope.YMin, m_envelope.XMax, m_envelope.YMax);
}
else
{
m_pDataset.ogrLayer.SetSpatialFilter(null);
}
m_esriQueryFieldMap = esriQueryFieldMap;
m_pDataset.ogrLayer.ResetReading();
m_currentOGRFeature = null;
m_onlyOneID = onlyOneID;
if (m_onlyOneID == -1)
NextRecord();
else
{
RetrieveOnlyOneRecord();
}
}
示例3: ProjectToWgs1984
/// <summary>
/// The project to WGS 1984.
/// </summary>
/// <param name="geom">
/// The geometry to be converted to WGS 1984.
/// </param>
/// <returns>
/// The <see cref="IEnvelope"/>.
/// </returns>
public static IEnvelope ProjectToWgs1984(IEnvelope geom)
{
geom.Project(ProjectedCoordinateSystem);
return geom;
}
示例4: InitializeLayer
private void InitializeLayer()
{
var mxdoc = (IMxDocument)_application.Document;
_map = mxdoc.FocusMap;
_cacheDir = CacheSettings.GetCacheFolder();
_tileTimeOut = ConfigurationHelper.GetTileTimeOut();
var spatialReferences = new SpatialReferences();
_tileSource=_config.CreateTileSource();
_schema = _tileSource.Schema;
_dataSpatialReference = spatialReferences.GetSpatialReference(_schema.Srs);
_envelope = GetDefaultEnvelope();
if (_map.SpatialReference == null)
{
// zet dan de spatial ref...
_map.SpatialReference = _dataSpatialReference;
}
// If there is only one layer in the TOC zoom to this layer...
if (_map.LayerCount == 0)
{
//envelope.Expand(-0.1, -0.1, true);
_envelope.Project(_map.SpatialReference);
((IActiveView)_map).Extent = _envelope;
}
_displayFilter = new TransparencyDisplayFilterClass();
}
示例5: SetDynamicValues
//.........这里部分代码省略.........
{
AAState.WriteLine(" Layer Found " + intersectLayerName);
if (intersectLayer.FeatureClass != null)
{
AAState.WriteLine(" Datasource is valid for " + intersectLayerName);
sFilter = new SpatialFilterClass();
AAState.WriteLine(" Checking source Geometry Type");
if (inFeature.Shape.GeometryType == esriGeometryType.esriGeometryPoint)
{
// esriSpatialRelIntersects does not work properly for point intersecting line.
// hence expand point envelope (code cribbed from below)
try
{
ISpatialReferenceResolution pSRResolution;
pSRResolution = ((sourceLayer.FeatureClass as IGeoDataset).SpatialReference) as ISpatialReferenceResolution;
// sFilter = new SpatialFilterClass();
double intTol = pSRResolution.get_XYResolution(false);
bool hasXY = ((sourceLayer.FeatureClass as IGeoDataset).SpatialReference).HasXYPrecision();
searchEnvelope = new EnvelopeClass();
searchEnvelope.XMin = 0 - intTol;
searchEnvelope.YMin = 0 - intTol;
searchEnvelope.XMax = 0 + intTol;
searchEnvelope.YMax = 0 + intTol;
searchEnvelope.CenterAt(inFeature.ShapeCopy as IPoint);
//searchEnvelope.SpatialReference = ((inFeature.Class as IFeatureClass) as IGeoDataset).SpatialReference;
searchEnvelope.SpatialReference = ((inFeature.Class as IFeatureClass) as IGeoDataset).SpatialReference;
searchEnvelope.SnapToSpatialReference();
searchEnvelope.Project(AAState._editor.Map.SpatialReference);
sFilter.Geometry = Globals.Env2Polygon(searchEnvelope);
}
catch
{
sFilter.Geometry = inFeature.ShapeCopy;
}
}
else
{
AAState.WriteLine(" Geoemetry is not a point, using shape envelope");
sFilter.Geometry = inFeature.ShapeCopy;
}
sFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects;
sFilter.GeometryField = intersectLayer.FeatureClass.ShapeFieldName;
AAState.WriteLine(" Searching " + intersectLayerName + "for intersected feature");
fCursor = intersectLayer.FeatureClass.Search(sFilter, true);
IFeature intsersectFeature;
int idx = 1;
while ((intsersectFeature = fCursor.NextFeature()) != null)
{
AAState.WriteLine(" Splitting Intersected Feature number: " + idx);
idx++;
IFeatureEdit featureEdit = intsersectFeature as IFeatureEdit;
ISet featset = featureEdit.Split(inFeature.Shape);
AAState.WriteLine(" Adding split features to array to call the AA ext");