/// <summary>
        /// Converts to GeoAPI geometry type from database geometry type.
        /// </summary>
        /// <param name="value">The databse geometry value.</param>
        /// <returns></returns>
        protected override IGeometry ToGeometry(object value)
        {
            byte[] bytes = value as byte[];

            if (bytes == null || bytes.Length == 0)
            {
                return(null);
            }

            MySQLReader reader   = new MySQLReader();
            IGeometry   geometry = reader.Read(bytes);

            this.SetDefaultSRID(geometry);
            return(geometry);
        }
Пример #2
0
        /// <summary>
        /// Converts to GeoAPI geometry type from database geometry type.
        /// </summary>
        /// <param name="value">The database geometry value.</param>
        /// <returns></returns>
        protected override IGeometry ToGeometry(object value)
        {
            MySqlGeometry?bytes = value as MySqlGeometry?;

            if (!bytes.HasValue)
            {
                return(null);
            }

            MySQLReader reader   = new MySQLReader();
            IGeometry   geometry = reader.Read(bytes.Value.Value);

            SetDefaultSRID(geometry);
            return(geometry);
        }