libosmscout
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
libosmscout
include
osmscout
db
CoverageIndex.h
Go to the documentation of this file.
1
#ifndef OSMSCOUT_COVERAGEINDEX_H
2
#define OSMSCOUT_COVERAGEINDEX_H
3
4
/*
5
This source is part of the libosmscout library
6
Copyright (C) 2018 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 <memory>
24
#include <mutex>
25
#include <vector>
26
27
#include <
osmscout/Pixel.h
>
28
29
#include <
osmscout/io/FileScanner.h
>
30
31
namespace
osmscout
{
32
40
class
OSMSCOUT_API
CoverageIndex
41
{
42
public
:
43
static
const
char
*
const
COVERAGE_IDX
;
44
45
private
:
46
std::string datafilename;
47
mutable
FileScanner scanner;
48
49
uint32_t cellLevel;
50
double
cellWidth;
51
double
cellHeight;
52
Pixel minCell;
53
Pixel maxCell;
54
uint32_t width;
55
uint32_t height;
56
std::vector<uint8_t> bitmap;
57
58
public
:
59
CoverageIndex
() =
default
;
60
61
void
Close
();
62
bool
Open
(
const
std::string& path);
63
64
inline
bool
IsOpen
()
const
65
{
66
return
scanner.IsOpen();
67
}
68
69
Pixel
GetTile
(
const
GeoCoord& coord)
const
;
70
bool
IsCovered
(
const
Pixel& tile)
const
;
71
72
bool
IsCovered
(
const
GeoCoord& coord)
const
;
73
};
74
75
using
CoverageIndexRef
= std::shared_ptr<CoverageIndex>;
76
}
77
78
#endif
OSMSCOUT_API
#define OSMSCOUT_API
Definition
CoreImportExport.h:45
FileScanner.h
Pixel.h
osmscout::CoverageIndex::Close
void Close()
osmscout::CoverageIndex::IsCovered
bool IsCovered(const Pixel &tile) const
osmscout::CoverageIndex::GetTile
Pixel GetTile(const GeoCoord &coord) const
osmscout::CoverageIndex::COVERAGE_IDX
static const char *const COVERAGE_IDX
Definition
CoverageIndex.h:43
osmscout::CoverageIndex::Open
bool Open(const std::string &path)
osmscout::CoverageIndex::IsOpen
bool IsOpen() const
Definition
CoverageIndex.h:64
osmscout::CoverageIndex::CoverageIndex
CoverageIndex()=default
osmscout::CoverageIndex::IsCovered
bool IsCovered(const GeoCoord &coord) const
osmscout
Definition
Area.h:39
osmscout::CoverageIndexRef
std::shared_ptr< CoverageIndex > CoverageIndexRef
Definition
CoverageIndex.h:75
Generated by
1.17.0