示例#1
0
        public void ShouldReverseGeometries(string input, string expected)
        {
            var obuilder = new Ogc.Gml.V311.GmlGeometryBuilder();

            obuilder.Parse(input, CommonServiceLocator.GetCoordinateSystemProvider().Wgs84);

            var builder = new Ogc.Gml.V311.GmlGeometryBuilder();
            var rsink   = new ReversedGeometrySink(builder);

            obuilder.ConstructedGeometry.Populate(rsink);

            var g = builder.ConstructedGeometry;

            Assert.Equal <string>(expected, g.ToString());
        }
示例#2
0
        /// <summary>Defines the coordinate system of the geometry source.</summary>
        /// <param name="sourceSystem">The coordinate system of the geometry source.</param>
        /// <remarks>
        ///   <para>If <paramref name="sourceSystem" /> is the same coordinate system as the target coordinate system,
        /// no transformation will occur.</para>
        /// </remarks>
        public void SetCoordinateSystem(ICoordinateSystem sourceSystem)
        {
            Debug.Assert(sourceSystem != null);
            if (sourceSystem == null)
            {
                throw new ArgumentNullException("sourceSystem");
            }

            if (_TargetSystem == null)
            {
                _TargetSystem = sourceSystem;
            }

            DoSetCoordinateSystem(_TargetSystem);
            _SourceSystem = sourceSystem;

            if (!_TargetSystem.IsEquivalentTo(_SourceSystem))
            {
                _Converter = CommonServiceLocator.GetCoordinateSystemProvider().CreateTransformer(_SourceSystem, _TargetSystem);
            }
        }