FastTileDatabase
轻量级高性能瓦片地图数据库
Loading...
Searching...
No Matches
MeFTDExtent.h
Go to the documentation of this file.
1#ifndef MEFTDEXTENT_H__
2#define MEFTDEXTENT_H__
3#include "MeFTDTileKey.h"
4#include <algorithm>
5
6namespace MapEdges
7{
13 {
14 MeFTDExtent() = default;
15
16 MeFTDExtent(double dminX, double dMinY, double dMaxX, double dMaxY)
17 : MinX(dminX)
18 , MinY(dMinY)
19 , MaxX(dMaxX)
20 , MaxY(dMaxY) {}
21
22 double MinX = 0.0;
23
24 double MinY = 0.0;
25
26 double MaxX = 0.0;
27
28 double MaxY = 0.0;
29
30 bool isValid() const { return MaxX > MinX && MaxY > MinY; }
31 };
32
40 {
42
44
45 bool operator==(const MeFTDTileExtent& other) const {
46 return TopLeft == other.TopLeft &&
47 BottomRight == other.BottomRight;
48 }
49
55 bool isValid() const { return (TopLeft.isValid() && BottomRight.isValid()); }
56
62 int width() const { return isValid() ? (BottomRight.x() - TopLeft.x() + 1) : 0; }
63
69 int height() const { return isValid() ? (std::abs(BottomRight.y() - TopLeft.y()) + 1) : 0; }
70
76 long long count() const { return width() * height(); }
77
78 MeFTDTileExtent() = default;
79 };
80}
81
82
83#endif
T y() const
返回坐标点的 Y
Definition: MeFTDPoint2D.h:71
T x() const
返回坐标点的 X
Definition: MeFTDPoint2D.h:64
瓦片坐标。
Definition: MeFTDTileKey.h:25
Fast Tile Database 简称(FTD)是一个轻量级的瓦片数据本地持久化存储数据库,它的出现主要
Definition: MeFTD.h:32
定义一个矩形范围。
Definition: MeFTDExtent.h:13
double MinX
Definition: MeFTDExtent.h:22
bool isValid() const
Definition: MeFTDExtent.h:30
double MaxY
Definition: MeFTDExtent.h:28
double MinY
Definition: MeFTDExtent.h:24
double MaxX
Definition: MeFTDExtent.h:26
MeFTDExtent(double dminX, double dMinY, double dMaxX, double dMaxY)
Definition: MeFTDExtent.h:16
瓦片坐标范围,在FTD中瓦片坐标永远定义为从 0 开始
Definition: MeFTDExtent.h:40
int height() const
返回瓦片坐标范围纵向瓦片数量
Definition: MeFTDExtent.h:69
long long count() const
返回瓦片总量
Definition: MeFTDExtent.h:76
bool isValid() const
返回瓦片坐标范是否有效
Definition: MeFTDExtent.h:55
MeFTDTileKey TopLeft
Definition: MeFTDExtent.h:41
bool operator==(const MeFTDTileExtent &other) const
Definition: MeFTDExtent.h:45
MeFTDTileKey BottomRight
Definition: MeFTDExtent.h:43
int width() const
返回瓦片坐标范围横向瓦片数量
Definition: MeFTDExtent.h:62