Geography Markup Language
e OpenGIS® Geography Markup Language Encoding Standard (GML) The Geography Markup Language (GML) is an XML grammar for expressing geographical features. GML serves as a modeling language for geographic systems as well as an open interchange format for geographic transactions on the Internet. As with most XML based grammars, there are two parts to the grammar – the schema that describes the document and the instance document that contains the actual data. A GML document is described using a GML Schema. This allows users and developers to describe generic geographic data sets that contain points, lines and polygons. However, the developers of GML envision communities working to define community-specific application schemas that are specialized extensions of GML. Using application schemas, users can refer to roads, highways, and bridges instead of points, lines and polygons. If everyone in a community agrees to use the same schemas they can exchange data easily and be sure that a road is still a road when they view it. Clients and servers with interfaces that implement the OpenGIS® Web Feature Service Interface Standard read and write GML data. GML is also an ISO standard (ISO 19136:2007)
NuGet Package ID | LiquidTechnologies.XmlObjects.GML3-1-0 |
---|---|
Description | An object model for the GML 3.1.0 standard providing strongly typed classes that can be serialized/deserializsed to XML. |
Documentation | Liquid XML Objects API |
Schema Documentation | https://schemas.liquid-technologies.com/GML/3.1.0/ |
Official Schema Site | http://www.opengeospatial.org/ |
License | EULA |
Supported Platforms |
|
- Create a new Visual Studio Project
- Add a reference to the nuget package @myModel.NugetID
-
Create an LxSerializer<> for your root element
- If the root element in your XML document is 'MyRoot' then the object generated to represent it should be called 'MyRootElm'*1
- Hint - In Visual Studio placing the caret within the code LxSerializer<MyRootElm> and pressing Alt-Shift-F10 will give you the option to add the appropriate using statement.
- Use the LxSerializer to read in the XML Document using the Deserialize method
- Setting a break point after this line will allow you to explore the structure of the object in the visual studio watch windows.
- Use the LxSerializer to write in the XML Document back out using the Serialize method
LxSerializer<ExamplePersonElm> serializer = LxSerializer<ExamplePersonElm>(); // Reading an XML file ExamplePersonElm person = serializer.Deserialize("MyPersonData.xml"); foreach(ExampleFriendElm friend in person.Friends) { Console.Write("Name = " + friend.Name); } // Edit the objects ExampleFriendElm newFriend = new ExampleFriendElm(); newFriend.Name = "Joe Blogs"; person.Friends.Add(newFriend); // Write the new data out as XML serializer.Serialize("MyNewPersonData.xml", person);
Video Tutorial
This video tutorial demonstrates the basic usage of the XML Objects tool, showing how to generate code from an XSD, read an XML document into the object model, modify the data and write out the XML.