예제 #1
0
        private static void GeometryGmlWriterTest(Action <GeometryPipeline> pipelineCalls, params string[] expectedXPaths)
        {
            var ms = new MemoryStream();
            var w  = XmlWriter.Create(ms, new XmlWriterSettings {
                Indent = false
            });
            DrawBoth gw = new GmlWriter(w);

            gw.GeometryPipeline.SetCoordinateSystem(CoordinateSystem.DefaultGeometry);

            pipelineCalls(gw.GeometryPipeline);
            w.Flush();
            w.Close();

            // use XElement to validate basic XML integrity
            ms.Seek(0, SeekOrigin.Begin);
            XmlNameTable nt = new NameTable();

            nt.Add(GmlConstants.GmlPrefix);
            // XPath or string contains
            var xnm = new XmlNamespaceManager(nt);

            xnm.AddNamespace(GmlConstants.GmlPrefix, GmlConstants.GmlNamespace);

            var xDoc = new XmlDocument(nt);

            xDoc.Load(ms);

            var nav = xDoc.CreateNavigator();

            SpatialTestUtils.VerifyXPaths(nav, xnm, "/node()[@gml:srsName = '" + GmlConstants.SrsPrefix + CoordinateSystem.DefaultGeometry.EpsgId + "']");

            SpatialTestUtils.VerifyXPaths(nav, xnm, expectedXPaths);
        }
            public override void SaveGraphData(TinkerGrapĥ tinkerGrapĥ, string directory)
            {
                var filePath = string.Concat(directory, GraphFileGml);

                DeleteFile(filePath);
                GmlWriter.OutputGraph(tinkerGrapĥ, filePath);
            }
예제 #3
0
        public static void SaveGml(this IGraph graph, string directory)
        {
            if (graph == null)
            {
                throw new ArgumentNullException(nameof(graph));
            }

            var filePath = string.Concat(directory, GraphFileGml);

            DeleteFile(filePath);
            GmlWriter.OutputGraph(graph, filePath);
        }
예제 #4
0
 public GmlConverterTest()
 {
     gmlWriter = new GmlWriter();
 }