Esempio n. 1
0
        public void SetUp()
        {
            var gss = new NetTopologySuite.NtsGeometryServices();
            var css = new SharpMap.CoordinateSystems.CoordinateSystemServices(
                new ProjNet.CoordinateSystems.CoordinateSystemFactory(System.Text.Encoding.ASCII),
                new ProjNet.CoordinateSystems.Transformations.CoordinateTransformationFactory(),
                SharpMap.Converters.WellKnownText.SpatialReference.GetAllReferenceSystems());

            GeoAPI.GeometryServiceProvider.Instance = gss;
            SharpMap.Session.Instance
            .SetGeometryServices(gss)
            .SetCoordinateSystemServices(css)
            .SetCoordinateSystemRepository(css);
        }
Esempio n. 2
0
        public void RunBeforeAnyTests()
        {
            var gss = new NetTopologySuite.NtsGeometryServices();
            var css = new SharpMap.CoordinateSystems.CoordinateSystemServices(
                new ProjNet.CoordinateSystems.CoordinateSystemFactory(),
                new ProjNet.CoordinateSystems.Transformations.CoordinateTransformationFactory(),
                SharpMap.Converters.WellKnownText.SpatialReference.GetAllReferenceSystems());

            GeoAPI.GeometryServiceProvider.Instance = gss;
            SharpMap.Session.Instance
            .SetGeometryServices(gss)
            .SetCoordinateSystemServices(css)
            .SetCoordinateSystemRepository(css);

            _stopWatch = new System.Diagnostics.Stopwatch();
            System.Diagnostics.Trace.WriteLine("Starting tests");
            _stopWatch.Start();
        }
Esempio n. 3
0
        public void RunBeforeAnyTests()
        {
            var gss = new NetTopologySuite.NtsGeometryServices();
            var css = new SharpMap.CoordinateSystems.CoordinateSystemServices(
                new ProjNet.CoordinateSystems.CoordinateSystemFactory(),
                new ProjNet.CoordinateSystems.Transformations.CoordinateTransformationFactory(),
                SharpMap.Converters.WellKnownText.SpatialReference.GetAllReferenceSystems());

            GeoAPI.GeometryServiceProvider.Instance = gss;
            SharpMap.Session.Instance
            .SetGeometryServices(gss)
            .SetCoordinateSystemServices(css)
            .SetCoordinateSystemRepository(css);

            // plug-in WebMercator so that correct spherical definition is directly available to Layer Transformations using SRID
            var pcs = (ProjNet.CoordinateSystems.ProjectedCoordinateSystem)ProjNet.CoordinateSystems.ProjectedCoordinateSystem.WebMercator;

            css.AddCoordinateSystem((int)pcs.AuthorityCode, pcs);

            _stopWatch = new System.Diagnostics.Stopwatch();
            System.Diagnostics.Trace.WriteLine("Starting tests");
            _stopWatch.Start();
        }