forked from freeeyes/geohash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmapinfo.h
44 lines (32 loc) · 996 Bytes
/
mapinfo.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef _MAPINFO_H
#define _MAPINFO_H
#include "HashTable.h"
#include "geohash.h"
#include "posinfopool.h"
#include "areainfopool.h"
#include <vector>
using namespace std;
//中国地图范围内的所有区域,按照500米的范围分割,并存入共享内存。
//add by freeeyes
#define GEO_PERSITION 12
class CMapInfo
{
public:
CMapInfo();
~CMapInfo();
void Init(char* pData);
void Load(char* pData);
bool AddPos(const char* pMsisdn, double dPosLatitude, double dPosLongitude, time_t ttPos);
bool FindPos(double dPosLatitude, double dPosLongitude, double dDistance, vector<_Pos_Info*>& vecPosList);
size_t GetSize(int nMaxCount);
private:
void prepareCryptTable();
private:
char* m_pCryptTable; //hash词典算法词
CHashTable m_objHashArea; //Hash区域地图
CHashTable m_objHashCurrPos; //Hash区域地图
int m_AreaCount; //所有的区域个数
CPosInfoPool m_objPosInfoList; //当前点对象池
CAreaInfoPool m_objAreaInfoList; //当前区域对象池
};
#endif