Jump to content

Marble/GeoData: Difference between revisions

From KDE Community Wiki
Tgridel (talk | contribs)
description moved from GraphicsViewGeoParser
Ochurlaud (talk | contribs)
m 10 revisions imported
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== GeoData Overview ==
== GeoData Overview ==


GeoData holds the data model that is internally used for any geographic information which should be rendered. It deals whith the data only, drawing is performed elsewhere.
The Marble Framework has got two major design goals:
* The Marble Framework should build strongly on [http://qt.gitorious.org/qt/pages/ApiDesignPrinciples#Naming+Enum+Types+and+Values Qt-API principles] and Qt design concepts.
* The map data should be handled using classes that are modelled after the [http://code.google.com/intl/de/apis/kml/documentation/kmlreference.html KML OGC standard].


{{class|GeoDataDocument|kdeedu|4.2}} describes a document.
The KML standard itself describes the properties of a data model for maps:


A model representation is built through parsing of files and creating a stack of {{class|GeoDataObject|kdeedu|4.2}} representing its data.
The Geodata objects are all modeled after the Google KML files as defined in the [http://code.google.com/apis/kml/documentation/kml_tags_21.html KML documentation].




== Parsing GeoData ==
GeoData holds the data model that is internally used for any geographic information which should be rendered. It deals whith the data only, drawing is performed elsewhere.
The {{class|GeoParser|kdeedu|4.2}} is a framework to parse xml files based on the {{qt|QXMLStreamReader}} class in Qt (more info [http://doc.qtsoftware.com/4.5/qtxml.html here]).


It is specialised in {{class|GeoDataParser|kdeedu|4.2}} to handle KML, GPX, GeoRSS and OSM formats and populate the data model. The parser relies on
A model representation of a document is built through parsing of files and creating a {{class|GeoDataDocument|kdeedu|4.x}} with {{class|GeoDataObject|kdeedu|4.2}} representing its data.
The Geodata objects are all modeled after the Google KML files as defined in the [http://code.google.com/apis/kml/documentation/kml_tags_21.html KML documentation].


* {{class|GeoTagHandler|kdeedu|4.2}} classes which define how a node in the file is to be processed and should populate the data model.
;[[/GeoDataUse|Use cases for GeoData classes]]
* A {{class|GeoStackItem|kdeedu|4.2}} class that implements the Structural parts of the XML document
;[http://websvn.kde.org/*checkout*/trunk/KDE/kdeedu/marble/src/lib/geodata/data/README.html GeoData API Description]
* The collection class where the results of the XML parsing will be placed
* An element dictionary that prevents the need for string comparison everywere


To implement a new XML parser you need to
#compile an element dictionary of all of the available tags in the namespace
#implement a tag handler for each of these elements
#register that tag handler with the GeoParser


==== Implementing a tag handler ====
;[[/GeoDataParsing|Parsing GeoData]]
Each tag handler is called when the relevant XML tag is reached by the GeoParser ( which knows what tags to call by its registered tag list ). Each tag can access the stack data structure of the GeoParser as well as the Collection Data Structure of the GeoParser. This allows the tag handler to access items from the stack and allows root elements of the XML to add themselves to the collection data structure.
;[[/GeoDataWriter|Writing GeoData]]

Latest revision as of 08:05, 21 October 2016

GeoData Overview

The Marble Framework has got two major design goals:

  • The Marble Framework should build strongly on Qt-API principles and Qt design concepts.
  • The map data should be handled using classes that are modelled after the KML OGC standard.

The KML standard itself describes the properties of a data model for maps:


GeoData holds the data model that is internally used for any geographic information which should be rendered. It deals whith the data only, drawing is performed elsewhere.

A model representation of a document is built through parsing of files and creating a GeoDataDocument with GeoDataObject representing its data. The Geodata objects are all modeled after the Google KML files as defined in the KML documentation.

Use cases for GeoData classes
GeoData API Description


Parsing GeoData
Writing GeoData