本文整理汇总了C#中IProjection类的典型用法代码示例。如果您正苦于以下问题:C# IProjection类的具体用法?C# IProjection怎么用?C# IProjection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IProjection类属于命名空间,在下文中一共展示了IProjection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetProjectionArgument
private static SqlString GetProjectionArgument(ICriteriaQuery criteriaQuery, ICriteria criteria,
IProjection projection, int loc,
IDictionary<string, IFilter> enabledFilters)
{
SqlString sql = projection.ToSqlString(criteria, loc, criteriaQuery, enabledFilters);
return sql.Substring(0, sql.LastIndexOfCaseInsensitive(" as "));
}
示例2: StyleOsmStreamSceneTarget
/// <summary>
/// Creates a new MapCSS scene target.
/// </summary>
/// <param name="mapCSSInterpreter"></param>
/// <param name="scene"></param>
/// <param name="projection"></param>
public StyleOsmStreamSceneTarget(StyleInterpreter mapCSSInterpreter,
Scene2D scene, IProjection projection)
{
_projection = projection;
_scene = scene;
_mapCSSInterpreter = mapCSSInterpreter;
}
示例3: LayerGpx
/// <summary>
/// Creates a new OSM data layer.
/// </summary>
/// <param name="projection"></param>
public LayerGpx(IProjection projection)
{
_projection = projection;
this.Scene = new Scene2DSimple();
this.Scene.BackColor = SimpleColor.FromKnownColor(KnownColor.Transparent).Value;
}
示例4: CreateCoordinateOperation
public static IMathTransform CreateCoordinateOperation(IProjection projection, IEllipsoid ellipsoid)
{
ParameterList parameterList = new ParameterList();
for(int i=0; i< projection.NumParameters; i++)
{
ProjectionParameter param = projection.GetParameter(i);
parameterList.Add(param.Name,param.Value);
}
parameterList.Add("semi_major",ellipsoid.SemiMajorAxis);
parameterList.Add("semi_minor",ellipsoid.SemiMinorAxis);
IMathTransform transform = null;
switch(projection.Name.ToLower())
{
case "mercator":
//1SP
transform = new MercatorProjection(parameterList);
break;
case "transverse_mercator":
transform = new TransverseMercatorProjection(parameterList);
break;
case "albers":
transform = new AlbersProjection(parameterList);
break;
case "lambert":
transform = new LambertConformalConic2SPProjection(parameterList);
break;
default:
throw new NotSupportedException(String.Format(System.Globalization.CultureInfo.InvariantCulture, "Projection {0} is not supported.",projection.AuthorityCode));
}
return transform;
}
示例5: IsVersionExist
public bool IsVersionExist(IProjection projection)
{
using (var con = db.OpenDbConnection())
{
return con.Count<ProjectionVersionDto>(x => x.ProjectionName == GetName(projection)) > 0;
}
}
示例6: CreateCoordinateOperation
private static IMathTransform CreateCoordinateOperation(IProjection projection, IEllipsoid ellipsoid)
{
List<ProjectionParameter> parameterList = new List<ProjectionParameter>(projection.NumParameters);
for (int i = 0; i < projection.NumParameters; i++)
parameterList.Add(projection.GetParameter(i));
parameterList.Add(new ProjectionParameter("semi_major", ellipsoid.SemiMajorAxis));
parameterList.Add(new ProjectionParameter("semi_minor", ellipsoid.SemiMinorAxis));
IMathTransform transform = null;
switch (projection.ClassName.ToLower())
{
case "mercator_1sp":
case "mercator_2sp":
//1SP
transform = new Mercator(parameterList);
break;
case "transverse_mercator":
transform = new TransverseMercator(parameterList);
break;
case "albers":
transform = new AlbersProjection(parameterList);
break;
case "lambert_conformal_conic":
case "lambert_conformal_conic_2sp":
transform = new LambertConformalConic2SP(parameterList);
break;
default:
throw new NotSupportedException(String.Format("Projection {0} is not supported.", projection.ClassName));
}
return transform;
}
示例7: Projection
public Projection(ISpatialReference pSpatialReference, IWorkspace pWorkSpace)
{
IProjectedCoordinateSystem pProjectedCoordinateSys = pSpatialReference as IProjectedCoordinateSystem;
m_pSpatialReference = pSpatialReference;
m_pIProjection = pProjectedCoordinateSys.Projection;
m_pWorkspace = pWorkSpace;
}
示例8: OrderBy
public OrderBy(IProjection projection, OrderByDirection direction)
{
Require.NotNull(projection, "projection");
Direction = direction;
Projection = projection;
}
示例9: GetProjectionArgument
private static SqlString GetProjectionArgument(ICriteriaQuery criteriaQuery, ICriteria criteria,
IProjection projection, int loc,
IDictionary<string, IFilter> enabledFilters)
{
SqlString sql = projection.ToSqlString(criteria, loc, criteriaQuery, enabledFilters);
return StringHelper.RemoveAsAliasesFromSql(sql);
}
示例10: ProjectionWrapper
public ProjectionWrapper(IProjection projection, ILogger log)
{
this.projection = projection;
this.buferredProjection = projection as IBuferredProjection;
this.log = log;
Init();
}
示例11: GetFilterModifierCriterion
/// <summary>
/// Gets the filter modifier criterion.
/// </summary>
/// <param name="projection">The projection.</param>
/// <param name="filerModifier">The filer modifier.</param>
/// <param name="value">The value.</param>
/// <returns>A <see cref="NHibernate.Criterion.ICriterion"/></returns>
public static ICriterion GetFilterModifierCriterion( IProjection projection, string filerModifier, object value )
{
ICriterion ret = null;
if ( filerModifier == FilterModifier.EqualTo )
{
ret = Restrictions.Eq ( projection, value );
}
else if ( filerModifier == FilterModifier.GreaterThan )
{
ret = ( Restrictions.Gt ( projection, value ) );
}
else if ( filerModifier == FilterModifier.GreaterThanOrEqualTo )
{
ret = ( Restrictions.Ge ( projection, value ) );
}
else if ( filerModifier == FilterModifier.LessThen )
{
ret = ( Restrictions.Lt ( projection, value ) );
}
else if ( filerModifier == FilterModifier.LessThenOrEqualTo )
{
ret = ( Restrictions.Le ( projection, value ) );
}
else
{
throw new ArgumentException ( "Invalid Filter Modifier" );
}
return ret;
}
示例12: GetModifiedReason
public string GetModifiedReason(IProjection projection)
{
if (projection == null || projection is ICheckpointStore)
{
return string.Empty;
}
try
{
var dto = collection.AsQueryable().FirstOrDefault(x => x.ProjectionName == GetName(projection));
if (dto == null)
{
return "Version is absent";
}
if (dto.Version != projection.Version)
{
return "Version is different";
}
if (dto.Hash != StructureHash.CalculateMD5(projection))
{
return "Hash is different";
}
return string.Empty;
}
catch (Exception ex)
{
if (ex is SqlException || ex.Message.Contains("Invalid column name"))
{
return "Invalid column name";
}
throw;
}
}
示例13: AddProjection
/**
* Adds the given projection.
*
* @param projection the projection to add
* @return this
*/
public IExitOperationsCollector AddProjection(IProjection projection)
{
if (projection.GetType().IsAssignableFrom(distinct.GetType()))
{
this.distinct = (Distinct) projection;
//TODO: Distinct doesn't work yet
log.Error("Distinct is not ready yet");
throw new NotSupportedException();
}
if (projection.GetType().IsAssignableFrom(rowCountProjection.GetType()))
{
rowCountProjection = (RowCountProjection) projection;
}
if (projection.GetType().IsAssignableFrom(aggregateProjection.GetType()))
{
if (projection.ToString().ToLower().StartsWith("avg"))
{
this.avgProjection = (AggregateProjection)projection;
}
else
{
this.aggregateProjection = (AggregateProjection)projection;
}
}
else
{
log.Error("Adding an unsupported Projection: " + projection.GetType().Name);
throw new NotSupportedException();
}
return this;
}
示例14: ProjectedCoordinateSystem
/// <summary>
/// Initializes a new instance of the ProjectedCoordinateSystem class.
/// </summary>
/// <param name="horizontalDatum">The horizontal datum to use.</param>
/// <param name="axisInfoArray">An array of IAxisInfo representing the axis information.</param>
/// <param name="geographicCoordSystem">The geographic coordinate system.</param>
/// <param name="linearUnit">The linear units to use.</param>
/// <param name="projection">The projection to use.</param>
/// <param name="remarks">Remarks about this object.</param>
/// <param name="authority">The name of the authority.</param>
/// <param name="authorityCode">The code the authority uses to identidy this object.</param>
/// <param name="name">The name of the object.</param>
/// <param name="alias">The alias of the object.</param>
/// <param name="abbreviation">The abbreviated name of this object.</param>
internal ProjectedCoordinateSystem(
IHorizontalDatum horizontalDatum,
IAxisInfo[] axisInfoArray,
IGeographicCoordinateSystem geographicCoordSystem,
ILinearUnit linearUnit,
IProjection projection,
string remarks, string authority, string authorityCode, string name, string alias, string abbreviation)
: base(remarks, authority, authorityCode, name, alias, abbreviation)
{
if (axisInfoArray==null)
{
throw new ArgumentNullException("axisInfoArray");
}
if (geographicCoordSystem==null)
{
throw new ArgumentNullException("geographicCoordSystem");
}
if (projection==null)
{
throw new ArgumentNullException("projection");
}
if (linearUnit==null)
{
throw new ArgumentNullException("linearUnit");
}
_horizontalDatum=horizontalDatum;
_axisInfoArray= axisInfoArray;
_geographicCoordSystem = geographicCoordSystem;
_projection= projection;
_linearUnit = linearUnit;
}
示例15: QuadKeyToRect
public static Rectangle QuadKeyToRect(IProjection projection, QuadKey quadKey)
{
var boundingBox = QuadKeyToBoundingBox(quadKey);
var minPoint = projection.Project(boundingBox.MinPoint, 0);
var maxPoint = projection.Project(boundingBox.MaxPoint, 0);
return new Rectangle(minPoint.x, minPoint.z, maxPoint.x - minPoint.x, maxPoint.z - minPoint.z);
}