Пример #1
0
        public void CCWTestsOnPolygon()
        {
            var wrongCCW   = "POLYGON((10 10, 10 20, 20 20, 20 10, 10 10),(5 5,6 5,6 6,5 6,5 5))";
            var correctCCW = "POLYGON((10 10, 20 10, 20 20, 10 20, 10 10),(5 5,5 6,6 6,6 5,5 5))";

            var geom1 = wr.Read(wrongCCW);
            var geom2 = wr.Read(correctCCW);

            var t     = new OracleGeometryWriter().Write(geom1);
            var geom3 = or.Read(t);

            Assert.IsTrue(geom2.EqualsExact(geom3));
        }
        /// <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)
        {
            SdoGeometry sdoGeometry = value as SdoGeometry;

            if (sdoGeometry == null || sdoGeometry.IsNull)
            {
                return(null);
            }

            var reader   = new OracleGeometryReader();
            var geometry = reader.Read(sdoGeometry);

            this.SetDefaultSRID(geometry);
            return(geometry);
        }