This forum has been archived. All content is frozen. Please use KDE Discuss instead.

GeoDataTreeModel-all available data given by kml-data files?

Tags: None
(comma "," separated)
sirop
Registered Member
Posts
4
Karma
0
OS
Do I understand it correctly that GeoDataTreeModel only shows the structure of the kml-data,
but not all the data and if one has something like:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Placemark>
  <name>LinearRing.kml</name>
 <MultiGeometry>
  <Polygon>
    <outerBoundaryIs>
      <LinearRing>
        <coordinates>
          -122.365662,37.826988,0
          -122.365202,37.826302,0
          -122.364581,37.82655,0
          -122.365038,37.827237,0
          -122.365662,37.826988,0
        </coordinates>
      </LinearRing>
    </outerBoundaryIs>
  </Polygon>
 </MultiGeometry>
</Placemark>
</kml>


one can only exract the coordinates of the LinearRing by doing something like
void FileReaderPositionProviderPluginPrivate::createSimulationPlacemarks( GeoDataContainer *container ) ?
User avatar
Earthwings
KDE Developer
Posts
172
Karma
1
OS
The model contains both the structure and the data. The view (TreeView) only shows the structure though. I don't quite get the relation FileReaderPositionProviderPluginPrivate::createSimulationPlacemarks, can you elaborate on that?
sirop
Registered Member
Posts
4
Karma
0
OS
Earthwings wrote:The model contains both the structure and the data. The view (TreeView) only shows the structure though. I don't quite get the relation FileReaderPositionProviderPluginPrivate::createSimulationPlacemarks, can you elaborate on that?

Ok, maybe, I just did not understand QAbstractItemModel in order to deal with GeoDataTreeModel properly.

Why FileReaderPositionProviderPluginPrivate::createSimulationPlacemarks ?

In FileReaderPositionProviderPluginPrivate you load a kml file with placemarks but you do not use GeoDataTreeModel for this purpose.
On the other hand in examples/cpp/kml-inspector/main.cpp you use GeoDataTreeModel .

So I do not understand which is the better/faster way of dealing with kml files: parse a kml file as in FileReaderPositionProviderPluginPrivate
or load in into GeoDataTreeModel as in examples/cpp/kml-inspector/main.cpp ?


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell