本文整理汇总了C#中DotSpatial.Projections.ProjectionInfo.Matches方法的典型用法代码示例。如果您正苦于以下问题:C# ProjectionInfo.Matches方法的具体用法?C# ProjectionInfo.Matches怎么用?C# ProjectionInfo.Matches使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DotSpatial.Projections.ProjectionInfo
的用法示例。
在下文中一共展示了ProjectionInfo.Matches方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetTransform
// gets transform between raster's native projection and the map projection
private void GetTransform(ProjectionInfo mapProjection)
{
if (mapProjection == null || _projectionWkt == "")
{
_transform = null;
return;
}
// get our two projections
ProjectionInfo srcCoord = new ProjectionInfo();
srcCoord.ReadEsriString(_projectionWkt);
ProjectionInfo tgtCoord = mapProjection;
// raster and map are in same projection, no need to transform
if (srcCoord.Matches(tgtCoord))
{
_transform = null;
return;
}
// create transform
_transform = new CoordinateTransformation {Source = srcCoord, Target = tgtCoord};
}
示例2: Reproject
/// <summary>
/// Reprojects all of the in-ram vertices of vectors, or else this
/// simply updates the "Bounds" of image and raster objects
/// This will also update the projection to be the specified projection.
/// </summary>
/// <param name="targetProjection">
/// The projection information to reproject the coordinates to.
/// </param>
public override void Reproject(ProjectionInfo targetProjection)
{
base.Reproject(targetProjection);
if (targetProjection != null)
{
//Set the target projection if necessary
_targetProjection = targetProjection.Matches(_projectionInfo)
? null
: targetProjection;
}
else
{
_targetProjection = null;
}
// Adjusting the projection
Projection = _targetProjection ?? _projectionInfo;
//Is this necessary?
//Invalidate(Extent);
}