コード例 #1
0
        public void TestSridMap()
        {
            SridMap map = SridMap.DefaultInstance;

            ICoordinateSystem cs = map.Process(27700, default(ICoordinateSystem));

            Assert.IsNotNull(cs);


            int?srid = map.Process(cs, (int?)null);

            Assert.IsTrue(srid == 27700);


            ICoordinateSystem cs2 = map.Process("EPSG:27700", default(ICoordinateSystem));

            Assert.IsTrue(ReferenceEquals(cs, cs2));


            string code = map.Process(cs2, "");

            Debug.WriteLine(code);

            Assert.IsTrue(code == "EPSG:27700");
        }
コード例 #2
0
        public void TestEpsgToSridMap()
        {
            string  wkt = "EPSG:27700";
            SridMap map = new SridMap(new[] { new SridProj4Strategy(0, new GeometryServices().CoordinateSystemFactory) });

            int?srid = map.Process(wkt, (int?)null);

            Assert.IsNotNull(srid);

            Assert.IsTrue(srid == 27700);
        }
コード例 #3
0
        public void TestWktToSridMap()
        {
            string wkt =
                "PROJCS[\"British_National_Grid\",GEOGCS[\"GCS_OSGB_1936\",DATUM[\"D_OSGB_1936\",SPHEROID[\"Airy_1830\",6377563.396,299.3249646]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"False_Easting\",400000],PARAMETER[\"False_Northing\",-100000],PARAMETER[\"Central_Meridian\",-2],PARAMETER[\"Scale_Factor\",0.999601272],PARAMETER[\"Latitude_Of_Origin\",49],UNIT[\"Meter\",1]]";

            SridMap map = new SridMap(new[] { new SridProj4Strategy(0, new GeometryServices().CoordinateSystemFactory) });

            int?srid = map.Process(wkt, (int?)null);

            Assert.IsNotNull(srid);

            Assert.IsTrue(srid == 27700);
        }
コード例 #4
0
ファイル: UnitTest1.cs プロジェクト: pobingwanghai/SharpMapV2
        public void TestEpsgToSridMap()
        {
            string wkt = "EPSG:27700";
            SridMap map = new SridMap(new[] { new SridProj4Strategy(0, new GeometryServices().CoordinateSystemFactory) });

            int? srid = map.Process(wkt, (int?)null);

            Assert.IsNotNull(srid);

            Assert.IsTrue(srid == 27700);
        }
コード例 #5
0
ファイル: UnitTest1.cs プロジェクト: pobingwanghai/SharpMapV2
        public void TestWktToSridMap()
        {
            string wkt =
                "PROJCS[\"British_National_Grid\",GEOGCS[\"GCS_OSGB_1936\",DATUM[\"D_OSGB_1936\",SPHEROID[\"Airy_1830\",6377563.396,299.3249646]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"False_Easting\",400000],PARAMETER[\"False_Northing\",-100000],PARAMETER[\"Central_Meridian\",-2],PARAMETER[\"Scale_Factor\",0.999601272],PARAMETER[\"Latitude_Of_Origin\",49],UNIT[\"Meter\",1]]";

            SridMap map = new SridMap(new[] { new SridProj4Strategy(0, new GeometryServices().CoordinateSystemFactory) });

            int? srid = map.Process(wkt, (int?)null);

            Assert.IsNotNull(srid);

            Assert.IsTrue(srid == 27700);
        }