Пример #1
0
        public static void LoadGml(this IGraph graph, string directory)
        {
            if (graph == null)
            {
                throw new ArgumentNullException(nameof(graph));
            }

            GmlReader.InputGraph(graph, string.Concat(directory, GraphFileGml));
        }
Пример #2
0
        public void ResetReader()
        {
            var invalidReader = XElement.Parse("<gml:Point xmlns:gml='http://www.opengis.net/gml' gml:srsName=\"http://www.opengis.net/def/crs/EPSG/0/5555\"><gml:pos>1</gml:pos></gml:Point>").CreateReader();
            var validReader   = XElement.Parse("<gml:Point xmlns:gml='http://www.opengis.net/gml' gml:srsName=\"http://www.opengis.net/def/crs/EPSG/0/1234\"><gml:pos>2 2</gml:pos></gml:Point>").CreateReader();

            var target    = new SpatialToPositionPipeline();
            var gmlReader = new GmlReader(target);

            SpatialTestUtils.VerifyExceptionThrown <ParseErrorException>(() => gmlReader.ReadGeography(invalidReader), Strings.GmlReader_PosNeedTwoNumbers);
            gmlReader.Reset();
            gmlReader.ReadGeography(validReader);
            Assert.Equal(CoordinateSystem.Geography(1234), target.CoordinateSystem);
        }
 public override void LoadGraphData(TinkerGrapĥ tinkerGrapĥ, string directory)
 {
     GmlReader.InputGraph(tinkerGrapĥ, string.Concat(directory, GraphFileGml));
 }