本文整理汇总了C#中System.Data.Entity.Spatial.DbGeography类的典型用法代码示例。如果您正苦于以下问题:C# DbGeography类的具体用法?C# DbGeography怎么用?C# DbGeography使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DbGeography类属于System.Data.Entity.Spatial命名空间,在下文中一共展示了DbGeography类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CreatePoint
public static GeoLocation CreatePoint(DbGeography location)
{
var geoLocation = new GeoLocation();
geoLocation.Latitude = location.Latitude.Value;
geoLocation.Longitude = location.Longitude.Value;
return geoLocation;
}
开发者ID:zhongshuiyuan,项目名称:GeoKml,代码行数:7,代码来源:GeoUtils.cs
示例2: SpatialGeography
internal SpatialGeography(DbGeography g, ICoordinateSystem coordinateSystem)
{
Debug.Assert(g!=null);
if (g==null)
throw new ArgumentNullException("g");
_Geography=g;
_CoordinateSystem=coordinateSystem;
}
开发者ID:mcartoixa,项目名称:GeoSIK,代码行数:9,代码来源:SpatialGeography.cs
示例3: SuppliersWithinRangeUsingPoint
public virtual IQueryable<SupplierWithLocation> SuppliersWithinRangeUsingPoint(int? miles, DbGeography location)
{
var objectContext = ((IObjectContextAdapter)this).ObjectContext;
objectContext.MetadataWorkspace.LoadFromAssembly(typeof(SupplierWithLocation).Assembly);
return objectContext.CreateQuery<SupplierWithLocation>("[SpatialNorthwindContext].[SuppliersWithinRangeUsingPoint](@miles, @location)",
new ObjectParameter("miles", miles),
new ObjectParameter("location", location));
}
开发者ID:jimmy00784,项目名称:entityframework,代码行数:9,代码来源:SpatialNorthwindContext.cs
示例4: GetGeographyAsync_calls_GetGeography
public void GetGeographyAsync_calls_GetGeography()
{
var mockDbSpatialDataReader = new Mock<DbSpatialDataReader> { CallBase = true };
var dbGeography = new DbGeography();
mockDbSpatialDataReader.Setup(m => m.GetGeography(0)).Returns((int ordinal) => dbGeography).Verifiable();
var task = mockDbSpatialDataReader.Object.GetGeographyAsync(0, CancellationToken.None);
mockDbSpatialDataReader.Verify(m => m.GetGeography(0), Times.Once());
Assert.Same(dbGeography, task.Result);
}
开发者ID:jimmy00784,项目名称:entityframework,代码行数:11,代码来源:DbSpatialDataReaderTests.cs
示例5: CheckCompatible
private static ReadOnlySpatialValues CheckCompatible(DbGeography geographyValue)
{
Debug.Assert(geographyValue != null, "Validate geographyValue is non-null before calling CheckCompatible");
if (geographyValue != null)
{
var expectedValue = geographyValue.ProviderValue as ReadOnlySpatialValues;
if (expectedValue != null)
{
return expectedValue;
}
}
throw new ArgumentException(Strings.Spatial_GeographyValueNotCompatibleWithSpatialServices, "geographyValue");
}
开发者ID:jimmy00784,项目名称:entityframework,代码行数:13,代码来源:DefaultSpatialServices.cs
示例6: CheckCompatible
private static ReadOnlySpatialValues CheckCompatible(DbGeography geographyValue)
{
DebugCheck.NotNull(geographyValue);
if (geographyValue != null)
{
var expectedValue = geographyValue.ProviderValue as ReadOnlySpatialValues;
if (expectedValue != null)
{
return expectedValue;
}
}
throw new ArgumentException(Strings.Spatial_GeographyValueNotCompatibleWithSpatialServices, "geographyValue");
}
开发者ID:christiandpena,项目名称:entityframework,代码行数:13,代码来源:DefaultSpatialServices.cs
示例7: Geography
public ParameterModel Geography(
DbGeography defaultValue = null,
string defaultValueSql = null,
string name = null,
string storeType = null,
bool outParameter = false)
{
return BuildParameter(
PrimitiveTypeKind.Geography,
defaultValue,
defaultValueSql,
name: name,
storeType: storeType,
outParameter: outParameter);
}
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:15,代码来源:ParameterBuilder.cs
示例8: SymmetricDifference
/// <summary> Computes the symmetric difference of this DbGeography value and another DbGeography value. </summary>
/// <returns>A new DbGeography value representing the symmetric difference between this geography value and other.</returns>
/// <param name="other">The geography value for which the symmetric difference with this value should be computed.</param>
public DbGeography SymmetricDifference(DbGeography other)
{
Check.NotNull(other, "other");
return _spatialProvider.SymmetricDifference(this, other);
}
开发者ID:hallco978,项目名称:entityframework,代码行数:8,代码来源:DbGeography.cs
示例9: Distance
/// <summary> Computes the distance between the closest points in this DbGeography value and another DbGeography value. </summary>
/// <returns>A double value that specifies the distance between the two closest points in this geography value and other.</returns>
/// <param name="other">The geography value for which the distance from this value should be computed.</param>
public double? Distance(DbGeography other)
{
Check.NotNull(other, "other");
return _spatialProvider.Distance(this, other);
}
开发者ID:hallco978,项目名称:entityframework,代码行数:8,代码来源:DbGeography.cs
示例10: Disjoint
/// <summary> Determines whether this DbGeography is spatially disjoint from the specified DbGeography argument. </summary>
/// <returns>true if other is disjoint from this geography value; otherwise false.</returns>
/// <param name="other">The geography value that should be compared with this geography value for disjointness.</param>
public bool Disjoint(DbGeography other)
{
Check.NotNull(other, "other");
return _spatialProvider.Disjoint(this, other);
}
开发者ID:hallco978,项目名称:entityframework,代码行数:8,代码来源:DbGeography.cs
示例11: NumRings
public static Int32? NumRings(DbGeography geographyValue)
{
throw new NotSupportedException(Strings.ELinq_DbFunctionDirectCall);
}
开发者ID:WangWilliam,项目名称:EntityFramework5,代码行数:4,代码来源:SqlSpatialFunctions.cs
示例12: Filter
public static Boolean? Filter(DbGeography geographyValue, DbGeography geographyOther)
{
throw new NotSupportedException(Strings.ELinq_DbFunctionDirectCall);
}
开发者ID:WangWilliam,项目名称:EntityFramework5,代码行数:4,代码来源:SqlSpatialFunctions.cs
示例13: PointAt
/// <summary>
/// Returns a point element of the given <see cref="T:System.Data.Entity.Spatial.DbGeography" /> value, if it represents a linestring or linear ring.
/// </summary>
/// <returns>The point in geographyValue at position index, if it represents a linestring or linear ring; otherwise null.</returns>
/// <param name="geographyValue">The geography value, which need not represent a linestring or linear ring.</param>
/// <param name="index">The position within the geography value from which the element should be taken.</param>
/// <exception cref="ArgumentNullException">
/// <paramref name="geographyValue" />
/// is null.
/// </exception>
/// <exception cref="ArgumentException">
/// <paramref name="geographyValue" />
/// is not compatible with this spatial services implementation.
/// </exception>
public abstract DbGeography PointAt(DbGeography geographyValue, int index);
开发者ID:hallco978,项目名称:entityframework,代码行数:15,代码来源:DbSpatialServices.cs
示例14: GetPointCount
/// <summary>
/// Returns the number of points in the given <see cref="T:System.Data.Entity.Spatial.DbGeography" /> value, if it represents a linestring or linear ring.
/// </summary>
/// <returns>
/// The number of points in the given <see cref="T:System.Data.Entity.Spatial.DbGeography" /> value.
/// </returns>
/// <param name="geographyValue">The geography value, which need not represent a linestring or linear ring.</param>
/// <exception cref="ArgumentNullException">
/// <paramref name="geographyValue" />
/// is null.
/// </exception>
/// <exception cref="ArgumentException">
/// <paramref name="geographyValue" />
/// is not compatible with this spatial services implementation.
/// </exception>
public abstract int? GetPointCount(DbGeography geographyValue);
开发者ID:hallco978,项目名称:entityframework,代码行数:16,代码来源:DbSpatialServices.cs
示例15: BufferWithTolerance
public static DbGeography BufferWithTolerance(DbGeography geographyValue, Double? distance, Double? tolerance, Boolean? relative)
{
throw new NotSupportedException(Strings.ELinq_DbFunctionDirectCall);
}
开发者ID:WangWilliam,项目名称:EntityFramework5,代码行数:4,代码来源:SqlSpatialFunctions.cs
示例16: DistanceFromMe
public static string DistanceFromMe(this Center center, DbGeography point)
{
return ( (center.Coordinates != null && point!=null )?
String.Format("{0:0.##} km", (center.Coordinates.Distance(point)) / 1000) : "-");
}
开发者ID:QualityConsultingTeam,项目名称:Cancha,代码行数:5,代码来源:FieldExtensions.cs
示例17: EnvelopeCenter
public static DbGeography EnvelopeCenter(DbGeography geographyValue)
{
throw new NotSupportedException(Strings.ELinq_DbFunctionDirectCall);
}
开发者ID:WangWilliam,项目名称:EntityFramework5,代码行数:4,代码来源:SqlSpatialFunctions.cs
示例18: Generate
/// <summary>
/// Generates SQL to specify a constant geogrpahy default value being set on a column.
/// This method just generates the actual value, not the SQL to set the default value.
/// </summary>
/// <param name="defaultValue"> The value to be set. </param>
/// <returns> SQL representing the default value. </returns>
protected virtual string Generate(DbGeography defaultValue)
{
return "'" + defaultValue + "'";
}
开发者ID:aspnet,项目名称:EntityFramework6,代码行数:10,代码来源:SqlServerMigrationSqlGenerator.cs
示例19: InstanceOf
public static Boolean? InstanceOf(DbGeography geographyValue, String geometryTypeName)
{
throw new NotSupportedException(Strings.ELinq_DbFunctionDirectCall);
}
开发者ID:WangWilliam,项目名称:EntityFramework5,代码行数:4,代码来源:SqlSpatialFunctions.cs
示例20: StaticSuppliersWithinRange
public static IQueryable<SupplierWithLocation> StaticSuppliersWithinRange(int? miles, DbGeography location)
{
throw new NotImplementedException("Should not be called by client code.");
}
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:4,代码来源:SpatialNorthwindContext.cs
注:本文中的System.Data.Entity.Spatial.DbGeography类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论