public void Verify_DbGeography_CreateProviderValue_WKT_method()
        {
            var geographyWellKnownValue = new DbGeographyWellKnownValue()
                                              {
                                                  CoordinateSystemId = DefaultCoordinateSystemId,
                                                  WellKnownBinary = null,
                                                  WellKnownText = PointWKT
                                              };

            dynamic providerValue = spatialServices.CreateProviderValue(geographyWellKnownValue);
            Assert.Equal(PointWKT, providerValue.ToString());
        }
Ejemplo n.º 2
0
 public override object CreateProviderValue(DbGeographyWellKnownValue wellKnownValue)
 {
     wellKnownValue.CheckNull("wellKnownValue");
     return new ReadOnlySpatialValues(wellKnownValue.CoordinateSystemId, wellKnownValue.WellKnownText, wellKnownValue.WellKnownBinary, gmlValue: null);
 }
 /// <summary>
 /// Creates a provider-specific value compatible with this spatial services implementation based on the specified well known <see cref="DbGeography"/> representation.
 /// </summary>
 /// <param name="wellKnownValue">An instance of <see cref="DbGeographyWellKnownValue"/> that contains the well known representation of a geography value.</param>
 /// <returns>A provider-specific value that encodes the information contained in <paramref name="wellKnownValue"/> in a fashion compatible with this spatial services implementation.</returns>
 /// <exception cref="ArgumentNullException"><paramref name="wellKnownValue"/> is null.</exception>
 public abstract object CreateProviderValue(DbGeographyWellKnownValue wellKnownValue);
Ejemplo n.º 4
0
 public override object CreateProviderValue(DbGeographyWellKnownValue wellKnownValue)
 {
     throw new NotImplementedException();
 }
        public override object CreateProviderValue(DbGeographyWellKnownValue wellKnownValue)
        {
            CheckParameterNotNull("wellKnownValue", wellKnownValue);

            if(wellKnownValue.WellKnownText != null)
            {
                return InvokeStaticFunction(
                    SqlTypes.SqlGeographyType,
                    "STGeomFromText",
                    SqlTypes.SqlCharsFromString(wellKnownValue.WellKnownText),
                    wellKnownValue.CoordinateSystemId);
            }
            else if(wellKnownValue.WellKnownBinary != null)
            {
                return InvokeStaticFunction(
                    SqlTypes.SqlGeographyType,
                    "STGeomFromWKB",
                    SqlTypes.SqlBytesFromByteArray(wellKnownValue.WellKnownBinary),
                    wellKnownValue.CoordinateSystemId);
            }
            else
            {
                throw new ArgumentException("wellKnownValue");
            }
        }
Ejemplo n.º 6
0
 public override object CreateProviderValue(DbGeographyWellKnownValue wellKnownValue)
 {
     wellKnownValue.CheckNull("wellKnownValue");
     return(new ReadOnlySpatialValues(wellKnownValue.CoordinateSystemId, wellKnownValue.WellKnownText, wellKnownValue.WellKnownBinary, gmlValue: null));
 }