libosmscout  1.1.1
PreprocessPoly.h
Go to the documentation of this file.
1 #ifndef OSMSCOUT_IMPORT_PREPROCESS_POLY_H
2 #define OSMSCOUT_IMPORT_PREPROCESS_POLY_H
3 
4 /*
5  This source is part of the libosmscout library
6  Copyright (C) 2016 Lukas Karas
7 
8  This library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Lesser General Public
10  License as published by the Free Software Foundation; either
11  version 2.1 of the License, or (at your option) any later version.
12 
13  This library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public
19  License along with this library; if not, write to the Free Software
20  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22 
23 #include <osmscout/OSMScoutTypes.h>
24 
26 
28 
29 namespace osmscout {
30 
40  class PreprocessPoly CLASS_FINAL : public Preprocessor
41  {
42  private:
43  PreprocessorCallback& callback;
44 
45  enum Context
46  {
47  Root,
48  Section,
49  IncludedPolygon,
50  ExcludedPolygon
51  };
52 
53  struct Node
54  {
55  double x;
56  double y;
57  };
58 
59  bool ClosePolygon(Progress& progress,
60  Context context,
61  std::list<GeoCoord> &polygonNodes,
62  OSMId &availableId,
63  TagId polygonTagId);
64 
65  public:
66  explicit PreprocessPoly(PreprocessorCallback& callback);
67 
68  bool Import(const TypeConfigRef& typeConfig,
69  const ImportParameter& parameter,
70  Progress& progress,
71  const std::string& filename) override;
72  };
73 }
74 
75 #endif /* OSMSCOUT_IMPORT_PREPROCESS_POLY_H */
uint16_t TagId
Definition: Tag.h:39
int64_t OSMId
Definition: OSMScoutTypes.h:34
Definition: Area.h:38
#define CLASS_FINAL
Definition: Compiler.h:26
std::shared_ptr< TypeConfig > TypeConfigRef
Definition: TypeConfig.h:1227