Advertisement
Guest User

Untitled

a guest
Sep 21st, 2011
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.67 KB | None | 0 0
  1.  
  2. #ifndef OSMIUMHANDLERGRIDWRITER_H
  3. #define OSMIUMHANDLERGRIDWRITER_H
  4.  
  5. // Osmium Includes
  6. #include <osmium.hpp>
  7.  
  8. // Qt Includes
  9. #include <QStringList>
  10. #include <QString>
  11. #include <QDebug>
  12. #include <QMap>
  13.  
  14. struct BoundingBox
  15. {
  16.     double minLat;
  17.     double maxLat;
  18.     double minLon;
  19.     double maxLon;
  20. };
  21.  
  22. namespace Osmium
  23. {
  24.     namespace Handler
  25.     {
  26.         class OsmiumHandlerGridWriter : public Base
  27.         {
  28.             struct NodeSchema
  29.             {
  30.                 QString sStreetName;
  31.                 int sStreetAddr;
  32.                 double sLon;
  33.                 double sLat;
  34.             };
  35.  
  36.         public:
  37.             OsmiumHandlerGridWriter(QString);
  38.             ~OsmiumHandlerGridWriter();
  39.             void init(Osmium::OSM::Meta&);
  40.             void before_nodes();
  41.             void node(Osmium::OSM::Node*);
  42.             void after_nodes();
  43.             void before_ways();
  44.             void way(Osmium::OSM::Way*);
  45.             void after_ways();
  46.             void before_relations();
  47.             void relation(Osmium::OSM::Relation*);
  48.             void after_relations();
  49.             void area(Osmium::OSM::Area*);
  50.             void final();
  51.  
  52.         private:
  53.             QMap<qint64,NodeSchema> m_nodeMap;
  54.             QList<Osmium::OSMFile*> m_fileList;
  55.             QList<Osmium::Output::Base*> m_outputList;
  56.             BoundingBox m_bbox;
  57.             double m_midLat;
  58.             double m_midLon;
  59.             bool m_addNodeInfoToWayTags;
  60.             QString m_filePath;
  61.             QString m_parentQuadKey;
  62.             qint64 m_nodeCount;
  63.             qint64 m_wayCount;
  64.         };
  65.     }
  66. }
  67.  
  68. #endif  // OSMIUMHANDLERGRIDWRITER_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement