libosmscout
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
libosmscout-import
include
osmscoutimport
ShapeFileScanner.h
Go to the documentation of this file.
1
#ifndef OSMSCOUT_IMPORT_SHAPEFILESCANNER_H
2
#define OSMSCOUT_IMPORT_SHAPEFILESCANNER_H
3
4
/*
5
This source is part of the libosmscout library
6
Copyright (C) 2017 Tim Teulings
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 <cstdio>
24
#include <string>
25
#include <vector>
26
27
#include <
osmscoutimport/ImportImportExport.h
>
28
29
#include <
osmscout/util/GeoBox.h
>
30
31
#include <
osmscout/system/Compiler.h
>
32
33
namespace
osmscout
{
34
41
class
OSMSCOUT_IMPORT_API
ShapeFileVisitor
42
{
43
public
:
44
virtual
~ShapeFileVisitor
() =
default
;
45
virtual
void
OnFileBoundingBox
(
const
GeoBox& boundingBox);
46
virtual
void
OnProgress
(
double
current,
double
total);
47
virtual
void
OnPolyline
(int32_t recordNumber,
48
const
GeoBox& boundingBox,
49
const
std::vector<GeoCoord>& coords);
50
};
51
59
class
OSMSCOUT_IMPORT_API
ShapeFileScanner
CLASS_FINAL
60
{
61
private
:
62
std::string filename;
63
FILE *file;
64
std::vector<GeoCoord> buffer;
65
66
private
:
67
uint8_t ReadByte();
68
int32_t ReadIntegerBE();
69
int32_t ReadIntegerLE();
70
double
ReadDoubleLE();
71
72
public
:
73
explicit
ShapeFileScanner
(
const
std::string& filename);
74
~ShapeFileScanner
();
75
76
void
Open
();
77
void
Close
();
78
79
void
Visit
(
ShapeFileVisitor
& visitor);
80
};
81
}
82
83
#endif
Compiler.h
GeoBox.h
ImportImportExport.h
OSMSCOUT_IMPORT_API
#define OSMSCOUT_IMPORT_API
Definition
ImportImportExport.h:45
osmscout::CLASS_FINAL
Definition
Area.h:88
osmscout::CLASS_FINAL::Visit
void Visit(ShapeFileVisitor &visitor)
osmscout::CLASS_FINAL::~ShapeFileScanner
~ShapeFileScanner()
osmscout::CLASS_FINAL::ShapeFileScanner
ShapeFileScanner(const std::string &filename)
osmscout::CLASS_FINAL::Open
void Open()
osmscout::CLASS_FINAL::Close
void Close()
osmscout::ShapeFileVisitor
Definition
ShapeFileScanner.h:42
osmscout::ShapeFileVisitor::OnPolyline
virtual void OnPolyline(int32_t recordNumber, const GeoBox &boundingBox, const std::vector< GeoCoord > &coords)
osmscout::ShapeFileVisitor::~ShapeFileVisitor
virtual ~ShapeFileVisitor()=default
osmscout::ShapeFileVisitor::OnProgress
virtual void OnProgress(double current, double total)
osmscout::ShapeFileVisitor::OnFileBoundingBox
virtual void OnFileBoundingBox(const GeoBox &boundingBox)
osmscout
Definition
Area.h:39
Generated by
1.17.0