GISdevelopment.net ---> Technology ---> GIS

Developing an Internet-GIS Application using GML

Ehsan Mohammadi
Ehsan Mohammadi
M.Sc. Student, Dept. of GIS Eng.
Email: mohammadiehsan@yahoo.com

Ali Aien
M.Sc. Student, Dept. of GIS Eng.
Email: ali_aien@yahoo.com

Ali A. Alesheikh
Assistant Professor, Dept. of GIS Eng.
Email: ali_alesheikh@hotmail.com

K.N. Toosi University of Technology Vali_asr St, Tehran, Iran, P.C. 19697
Tel: +98 21 8789357 Fax: +98 21 877 9476



Abstract
In recent years, Internet has become the predominant technology that drives the whole world to a new era. Finding the best ways for transmission of information, as the major duty of Internet, invited many people to a big challenge which is being continued till now. Creation of various formats, software, and languages with many advantages and disadvantages, is the offspring of accepting this challenge. Text format is a way of transmitting information that has its own advantages, like low volume, data security via transmission, ease of use, editability and etc. So, text-based languages developed for Internet applications. These languages had to distinguish between text itself and information contents in the text, thus, ML (Markup Languages) became into existence. GML as a new kind of Markup Languages is a way to deal with geographic information via the Internet. It is an XML encoding for the transport and storage of geographic information, including both the spatial and non-spatial properties of geographic features. By using this new technology in the implementation phase, a map of Iranian roads is distributed to the internet.

1. Introduction
The ability to extend the audience of GIS to a large circle of users via Internet is growing as well as growth of Internet technology itself. Progress of the Internet technology is the result of many attempts and through these attempts, a great collection of data formats, programming languages, hardware and software appeared. A large part of Internet progress depends on the suitable approaches of dealing with data and information, and markup languages (MLs) play the main role in this progress. A markup language is a way of describing a document by placing tags in the document. Markup languages differ from many other programming languages, in containing loops, conditional logics, subroutines and some other programming structures. There are many markup languages with different applications these days. The most important MLs are: SGML, HTML, and XML.

SGML stands for Standard Generalized Markup Language and is a powerful markup language in handling large quantities of structured data, but it is complex to use. HTML is the language of the web. It defines the way that images, multimedia and text are displayed in web browsers. It is simple to learn and use, but is not good at describing what data means. It is just a picture of information. XML stands for eXtensible Markup Language and was designed to describe data. It is created to structure, store and to send information. It also allows everyone to create his own information, send anything to anywhere for anybody. It has the capability of SGML and simplicity of HTML. It is also free and clear for any user.

XML also is used to create other markup languages for particular applications. For instance, GML is a very useful and simple markup language for GIS applications that is extended by XML. In order to provide an Internet-GIS application, GML must include spatial and non-spatial information together. Some technologies help GML to show the graphic of spatial information, like SVG. SVG itself is a world of graphical tools, which can be handled with using just text.

Integration of these technologies, that follow the principals of markup languages, helps designers to implement simple and versatile applications via Internet.

2. XML
XML is a computer language for defining MLs and is used to create structured documents. Defining the contents of a document is equivalent to creating structured information in the document.

XML opens a great view for creating other markup languages, and allows other applications to have a specific ML only for themselves. The focus of XML is on data and what data is. It means that the duty of defining tags and data is not predefined for XML and designers can do it according to their aims. Any XMLWriter allows the designer to describe parts of XML document, which composes of two main components: The structure of XML document and DTD or schema.

The first component includes of a prolog and elements. The prolog for an XML document states some information to the parsers. This information expresses that this document is marked up in XML and can contain XML processor instruction. The prolog also includes text encoding, declaration of special pieces of text, and the DTD (Document Type Definition) or schema being used. The elements come after the prolog and let XML tags be written here.

The second component is DTD, the grammar of the XML page. It actually is a tool to create and describe XML tags. Once a DTD is created and a document has been written based on that DTD, the document will be compared to the DTD that will cause the validation of the document. If the XML document follows the rules listed in the DTD, then the document is said to be valid, otherwise it is called invalid. Schema has the capability of DTD but differs in some characteristics, like, it is predefined for a specific application, then, there is no need to define how XML application will work.

To use the XML document, some programs are needed to distinguish between text and information contents in the text. Parsers are programs that facilitate the task for users. Parsers can read XML documents and parse the XML information into data and markup. Internet Explorer 4 was the first web browser that included XML parser. Some of the renowned XML parsers are IE5, Expat, and Lark.

The specific advantages of XML are:
  • XML is straightforwardly useable over the Internet.
  • XML moves most of the processing form the server to the clients.
  • XML supports a wide variety of applications.
  • XML is compatible with SGML.
  • XML documents are human- legible and reasonably clear.
  • The XML design is prepared quickly.
  • The XML document is easy for machine to understand.
  • The XML documents are easy to create.
  • It is easy to write programs that process XML documents, and so on.
In order to develop an Internet-GIS application, some new schemas are introduced by XML. Among these new schemas, GML was chosen to maneuver on.

3. GML
GML stands for Geography Markup Language and is a new way to deal with geographic data and information in Web. It is an XML encoding for the transport and storage of geographic information, including both the spatial and non-spatial properties of geographic features.

It is important to draw some clear distinctions between geographic data (which is encoded in GML) and graphic interpretations of that data as might appear on a map or other form of visualization. Geographic data is concerned with a representation of the world in spatial terms that is independent of any particular visualization of that data. GIS captures information about the properties and geometry of the objects that populate the world. How to symbolize these on a map, the colors or line weights is something quite different. Just as XML now helps to clearly separate content from presentation for web pages, so GML will do the same in the world of geography and mapping.

To make a map with GML data, one must style the GML geographical content into a suitable graphical presentation. Typically this involves the interpretation of the GML content using graphical symbols, line styles and area or volume fills, and often some sort of transformation of the geometry of the GML data into the geometry of the visual presentation. This interpretation process is called “map styling”. This loosely corresponds to the more conventional document styling of XML into a presentation format such as HTML.

In the majority of cases the GML data are styled into an XML graphical format using SVG (Scalable Vector Graphics), VML (Vector Markup Language) or X3D technologies.

The process of transforming the graphical presentation (i.e. the output of the map styler in SVG, VML or X3D) into a viewable image is referred to as graphical rendering. At the present time there are a variety of graphical renders available for each of the different XML graphical formats, some native to the browser (e.g. Internet Explorer 5.0’s built in VML processor), some distributed as plug- ins for many browsers (e.g. Adobe SVG Viewer) and some available as stand alone viewers or code libraries (SVG and X3D).

As mentioned earlier GML includes both the spatial and non-spatial properties of geographic features. For encoding spatial information GML defines three base schemas:
  1. The Geometry which includes the detailed geometry components.
  2. The XLinks schema which provides the XLink attributes used to implement linking functionality.
  3. The Feature schema which defines the general feature-property model.
These schema documents alone do not provide a schema suitable for constraining data instances; rather, they provide base types and structures which may be used by an "application schema". An application schema declares the actual feature types and property types of interest for a particular domain, using components from GML in standard ways. Broadly, these involve defining application-specific types which are derived from types in the standard GML schemas, or by directly including elements and types from the standard GML schemas.

4. Implementation
Based on the XML standard, the GML handles both the geometry and the properties of the geographical elements; this allows the various data providers to share heterogeneous data sets and the users to access the data in a completely transparent way. From the application point of view, it simplifies and standardizes the operations in many sectors, from map building to data format transformation, from spatial query to geographical analysis, including the emerging applications in mobile systems. Since the GML data structure is XML-compliant, it can be transformed in a SVG (Scalable Vector Graphics) document format and then easily displayed on a standard web browser.

The implementation's main goal is the processing of GML documents and their visualization in a graphical way, with the interaction of the user. A set of basic functionalities handling both the graphical (zoom, pan, identification, ...), the geographical and the thematic aspects have been developed for Iranian roads. Also the capability for displaying the footprint of a tracked vehicle was added to the implementation, which gets GPS information from a text file.


Figure 1. A simple display of tracked vehicle in a web browser using SVG.



Figure 2. A simple display of Zoom In capability in a web browser using SVG.

The aim of this work is not only building a specific application, but is for some other fold:
  • to validate the XML (GML and SVG in particular) technology in order to verify its capabilities to solve some GIS problems;
  • to migrate the GIS operations from Server to Client side in order to discover which kind of operation can be allowed;
  • to create a basic environment on which the develop customized applications integrates a set of specific functions.
5. Conclusion
Some achieved notes from the experience of using the GML technology for GIS applications are:
  • GML does not exactly define the rules of the attribute definition for non-geographical elements. These attributes can be expressed in the XML format, defining a specific application schema describing the structure and the types of the geographical and alphanumerical data used by the application.
  • At present, the GML is oriented to vector data only and no specific element is defined to manage raster data (such as the geo-referenced images). This is a strong limitation because it does not allow the superimposition of vector data on a raster background. This restriction can be overcome specifying the raster image by means of an XML tag.
  • SVG has been developed to handle vector graphics data and decreases some GIS facilities concerning specifically with the representation of geographical data. In particular it cannot handle the geographical coordinate system transformations and consequently cannot merge dynamically GML data with different coordiante systems on the same layer and on the same map. This transformation have to be done by specific functions operating on the GML data.
  • The GML can define geographical data by its geometry and attributes, but do not specify how this data must be represented.
  • It is possible to use the various existing XML parsers and XML-based technologies to build GIS applications working on GML data.
  • Specific applications can be created and distributed to users for their own GIS needs. As the applications are running on the browser, no commercial GIS software must be purchased.
  • SVG is mainly oriented to vector data but can define also raster data as JPEG, PNG files containing georeferenced images; with this approach the overlay of vector data on a raster data background is allowed.
6. Acknowledgement
The best thanks and appreciations are dedicated to those who have supported our work educationally and emotionally, specially Mr Hossein Mohammadi and Miss Mehrnoosh Ghorbani as the best friends.

7. References
  1. Essential XML for Web professionals, Livingston D., 2002
  2. SVG Explorer of GML Data, Bonati L. P., Fortunati L., Fresta G., 2003
  3. Making maps with Geography Markup Language (GML), Lake R., Galdos Systems Inc, October 2000.
  4. OpenGIS Geography Markup Language (GML) Implementation Specification, Open GIS Consortium, January 2003.
  5. XML lessons, Kyrnin J., 2003
© GISdevelopment.net. All rights reserved.