当前位置: 首页>>代码示例>>C#>>正文


C# Spatial.DbGeography类代码示例

本文整理汇总了C#中System.Data.Entity.Spatial.DbGeography的典型用法代码示例。如果您正苦于以下问题:C# DbGeography类的具体用法?C# DbGeography怎么用?C# DbGeography使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DbGeography类属于System.Data.Entity.Spatial命名空间,在下文中一共展示了DbGeography类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的System.Data.Entity.Spatial.DbGeography类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。