• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • sources
  • kde-4.12
  • kdeedu
  • marble
  • tools
  • osm-addresses
tools/osm-addresses/OsmParser.cpp
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2011 Dennis Nienhüser <earthwings@gentoo.org>
9 //
10 
11 #include "OsmParser.h"
12 #include "OsmRegionTree.h"
13 
14 #include "GeoDataLinearRing.h"
15 #include "GeoDataLineString.h"
16 #include "GeoDataPolygon.h"
17 #include "GeoDataDocument.h"
18 #include "GeoDataFolder.h"
19 #include "GeoDataPlacemark.h"
20 #include "GeoDataMultiGeometry.h"
21 #include "GeoDataStyle.h"
22 #include "GeoDataStyleMap.h"
23 #include "GeoDataLineStyle.h"
24 #include "GeoDataFeature.h"
25 #include "geodata/writer/GeoWriter.h"
26 #include "geodata/data/GeoDataExtendedData.h"
27 
28 #include <QDebug>
29 #include <QTime>
30 
31 namespace Marble
32 {
33 
34 using namespace Oxygen;
35 
36 namespace {
37  struct GrahamScanHelper {
38  Coordinate coordinate;
39  qreal direction;
40 
41  GrahamScanHelper( const Coordinate &coordinate_=Coordinate(), qreal direction_=0.0 )
42  : coordinate( coordinate_ ), direction( direction_ )
43  {
44  // nothing to do
45  }
46 
47  double turnDirection( const GrahamScanHelper &two, const GrahamScanHelper &three )
48  {
49  return ( two.coordinate.lat - coordinate.lat ) * ( three.coordinate.lon - coordinate.lon )
50  - ( two.coordinate.lon - coordinate.lon ) * ( three.coordinate.lat - coordinate.lat );
51  }
52 
53  static bool directionLessThan( const GrahamScanHelper &one, const GrahamScanHelper &two )
54  {
55  return one.direction < two.direction;
56  }
57  };
58 }
59 
60 bool moreImportantAdminArea( const OsmRegion &a, const OsmRegion b )
61 {
62  return a.adminLevel() < b.adminLevel();
63 }
64 
65 OsmParser::OsmParser( QObject *parent ) :
66  QObject( parent ), m_convexHull( 0 )
67 {
68  m_categoryMap["tourism/camp_site"] = OsmPlacemark::AccomodationCamping;
69  m_categoryMap["tourism/hostel"] = OsmPlacemark::AccomodationHostel;
70  m_categoryMap["tourism/hotel"] = OsmPlacemark::AccomodationHotel;
71  m_categoryMap["tourism/motel"] = OsmPlacemark::AccomodationMotel;
72  //m_categoryMap["/"] = OsmPlacemark::AccomodationYouthHostel;
73  m_categoryMap["amenity/library"] = OsmPlacemark::AmenityLibrary;
74  m_categoryMap["amenity/college"] = OsmPlacemark::EducationCollege;
75  m_categoryMap["amenity/school"] = OsmPlacemark::EducationSchool;
76  m_categoryMap["amenity/university"] = OsmPlacemark::EducationUniversity;
77  m_categoryMap["amenity/bar"] = OsmPlacemark::FoodBar;
78  m_categoryMap["amenity/biergarten"] = OsmPlacemark::FoodBiergarten;
79  m_categoryMap["amenity/cafe"] = OsmPlacemark::FoodCafe;
80  m_categoryMap["amenity/fast_food"] = OsmPlacemark::FoodFastFood;
81  m_categoryMap["amenity/pub"] = OsmPlacemark::FoodPub;
82  m_categoryMap["amenity/restaurant"] = OsmPlacemark::FoodRestaurant;
83  m_categoryMap["amenity/doctor"] = OsmPlacemark::HealthDoctors;
84  m_categoryMap["amenity/doctors"] = OsmPlacemark::HealthDoctors;
85  m_categoryMap["amenity/hospital"] = OsmPlacemark::HealthHospital;
86  m_categoryMap["amenity/pharmacy"] = OsmPlacemark::HealthPharmacy;
87  m_categoryMap["amenity/atm"] = OsmPlacemark::MoneyAtm;
88  m_categoryMap["amenity/bank"] = OsmPlacemark::MoneyBank;
89  m_categoryMap["shop/beverages"] = OsmPlacemark::ShoppingBeverages;
90  m_categoryMap["shop/hifi"] = OsmPlacemark::ShoppingHifi;
91  m_categoryMap["shop/supermarket"] = OsmPlacemark::ShoppingSupermarket;
92  m_categoryMap["tourism/attraction"] = OsmPlacemark::TouristAttraction;
93  m_categoryMap["tourism/castle"] = OsmPlacemark::TouristCastle;
94  m_categoryMap["amenity/cinema"] = OsmPlacemark::TouristCinema;
95  m_categoryMap["tourism/monument"] = OsmPlacemark::TouristMonument;
96  m_categoryMap["tourism/museum"] = OsmPlacemark::TouristMuseum;
97  m_categoryMap["historic/ruins"] = OsmPlacemark::TouristRuin;
98  m_categoryMap["amenity/theatre"] = OsmPlacemark::TouristTheatre;
99  m_categoryMap["tourism/theme_park"] = OsmPlacemark::TouristThemePark;
100  m_categoryMap["tourism/viewpoint"] = OsmPlacemark::TouristViewPoint;
101  m_categoryMap["tourism/zoo"] = OsmPlacemark::TouristZoo;
102  m_categoryMap["aeroway/aerodrome"] = OsmPlacemark::TransportAirport;
103  m_categoryMap["aeroway/terminal"] = OsmPlacemark::TransportAirportTerminal;
104  m_categoryMap["amenity/bus_station"] = OsmPlacemark::TransportBusStation;
105  m_categoryMap["highway/bus_stop"] = OsmPlacemark::TransportBusStop;
106  m_categoryMap["highway/speed_camera"] = OsmPlacemark::TransportSpeedCamera;
107  m_categoryMap["amenity/car_sharing"] = OsmPlacemark::TransportCarShare;
108  m_categoryMap["amenity/car_rental"] = OsmPlacemark::TransportRentalCar;
109  m_categoryMap["amenity/bicycle_rental"] = OsmPlacemark::TransportRentalBicycle;
110  m_categoryMap["amenity/fuel"] = OsmPlacemark::TransportFuel;
111  m_categoryMap["amenity/parking"] = OsmPlacemark::TransportParking;
112  m_categoryMap["amenity/taxi"] = OsmPlacemark::TransportTaxiRank;
113  m_categoryMap["railway/station"] = OsmPlacemark::TransportTrainStation;
114  m_categoryMap["railway/tram_stop"] = OsmPlacemark::TransportTramStop;
115 }
116 
117 void OsmParser::addWriter( Writer* writer )
118 {
119  m_writers.push_back( writer );
120 }
121 
122 Node::operator OsmPlacemark() const
123 {
124  OsmPlacemark placemark;
125  placemark.setCategory( category );
126  placemark.setName( name.trimmed() );
127  placemark.setHouseNumber( houseNumber.trimmed() );
128  placemark.setLongitude( lon );
129  placemark.setLatitude( lat );
130  return placemark;
131 }
132 
133 Node::operator Coordinate() const
134 {
135  Coordinate coordinate;
136  coordinate.lon = lon;
137  coordinate.lat = lat;
138  return coordinate;
139 }
140 
141 Way::operator OsmPlacemark() const
142 {
143  OsmPlacemark placemark;
144  placemark.setCategory( category );
145  placemark.setName( name.trimmed() );
146  placemark.setHouseNumber( houseNumber.trimmed() );
147  return placemark;
148 }
149 
150 void Way::setPosition( const QHash<int, Coordinate> &database, OsmPlacemark &placemark ) const
151 {
152  if ( !nodes.isEmpty() ) {
153  if ( nodes.first() == nodes.last() && database.contains( nodes.first() ) ) {
154  GeoDataLinearRing ring;
155  foreach( int id, nodes ) {
156  if ( database.contains( id ) ) {
157  const Coordinate &node = database[id];
158  GeoDataCoordinates coordinates( node.lon, node.lat, 0.0, GeoDataCoordinates::Degree );
159  ring << coordinates;
160  } else {
161  qDebug() << "Missing node " << id << " in database";
162  }
163  }
164 
165  if ( !ring.isEmpty() ) {
166  GeoDataCoordinates center = ring.latLonAltBox().center();
167  placemark.setLongitude( center.longitude( GeoDataCoordinates::Degree ) );
168  placemark.setLatitude( center.latitude( GeoDataCoordinates::Degree ) );
169  }
170  } else {
171  int id = nodes.at( nodes.size() / 2 );
172  if ( database.contains( id ) ) {
173  const Coordinate &node = database[id];
174  placemark.setLongitude( node.lon );
175  placemark.setLatitude( node.lat );
176  }
177  }
178  }
179 }
180 
181 void Way::setRegion( const QHash<int, Node> &database, const OsmRegionTree & tree, QList<OsmOsmRegion> & osmOsmRegions, OsmPlacemark &placemark ) const
182 {
183  if ( !city.isEmpty() ) {
184  foreach( const OsmOsmRegion & region, osmOsmRegions ) {
185  if ( region.region.name() == city ) {
186  placemark.setRegionId( region.region.identifier() );
187  return;
188  }
189  }
190 
191  foreach( const Node & node, database ) {
192  if ( node.category >= OsmPlacemark::PlacesRegion &&
193  node.category <= OsmPlacemark::PlacesIsland &&
194  node.name == city ) {
195  qDebug() << "Creating a new implicit region from " << node.name << " at " << node.lon << "," << node.lat;
196  OsmOsmRegion region;
197  region.region.setName( city );
198  region.region.setLongitude( node.lon );
199  region.region.setLatitude( node.lat );
200  placemark.setRegionId( region.region.identifier() );
201  osmOsmRegions.push_back( region );
202  return;
203  }
204  }
205 
206  qDebug() << "Unable to locate city " << city << ", setting it up without coordinates";
207  OsmOsmRegion region;
208  region.region.setName( city );
209  placemark.setRegionId( region.region.identifier() );
210  osmOsmRegions.push_back( region );
211  return;
212  }
213 
214  GeoDataCoordinates position( placemark.longitude(), placemark.latitude(), 0.0, GeoDataCoordinates::Degree );
215  placemark.setRegionId( tree.smallestRegionId( position ) );
216 }
217 
218 void OsmParser::read( const QFileInfo &content, const QString &areaName )
219 {
220  QTime timer;
221  timer.start();
222 
223  m_nodes.clear();
224  m_ways.clear();
225  m_relations.clear();
226 
227  m_placemarks.clear();
228  m_osmOsmRegions.clear();
229 
230  int pass = 0;
231  bool needAnotherPass = false;
232  do {
233  qWarning() << "Step 1." << pass << ": Parsing input file " << content.fileName();
234  parse( content, pass++, needAnotherPass );
235  }
236  while ( needAnotherPass );
237 
238  qWarning() << "Step 2: " << m_coordinates.size() << "coordinates."
239  << "Now extracting regions from" << m_relations.size() << "relations";
240 
241  QHash<int, Relation>::iterator itpoint = m_relations.begin();
242  QHash<int, Relation>::iterator const endpoint = m_relations.end();
243  for(; itpoint != endpoint; ++itpoint ) {
244  if ( itpoint.value().isAdministrativeBoundary /*&& relation.isMultipolygon*/ ) {
245  importMultipolygon( itpoint.value() );
246  if ( !itpoint.value().relations.isEmpty() ) {
247  qDebug() << "Ignoring relations inside the relation " << itpoint.value().name;
248  }
249  }
250  }
251 
252  m_relations.clear();
253 
254  for ( int i = 0; i < m_osmOsmRegions.size(); ++i ) {
255  OsmOsmRegion &osmOsmRegion = m_osmOsmRegions[i];
256  GeoDataCoordinates center = osmOsmRegion.region.geometry().latLonAltBox().center();
257  osmOsmRegion.region.setLongitude( center.longitude( GeoDataCoordinates::Degree ) );
258  osmOsmRegion.region.setLatitude( center.latitude( GeoDataCoordinates::Degree ) );
259  }
260 
261  qWarning() << "Step 3: Creating region hierarchies from" << m_osmOsmRegions.size() << "administrative boundaries";
262 
263  QMultiMap<int,int> sortedRegions;
264  for ( int i = 0; i < m_osmOsmRegions.size(); ++i ) {
265  sortedRegions.insert( m_osmOsmRegions[i].region.adminLevel(), i );
266  }
267 
268  for ( int i = 0; i < m_osmOsmRegions.size(); ++i ) {
269  GeoDataLinearRing const & ring = m_osmOsmRegions[i].region.geometry().outerBoundary();
270  OsmOsmRegion* parent = 0;
271  qDebug() << "Examining admin region " << i << " of " << m_osmOsmRegions.count();
272  for ( int level=m_osmOsmRegions[i].region.adminLevel()-1; level >= 0 && parent == 0; --level ) {
273  QList<int> candidates = sortedRegions.values( level );
274  qDebug() << "Examining " << candidates.count() << "admin regions on level" << level;
275  foreach( int j, candidates ) {
276  GeoDataLinearRing const & outer = m_osmOsmRegions[j].region.geometry().outerBoundary();
277  if ( contains<GeoDataLinearRing, GeoDataLinearRing>( outer, ring ) ) {
278  if ( parent == 0 || contains<GeoDataLinearRing, GeoDataLinearRing>( parent->region.geometry().outerBoundary(), outer ) ) {
279  qDebug() << "Parent found: " << m_osmOsmRegions[i].region.name() << ", level " << m_osmOsmRegions[i].region.adminLevel()
280  << "is a child of " << m_osmOsmRegions[j].region.name() << ", level " << m_osmOsmRegions[j].region.adminLevel();
281  parent = &m_osmOsmRegions[j];
282  break;
283  }
284  }
285  }
286  }
287 
288  m_osmOsmRegions[i].parent = parent;
289  }
290 
291  for ( int i = 0; i < m_osmOsmRegions.size(); ++i ) {
292  int const parent = m_osmOsmRegions[i].parent ? m_osmOsmRegions[i].parent->region.identifier() : 0;
293  m_osmOsmRegions[i].region.setParentIdentifier( parent );
294  }
295 
296  OsmRegion mainArea;
297  mainArea.setIdentifier( 0 );
298  mainArea.setName( areaName );
299  mainArea.setAdminLevel( 1 );
300  QPair<float, float> minLon( -180.0, 180.0 ), minLat( -90.0, 90.0 );
301  foreach( const Coordinate & node, m_coordinates ) {
302  minLon.first = qMin( node.lon, minLon.first );
303  minLon.second = qMax( node.lon, minLon.second );
304  minLat.first = qMin( node.lat, minLat.first );
305  minLat.second = qMax( node.lat, minLat.second );
306  }
307  GeoDataLatLonBox center( minLat.second, minLat.first,
308  minLon.second, minLon.first );
309  mainArea.setLongitude( center.center().longitude( GeoDataCoordinates::Degree ) );
310  mainArea.setLatitude( center.center().latitude( GeoDataCoordinates::Degree ) );
311 
312  QList<OsmRegion> regions;
313  foreach( const OsmOsmRegion & region, m_osmOsmRegions ) {
314  regions << region.region;
315  }
316 
317  qSort( regions.begin(), regions.end(), moreImportantAdminArea );
318  OsmRegionTree regionTree( mainArea );
319  regionTree.append( regions );
320  Q_ASSERT( regions.isEmpty() );
321  int left = 0;
322  regionTree.traverse( left );
323 
324  qWarning() << "Step 4: Creating placemarks from" << m_nodes.size() << "nodes";
325 
326  foreach( const Node & node, m_nodes ) {
327  if ( node.save ) {
328  OsmPlacemark placemark = node;
329  GeoDataCoordinates position( node.lon, node.lat, 0.0, GeoDataCoordinates::Degree );
330  placemark.setRegionId( regionTree.smallestRegionId( position ) );
331 
332  if ( !node.name.isEmpty() ) {
333  placemark.setHouseNumber( QString() );
334  m_placemarks.push_back( placemark );
335  }
336 
337  if ( !node.street.isEmpty() && node.name != node.street ) {
338  placemark.setCategory( OsmPlacemark::Address );
339  placemark.setName( node.street.trimmed() );
340  placemark.setHouseNumber( node.houseNumber.trimmed() );
341  m_placemarks.push_back( placemark );
342  }
343  }
344  }
345 
346  qWarning() << "Step 5: Creating placemarks from" << m_ways.size() << "ways";
347  QMultiMap<QString, Way> waysByName;
348  foreach ( const Way & way, m_ways ) {
349  if ( way.save ) {
350  if ( !way.name.isEmpty() && !way.nodes.isEmpty() ) {
351  waysByName.insert( way.name, way );
352  }
353 
354  if ( !way.street.isEmpty() && way.name != way.street && !way.nodes.isEmpty() ) {
355  waysByName.insert( way.street, way );
356  }
357  } else {
358  ++m_statistic.uselessWays;
359  }
360  }
361 
362  QSet<QString> keys = QSet<QString>::fromList( waysByName.keys() );
363  foreach( const QString & key, keys ) {
364  QList<QList<Way> > merged = merge( waysByName.values( key ) );
365  foreach( const QList<Way> ways, merged ) {
366  Q_ASSERT( !ways.isEmpty() );
367  OsmPlacemark placemark = ways.first();
368  ways.first().setPosition( m_coordinates, placemark );
369  ways.first().setRegion( m_nodes, regionTree, m_osmOsmRegions, placemark );
370 
371  if ( placemark.category() != OsmPlacemark::Address && !ways.first().name.isEmpty() ) {
372  placemark.setHouseNumber( QString() );
373  m_placemarks.push_back( placemark );
374  }
375 
376  if ( !ways.first().isBuilding || !ways.first().houseNumber.isEmpty() ) {
377  placemark.setCategory( OsmPlacemark::Address );
378  QString name = ways.first().street.isEmpty() ? ways.first().name : ways.first().street;
379  if ( !name.isEmpty() ) {
380  placemark.setName( name.trimmed() );
381  placemark.setHouseNumber( ways.first().houseNumber.trimmed() );
382  m_placemarks.push_back( placemark );
383  }
384  }
385  }
386  }
387 
388  m_convexHull = convexHull();
389  m_coordinates.clear();
390  m_nodes.clear();
391  m_ways.clear();
392 
393  Q_ASSERT( regions.isEmpty() );
394  foreach( const OsmOsmRegion & region, m_osmOsmRegions ) {
395  regions << region.region;
396  }
397 
398  qSort( regions.begin(), regions.end(), moreImportantAdminArea );
399  regionTree = OsmRegionTree( mainArea );
400  regionTree.append( regions );
401  Q_ASSERT( regions.isEmpty() );
402  left = 0;
403  regionTree.traverse( left );
404  regions = regionTree;
405 
406  qWarning() << "Step 6: " << m_statistic.mergedWays << " ways merged," << m_statistic.uselessWays << "useless ways."
407  << "Now serializing" << regions.size() << "regions";
408  foreach( const OsmRegion & region, regions ) {
409  foreach( Writer * writer, m_writers ) {
410  writer->addOsmRegion( region );
411  }
412  }
413 
414  qWarning() << "Step 7: Serializing" << m_placemarks.size() << "placemarks";
415  foreach( const OsmPlacemark & placemark, m_placemarks ) {
416  foreach( Writer * writer, m_writers ) {
417  Q_ASSERT( !placemark.name().isEmpty() );
418  writer->addOsmPlacemark( placemark );
419  }
420  }
421 
422  qWarning() << "Step 8: There is no step 8. Done after " << timer.elapsed() / 1000 << "s.";
423  //writeOutlineKml( areaName );
424 }
425 
426 QList< QList<Way> > OsmParser::merge( const QList<Way> &ways ) const
427 {
428  QList<WayMerger> mergers;
429 
430  foreach( const Way & way, ways ) {
431  mergers << WayMerger( way );
432  }
433 
434  bool moved = false;
435  do {
436  moved = false;
437  for( int i = 0; i < mergers.size(); ++i ) {
438  for ( int j = i + 1; j < mergers.size(); ++j ) {
439  if ( mergers[i].compatible( mergers[j] ) ) {
440  mergers[i].merge( mergers[j] );
441  moved = true;
442  mergers.removeAt( j );
443  }
444  }
445  }
446  } while ( moved );
447 
448  QList< QList<Way> > result;
449  foreach( const WayMerger & merger, mergers ) {
450  result << merger.ways;
451  }
452  m_statistic.mergedWays += ( ways.size() - result.size() );
453 
454  return result;
455 }
456 
457 void OsmParser::importMultipolygon( const Relation &relation )
458 {
460  typedef QPair<int, RelationRole> RelationPair;
461  QVector<GeoDataLineString> outer;
462  QVector<GeoDataLineString> inner;
463  foreach( const RelationPair & pair, relation.ways ) {
464  if ( pair.second == Outer ) {
465  importWay( outer, pair.first );
466  } else if ( pair.second == Inner ) {
467  importWay( inner, pair.first );
468  } else {
469  qDebug() << "Ignoring way " << pair.first << " with unknown relation role.";
470  }
471  }
472 
473  foreach( const GeoDataLineString & string, outer ) {
474  if ( string.isEmpty() || !( string.first() == string.last() ) ) {
475  qDebug() << "Ignoring open polygon in relation " << relation.name << ". Check data.";
476  continue;
477  }
478 
479  GeoDataPolygon polygon;
480  polygon.setOuterBoundary( string );
481  Q_ASSERT( polygon.outerBoundary().size() > 0 );
482 
483  foreach( const GeoDataLineString & hole, inner ) {
484  if ( contains<GeoDataLinearRing, GeoDataLineString>( polygon.outerBoundary(), hole ) ) {
485  polygon.appendInnerBoundary( hole );
486  }
487  }
488 
489  OsmOsmRegion region;
490  region.region.setName( relation.name );
491  region.region.setGeometry( polygon );
492  region.region.setAdminLevel( relation.adminLevel );
493  qDebug() << "Adding administrative region " << relation.name;
494  m_osmOsmRegions.push_back( region );
495  }
496 }
497 
498 void OsmParser::importWay( QVector<GeoDataLineString> &ways, int id )
499 {
500  if ( !m_ways.contains( id ) ) {
501  qDebug() << "Skipping unknown way " << id << ". Check data.";
502  return;
503  }
504 
505  GeoDataLineString way;
506  foreach( int node, m_ways[id].nodes ) {
507  if ( !m_coordinates.contains( node ) ) {
508  qDebug() << "Skipping unknown node " << node << ". Check data.";
509  } else {
510  const Coordinate &nd = m_coordinates[node];
511  GeoDataCoordinates coordinates( nd.lon, nd.lat, 0.0, GeoDataCoordinates::Degree );
512  way << coordinates;
513  }
514  }
515 
516  QList<int> remove;
517  do {
518  remove.clear();
519  for ( int i = 0; i < ways.size(); ++i ) {
520  const GeoDataLineString &existing = ways[i];
521  if ( existing.first() == way.first() ) {
522  way = reverse( way ) << existing;
523  remove.push_front( i );
524  } else if ( existing.last() == way.first() ) {
525  GeoDataLineString copy = existing;
526  way = copy << way;
527  remove.push_front( i );
528  } else if ( existing.first() == way.last() ) {
529  way << existing;
530  remove.push_front( i );
531  } else if ( existing.last() == way.last() ) {
532  way << reverse( existing );
533  remove.push_front( i );
534  }
535  }
536 
537  foreach( int key, remove ) {
538  ways.remove( key );
539  }
540  } while ( !remove.isEmpty() );
541 
542  ways.push_back( way );
543 }
544 
545 GeoDataLineString OsmParser::reverse( const GeoDataLineString & string )
546 {
547  GeoDataLineString result;
548  for ( int i = string.size() - 1; i >= 0; --i ) {
549  result << string[i];
550  }
551  return result;
552 }
553 
554 bool OsmParser::shouldSave( ElementType /*type*/, const QString &key, const QString &value )
555 {
556  typedef QList<QString> Dictionary;
557  static QHash<QString, Dictionary> interestingTags;
558  if ( interestingTags.isEmpty() ) {
559  Dictionary highways;
560  highways << "primary" << "secondary" << "tertiary";
561  highways << "residential" << "unclassified" << "road";
562  highways << "living_street" << "service" << "track";
563  highways << "bus_stop" << "platform" << "speed_camera";
564  interestingTags["highway"] = highways;
565 
566  Dictionary aeroways;
567  aeroways << "aerodrome" << "terminal";
568  interestingTags["aeroway"] = aeroways;
569 
570  interestingTags["aerialway"] = Dictionary() << "station";
571 
572  Dictionary leisures;
573  leisures << "sports_centre" << "stadium" << "pitch";
574  leisures << "park" << "dance";
575  interestingTags["leisure"] = leisures;
576 
577  Dictionary amenities;
578  amenities << "restaurant" << "food_court" << "fast_food";
579  amenities << "pub" << "bar" << "cafe";
580  amenities << "biergarten" << "kindergarten" << "school";
581  amenities << "college" << "university" << "library";
582  amenities << "ferry_terminal" << "bus_station" << "car_rental";
583  amenities << "car_sharing" << "fuel" << "parking";
584  amenities << "bank" << "pharmacy" << "hospital";
585  amenities << "cinema" << "nightclub" << "theatre";
586  amenities << "taxi" << "bicycle_rental" << "atm";
587  interestingTags["amenity"] = amenities;
588 
589  Dictionary shops;
590  shops << "beverages" << "supermarket" << "hifi";
591  interestingTags["shop"] = shops;
592 
593  Dictionary tourism;
594  tourism << "attraction" << "camp_site" << "caravan_site";
595  tourism << "chalet" << "chalet" << "hostel";
596  tourism << "hotel" << "motel" << "museum";
597  tourism << "theme_park" << "viewpoint" << "zoo";
598  interestingTags["tourism"] = tourism;
599 
600  Dictionary historic;
601  historic << "castle" << "fort" << "monument";
602  historic << "ruins";
603  interestingTags["historic"] = historic;
604 
605  Dictionary railway;
606  railway << "station" << "tram_stop";
607  interestingTags["railway"] = railway;
608 
609  Dictionary places;
610  places << "region" << "county" << "city";
611  places << "town" << "village" << "hamlet";
612  places << "isolated_dwelling" << "suburb" << "locality";
613  places << "island";
614  interestingTags["place"] = places;
615  }
616 
617  return interestingTags.contains( key ) &&
618  interestingTags[key].contains( value );
619 }
620 
621 void OsmParser::setCategory( Element &element, const QString &key, const QString &value )
622 {
623  QString const term = key + '/' + value;
624  if ( m_categoryMap.contains( term ) ) {
625  if ( element.category != OsmPlacemark::UnknownCategory ) {
626  qDebug() << "Overwriting category " << element.category << " with " << m_categoryMap[term] << " for " << element.name;
627  }
628  element.category = m_categoryMap[term];
629  }
630 }
631 
632 // From http://en.wikipedia.org/wiki/Graham_scan#Pseudocode
633 GeoDataLinearRing* OsmParser::convexHull() const
634 {
635  Q_ASSERT(m_coordinates.size()>2);
636  QList<Coordinate> coordinates = m_coordinates.values();
637 
638  QVector<GrahamScanHelper> points;
639  points.reserve( coordinates.size()+1 );
640  Coordinate start = coordinates.first();
641  int startPos = 0;
642  for ( int i=0; i<coordinates.size(); ++i ) {
643  if ( coordinates[i].lon < start.lon ) {
644  start = coordinates[i];
645  startPos = i;
646  }
647  points << coordinates[i];
648  }
649 
650  int const n = points.size();
651  Q_ASSERT( n == coordinates.size() );
652  Q_ASSERT( n>2 );
653  qSwap( points[1], points[startPos] );
654 
655  Q_ASSERT( start.lat != 360.0 );
656 
657  for ( int i=0; i<points.size(); ++i ) {
658  points[i].direction = atan2( start.lon - points[i].coordinate.lon,
659  start.lat - points[i].coordinate.lat );
660  }
661 
662  qSort( points.begin(), points.end(), GrahamScanHelper::directionLessThan );
663  points << points.first();
664 
665  int m = 2;
666  for ( int i=3; i<=n; ++i ) {
667  while ( points[m-1].turnDirection( points[m], points[i] ) <= 0 ) {
668  if ( m == 2 ) {
669  qSwap( points[m], points[i] );
670  ++i;
671  } else {
672  --m;
673  }
674 
675  Q_ASSERT( n+1 == points.size() );
676  Q_ASSERT( m > 0 );
677  Q_ASSERT( m <= n );
678  Q_ASSERT( i >= 0 );
679  Q_ASSERT( i <= n );
680  }
681 
682  ++m;
683  qSwap( points[m], points[i] );
684  }
685 
686  GeoDataLinearRing* ring = new GeoDataLinearRing;
687  for ( int i=1; i<=m; ++i ) {
688  ring->append(GeoDataCoordinates(points[i].coordinate.lon, points[i].coordinate.lat, 0.0, GeoDataCoordinates::Degree));
689  }
690 
691  return ring;
692 }
693 
694 QColor OsmParser::randomColor() const
695 {
696  QVector<QColor> colors = QVector<QColor>() << aluminumGray4 << brickRed4;
697  colors << woodBrown4 << forestGreen4 << hotOrange4;
698  colors << seaBlue2 << skyBlue4 << sunYellow6;
699  return colors.at( qrand() % colors.size() );
700 }
701 
702 void OsmParser::writeKml( const QString &area, const QString &version, const QString &date, const QString &transport, const QString &payload, const QString &filename ) const
703 {
704  GeoDataDocument* document = new GeoDataDocument;
705 
706  //foreach( const OsmOsmRegion & region, m_osmOsmRegions ) {
707  GeoDataPlacemark* placemark = new GeoDataPlacemark;
708  placemark->setName( area );
709  if ( !version.isEmpty() ) {
710  placemark->extendedData().addValue( GeoDataData( "version", version ) );
711  }
712  if ( !date.isEmpty() ) {
713  placemark->extendedData().addValue( GeoDataData( "date", date ) );
714  }
715  if ( !transport.isEmpty() ) {
716  placemark->extendedData().addValue( GeoDataData( "transport", transport ) );
717  }
718  if ( !payload.isEmpty() ) {
719  placemark->extendedData().addValue( GeoDataData( "payload", payload ) );
720  }
721 
722  GeoDataStyle style;
723  GeoDataLineStyle lineStyle;
724  QColor color = randomColor();
725  color.setAlpha( 200 );
726  lineStyle.setColor( color );
727  lineStyle.setWidth( 4 );
728  style.setLineStyle( lineStyle );
729  style.setStyleId( color.name().replace( '#', 'f' ) );
730 
731  GeoDataStyleMap styleMap;
732  styleMap.setStyleId( color.name().replace( '#', 'f' ) );
733  styleMap.insert( "normal", QString( "#" ).append( style.styleId() ) );
734  document->addStyle( style );
735 
736  placemark->setStyleUrl( QString( "#" ).append( styleMap.styleId() ) );
737 
738  //placemark->setGeometry( new GeoDataLinearRing( region.region.geometry().outerBoundary() ) );
739  GeoDataMultiGeometry *geometry = new GeoDataMultiGeometry;
740  geometry->append( m_convexHull );
741  placemark->setGeometry( geometry );
742 
743  document->append( placemark );
744  document->addStyleMap( styleMap );
745 // }
746 
747  GeoWriter writer;
748  writer.setDocumentType( "http://earth.google.com/kml/2.2" );
749 
750  QFile file( filename );
751  if ( !file.open( QIODevice::WriteOnly | QIODevice::Truncate ) ) {
752  qCritical() << "Cannot write to " << file.fileName();
753  }
754 
755  if ( !writer.write( &file, document ) ) {
756  qCritical() << "Can not write to " << file.fileName();
757  }
758  file.close();
759 }
760 
761 Coordinate::Coordinate(float lon_, float lat_) : lon(lon_), lat(lat_)
762 {
763  // nothing to do
764 }
765 
766 }
767 
768 #include "OsmParser.moc"
GeoDataDocument.h
Marble::OsmRegion::setLongitude
void setLongitude(qreal longitude)
Definition: OsmRegion.cpp:62
Marble::Writer::addOsmRegion
virtual void addOsmRegion(const OsmRegion &region)=0
Marble::GeoDataLineStyle
specifies the style how lines are drawn
Definition: GeoDataLineStyle.h:36
Marble::Statistic::mergedWays
unsigned int mergedWays
Definition: tools/osm-addresses/OsmParser.h:140
Marble::GeoDataCoordinates
A 3d point representation.
Definition: GeoDataCoordinates.h:52
Marble::Coordinate::Coordinate
Coordinate(float lon=0.0, float lat=0.0)
Definition: tools/osm-addresses/OsmParser.cpp:761
Marble::ElementType
ElementType
Definition: tools/osm-addresses/OsmParser.h:32
Marble::OsmParser::m_coordinates
QHash< int, Coordinate > m_coordinates
Definition: tools/osm-addresses/OsmParser.h:167
Marble::GeoDataDocument::addStyleMap
void addStyleMap(const GeoDataStyleMap &map)
Add a stylemap to the stylemap storage.
Definition: GeoDataDocument.cpp:137
Marble::WayMerger
Definition: tools/osm-addresses/OsmParser.h:88
Marble::OsmPlacemark::EducationUniversity
Definition: OsmPlacemark.h:38
Marble::GeoDataStyleSelector::setStyleId
void setStyleId(const QString &value)
Set a new style id.
Definition: GeoDataStyleSelector.cpp:60
Marble::OsmPlacemark::PlacesIsland
Definition: OsmPlacemark.h:85
Marble::GeoDataDocument
A container for Features, Styles and in the future Schemas.
Definition: GeoDataDocument.h:64
Marble::Coordinate::lon
float lon
Definition: tools/osm-addresses/OsmParser.h:65
Marble::GeoDataLinearRing
A LinearRing that allows to store a closed, contiguous set of line segments.
Definition: GeoDataLinearRing.h:68
Marble::OsmRegion
A lightweight data structure to represent administrative regions like villages, cities, states, ...
Definition: OsmRegion.h:26
Marble::OsmPlacemark::Address
Definition: OsmPlacemark.h:34
Marble::OsmParser::setCategory
void setCategory(Element &element, const QString &key, const QString &value)
Definition: tools/osm-addresses/OsmParser.cpp:621
Marble::OsmPlacemark::TransportAirport
Definition: OsmPlacemark.h:63
GeoDataPolygon.h
Marble::OsmPlacemark::TouristRuin
Definition: OsmPlacemark.h:58
Marble::Way::nodes
QList< int > nodes
Definition: tools/osm-addresses/OsmParser.h:80
Marble::OsmRegionTree::smallestRegionId
int smallestRegionId(const GeoDataCoordinates &coordinates) const
Definition: OsmRegionTree.cpp:82
Marble::OsmPlacemark::TouristTheatre
Definition: OsmPlacemark.h:59
Marble::OsmParser::writeKml
void writeKml(const QString &area, const QString &version, const QString &date, const QString &transport, const QString &payload, const QString &outputKml) const
Definition: tools/osm-addresses/OsmParser.cpp:702
Marble::Way
Definition: tools/osm-addresses/OsmParser.h:79
Marble::OsmRegion::geometry
const GeoDataPolygon & geometry() const
Definition: OsmRegion.cpp:102
Marble::OsmRegion::setName
void setName(const QString &name)
Definition: OsmRegion.cpp:52
Marble::OsmPlacemark::AccomodationHostel
Definition: OsmPlacemark.h:30
Marble::OsmPlacemark
A lightweight data structure to represent points of interest like addresses with support for serializ...
Definition: OsmPlacemark.h:24
Marble::GeoDataColorStyle::setColor
void setColor(const QColor &value)
Set a new color.
Definition: GeoDataColorStyle.cpp:73
Marble::OsmParser::read
void read(const QFileInfo &file, const QString &areaName)
Definition: tools/osm-addresses/OsmParser.cpp:218
Marble::OsmPlacemark::setCategory
void setCategory(OsmCategory category)
Definition: OsmPlacemark.cpp:28
Marble::Element::houseNumber
QString houseNumber
Definition: tools/osm-addresses/OsmParser.h:56
GeoDataStyle.h
Marble::Node::lon
float lon
Definition: tools/osm-addresses/OsmParser.h:72
Marble::OsmRegionTree
Definition: OsmRegionTree.h:21
Marble::OsmOsmRegion::region
OsmRegion region
Definition: tools/osm-addresses/OsmParser.h:47
Marble::Writer
Definition: Writer.h:22
Marble::OsmPlacemark::TransportTramStop
Definition: OsmPlacemark.h:75
Marble::OsmPlacemark::MoneyAtm
Definition: OsmPlacemark.h:48
Marble::GeoDataStyleMap
a class to map different styles to one style
Definition: GeoDataStyleMap.h:38
GeoDataExtendedData.h
Marble::GeoDataCoordinates::latitude
qreal latitude(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
retrieves the latitude of the GeoDataCoordinates object use the unit parameter to switch between Radi...
Definition: GeoDataCoordinates.cpp:751
Marble::OsmPlacemark::TransportSpeedCamera
Definition: OsmPlacemark.h:72
QObject
GeoDataLineStyle.h
Marble::Outer
Definition: tools/osm-addresses/OsmParser.h:41
Marble::OsmPlacemark::FoodBar
Definition: OsmPlacemark.h:39
Marble::GeoDataCoordinates::Degree
Definition: GeoDataCoordinates.h:66
Marble::OsmRegion::setAdminLevel
void setAdminLevel(int level)
Definition: OsmRegion.cpp:117
Marble::Oxygen::hotOrange4
QColor const hotOrange4
Definition: MarbleColors.h:86
Marble::Coordinate::lat
float lat
Definition: tools/osm-addresses/OsmParser.h:66
GeoWriter.h
Marble::OsmPlacemark::setName
void setName(const QString &name)
Definition: OsmPlacemark.cpp:38
Marble::moreImportantAdminArea
bool moreImportantAdminArea(const OsmRegion &a, const OsmRegion b)
Definition: tools/osm-addresses/OsmParser.cpp:60
Coordinate
Represents a coordinate with the properties of a name and coordinates.
Definition: Coordinate.h:28
Marble::OsmParser::m_relations
QHash< int, Relation > m_relations
Definition: tools/osm-addresses/OsmParser.h:173
Marble::OsmPlacemark::TransportAirportTerminal
Definition: OsmPlacemark.h:64
Marble::OsmPlacemark::TouristCinema
Definition: OsmPlacemark.h:55
GeoDataMultiGeometry.h
Marble::GeoDataStyle
an addressable style group
Definition: GeoDataStyle.h:55
Marble::OsmPlacemark::TransportRentalCar
Definition: OsmPlacemark.h:71
Marble::OsmPlacemark::setLatitude
void setLatitude(qreal latitude)
Definition: OsmPlacemark.cpp:88
Marble::OsmPlacemark::TransportTrainStation
Definition: OsmPlacemark.h:74
GeoDataFeature.h
Marble::GeoDataPolygon::latLonAltBox
virtual const GeoDataLatLonAltBox & latLonAltBox() const
Returns the smallest latLonAltBox that contains the Polygon.
Definition: GeoDataPolygon.cpp:80
Marble::OsmPlacemark::TouristCastle
Definition: OsmPlacemark.h:54
Marble::OsmPlacemark::AccomodationMotel
Definition: OsmPlacemark.h:32
Marble::OsmPlacemark::AmenityLibrary
Definition: OsmPlacemark.h:35
OsmParser.h
Marble::OsmPlacemark::setRegionId
void setRegionId(int id)
Definition: OsmPlacemark.cpp:58
Marble::GeoDataFeature::setName
void setName(const QString &value)
Set a new name for this feature.
Definition: GeoDataFeature.cpp:485
Marble::Oxygen::aluminumGray4
QColor const aluminumGray4
Definition: MarbleColors.h:92
OsmRegionTree.h
Marble::OsmRegion::setLatitude
void setLatitude(qreal latitude)
Definition: OsmRegion.cpp:72
Marble::OsmPlacemark::FoodFastFood
Definition: OsmPlacemark.h:42
Marble::OsmPlacemark::AccomodationHotel
Definition: OsmPlacemark.h:31
Marble::OsmPlacemark::ShoppingBeverages
Definition: OsmPlacemark.h:50
Marble::GeoDataLineStyle::setWidth
void setWidth(const float &width)
Set the width of the line.
Definition: GeoDataLineStyle.cpp:76
Marble::GeoWriter
Standard Marble way of writing XML This class is intended to be a standardised way of writing XML for...
Definition: GeoWriter.h:28
GeoDataLineString.h
Marble::OsmPlacemark::UnknownCategory
Definition: OsmPlacemark.h:28
Marble::Oxygen::sunYellow6
QColor const sunYellow6
Definition: MarbleColors.h:78
Marble::OsmPlacemark::HealthPharmacy
Definition: OsmPlacemark.h:47
Marble::OsmPlacemark::FoodRestaurant
Definition: OsmPlacemark.h:44
Marble::OsmRegion::name
QString name() const
Definition: OsmRegion.cpp:47
Marble::Element::street
QString street
Definition: tools/osm-addresses/OsmParser.h:55
Marble::Node
Definition: tools/osm-addresses/OsmParser.h:71
Marble::OsmPlacemark::MoneyBank
Definition: OsmPlacemark.h:49
Marble::GeoDataDocument::addStyle
void addStyle(const GeoDataStyle &style)
Add a style to the style storage.
Definition: GeoDataDocument.cpp:110
Marble::Oxygen::seaBlue2
QColor const seaBlue2
Definition: MarbleColors.h:64
Marble::OsmPlacemark::TouristViewPoint
Definition: OsmPlacemark.h:61
Marble::Oxygen::skyBlue4
QColor const skyBlue4
Definition: MarbleColors.h:56
Marble::OsmPlacemark::TouristMonument
Definition: OsmPlacemark.h:56
Marble::OsmPlacemark::HealthHospital
Definition: OsmPlacemark.h:46
Marble::OsmParser::OsmParser
OsmParser()
Definition: src/plugins/runner/osm/OsmParser.cpp:21
GeoDataPlacemark.h
Marble::Element
Definition: tools/osm-addresses/OsmParser.h:52
Marble::OsmPlacemark::latitude
qreal latitude() const
Latitude of the placemark's center point, in degree.
Definition: OsmPlacemark.cpp:83
Marble::OsmPlacemark::name
QString name() const
Placemark name.
Definition: OsmPlacemark.cpp:33
Marble::GeoDataPolygon::outerBoundary
GeoDataLinearRing & outerBoundary()
Returns the outer boundary that is represented as a LinearRing.
Definition: GeoDataPolygon.cpp:85
GeoDataStyleMap.h
Marble::GeoDataContainer::append
void append(GeoDataFeature *other)
add an element
Definition: GeoDataContainer.cpp:165
Marble::OsmPlacemark::HealthDoctors
Definition: OsmPlacemark.h:45
Marble::GeoDataLatLonBox::center
virtual GeoDataCoordinates center() const
returns the center of this box
Definition: GeoDataLatLonBox.cpp:276
Marble::OsmParser::shouldSave
bool shouldSave(ElementType type, const QString &key, const QString &value)
Definition: tools/osm-addresses/OsmParser.cpp:554
Marble::GeoDataFeature::setStyleUrl
void setStyleUrl(const QString &value)
Set the styleUrl of this feature to value.
Definition: GeoDataFeature.cpp:556
Marble::GeoDataMultiGeometry::append
void append(GeoDataGeometry *other)
add an element
Definition: GeoDataMultiGeometry.cpp:182
Marble::GeoDataCoordinates::longitude
qreal longitude(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
retrieves the longitude of the GeoDataCoordinates object use the unit parameter to switch between Rad...
Definition: GeoDataCoordinates.cpp:739
Marble::GeoDataLatLonAltBox::center
virtual GeoDataCoordinates center() const
returns the center of this box
Definition: GeoDataLatLonAltBox.cpp:152
Marble::GeoWriter::setDocumentType
void setDocumentType(const QString &documentType)
Set the current document type.
Definition: GeoWriter.cpp:79
Marble::OsmPlacemark::EducationCollege
Definition: OsmPlacemark.h:36
GeoDataLinearRing.h
Marble::Statistic::uselessWays
unsigned int uselessWays
Definition: tools/osm-addresses/OsmParser.h:141
Marble::OsmParser::m_ways
QHash< int, Way > m_ways
Definition: tools/osm-addresses/OsmParser.h:171
Marble::OsmPlacemark::setLongitude
void setLongitude(qreal longitude)
Definition: OsmPlacemark.cpp:78
Marble::OsmPlacemark::TransportBusStop
Definition: OsmPlacemark.h:66
Marble::OsmPlacemark::TransportTaxiRank
Definition: OsmPlacemark.h:73
Marble::OsmPlacemark::FoodCafe
Definition: OsmPlacemark.h:41
Marble::OsmPlacemark::FoodPub
Definition: OsmPlacemark.h:43
Marble::OsmPlacemark::TouristMuseum
Definition: OsmPlacemark.h:57
GeoDataFolder.h
Marble::GeoDataStyle::setLineStyle
void setLineStyle(const GeoDataLineStyle &style)
set the line style
Definition: GeoDataStyle.cpp:88
Marble::Oxygen::brickRed4
QColor const brickRed4
Definition: MarbleColors.h:32
Marble::OsmPlacemark::TouristZoo
Definition: OsmPlacemark.h:62
Marble::OsmOsmRegion
Definition: tools/osm-addresses/OsmParser.h:45
Marble::OsmPlacemark::longitude
qreal longitude() const
Longitude of the placemark's center point, in degree.
Definition: OsmPlacemark.cpp:73
Marble::GeoDataData
Definition: GeoDataData.h:26
Marble::Node::lat
float lat
Definition: tools/osm-addresses/OsmParser.h:73
Marble::OsmPlacemark::TransportRentalBicycle
Definition: OsmPlacemark.h:70
Marble::OsmParser::parse
virtual bool parse(const QFileInfo &file, int pass, bool &needAnotherPass)=0
direction
qreal direction
Definition: tools/osm-addresses/OsmParser.cpp:39
Marble::GeoDataLineString::isEmpty
bool isEmpty() const
Returns whether the LineString has no nodes at all.
Definition: GeoDataLineString.cpp:129
Marble::GeoDataExtendedData::addValue
void addValue(const GeoDataData &data)
add a data object to the GeoDataExtendedData with the key
Definition: GeoDataExtendedData.cpp:59
Marble::Way::setPosition
void setPosition(const QHash< int, Coordinate > &database, OsmPlacemark &placemark) const
Definition: tools/osm-addresses/OsmParser.cpp:150
Marble::OsmPlacemark::TransportFuel
Definition: OsmPlacemark.h:68
Marble::OsmPlacemark::TransportCarShare
Definition: OsmPlacemark.h:67
Marble::OsmParser::m_nodes
QHash< int, Node > m_nodes
Definition: tools/osm-addresses/OsmParser.h:169
Marble::OsmPlacemark::ShoppingHifi
Definition: OsmPlacemark.h:51
Marble::OsmPlacemark::AccomodationCamping
Definition: OsmPlacemark.h:29
Marble::Coordinate
Definition: tools/osm-addresses/OsmParser.h:64
Marble::OsmPlacemark::ShoppingSupermarket
Definition: OsmPlacemark.h:52
Marble::Element::name
QString name
Definition: tools/osm-addresses/OsmParser.h:54
Marble::Inner
Definition: tools/osm-addresses/OsmParser.h:42
Marble::Oxygen::forestGreen4
QColor const forestGreen4
Definition: MarbleColors.h:74
Marble::OsmRegion::adminLevel
int adminLevel() const
Definition: OsmRegion.cpp:112
Marble::GeoDataMultiGeometry
Definition: GeoDataMultiGeometry.h:33
Marble::OsmRegion::identifier
int identifier() const
Unique (per process) region identifier.
Definition: OsmRegion.cpp:27
Marble::OsmRegion::setIdentifier
void setIdentifier(int identifier)
Identifier change.
Definition: OsmRegion.cpp:32
Marble::OsmPlacemark::setHouseNumber
void setHouseNumber(const QString &houseNumber)
Definition: OsmPlacemark.cpp:48
Marble::GeoDataStyleSelector::styleId
QString styleId() const
Return the style id.
Definition: GeoDataStyleSelector.cpp:65
Marble::Writer::addOsmPlacemark
virtual void addOsmPlacemark(const OsmPlacemark &placemark)=0
Marble::GeoWriter::write
bool write(QIODevice *device, const GeoNode *feature)
The main API call to use the XML writer.
Definition: GeoWriter.cpp:28
Marble::OsmPlacemark::TransportBusStation
Definition: OsmPlacemark.h:65
Marble::GeoDataFeature::extendedData
GeoDataExtendedData & extendedData() const
Return the ExtendedData assigned to the feature.
Definition: GeoDataFeature.cpp:653
Marble::OsmParser::addWriter
void addWriter(Writer *writer)
Definition: tools/osm-addresses/OsmParser.cpp:117
Marble::OsmPlacemark::TransportParking
Definition: OsmPlacemark.h:69
Marble::Element::city
QString city
Definition: tools/osm-addresses/OsmParser.h:57
Marble::Element::category
OsmPlacemark::OsmCategory category
Definition: tools/osm-addresses/OsmParser.h:58
Marble::Oxygen::woodBrown4
QColor const woodBrown4
Definition: MarbleColors.h:26
Marble::OsmPlacemark::TouristThemePark
Definition: OsmPlacemark.h:60
Marble::GeoDataPlacemark
a class representing a point of interest on the map
Definition: GeoDataPlacemark.h:54
Marble::OsmPlacemark::TouristAttraction
Definition: OsmPlacemark.h:53
Marble::OsmPlacemark::FoodBiergarten
Definition: OsmPlacemark.h:40
Marble::GeoDataLineString::latLonAltBox
virtual const GeoDataLatLonAltBox & latLonAltBox() const
Returns the smallest latLonAltBox that contains the LineString.
Definition: GeoDataLineString.cpp:545
Marble::OsmPlacemark::PlacesRegion
Definition: OsmPlacemark.h:76
Marble::Element::save
bool save
Definition: tools/osm-addresses/OsmParser.h:53
Marble::Way::setRegion
void setRegion(const QHash< int, Node > &database, const OsmRegionTree &tree, QList< OsmOsmRegion > &osmOsmRegions, OsmPlacemark &placemark) const
Definition: tools/osm-addresses/OsmParser.cpp:181
Marble::GeoDataLatLonBox
A class that defines a 2D bounding box for geographic data.
Definition: GeoDataLatLonBox.h:51
coordinate
Coordinate coordinate
Definition: tools/osm-addresses/OsmParser.cpp:38
Marble::OsmPlacemark::EducationSchool
Definition: OsmPlacemark.h:37
Marble::GeoDataPlacemark::setGeometry
void setGeometry(GeoDataGeometry *entry)
Sets the current Geometry of this Placemark.
Definition: GeoDataPlacemark.cpp:136
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:52 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal