本文整理汇总了C++中GeoBounds::GetEast方法的典型用法代码示例。如果您正苦于以下问题:C++ GeoBounds::GetEast方法的具体用法?C++ GeoBounds::GetEast怎么用?C++ GeoBounds::GetEast使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeoBounds
的用法示例。
在下文中一共展示了GeoBounds::GetEast方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char **argv)
{
Args args(argc, argv, "PATH");
const char *map_path = args.ExpectNext();
args.ExpectEnd();
char jp2_path[4096];
strcpy(jp2_path, map_path);
strcat(jp2_path, DIR_SEPARATOR_S "terrain.jp2");
TCHAR j2w_path[4096];
_tcscpy(j2w_path, PathName(map_path));
_tcscat(j2w_path, _T(DIR_SEPARATOR_S) _T("terrain.j2w"));
NullOperationEnvironment operation;
RasterTileCache rtc;
if (!rtc.LoadOverview(jp2_path, j2w_path, operation)) {
fprintf(stderr, "LoadOverview failed\n");
return EXIT_FAILURE;
}
GeoBounds bounds = rtc.GetBounds();
printf("bounds = %f|%f - %f|%f\n",
(double)bounds.GetWest().Degrees(),
(double)bounds.GetNorth().Degrees(),
(double)bounds.GetEast().Degrees(),
(double)bounds.GetSouth().Degrees());
do {
rtc.UpdateTiles(jp2_path, rtc.GetWidth() / 2, rtc.GetHeight() / 2,
1000);
} while (rtc.IsDirty());
return EXIT_SUCCESS;
}
示例2:
gcc_pure
static inline rectObj
ConvertRect(const GeoBounds &br)
{
rectObj dest;
dest.minx = (double)br.GetWest().Degrees();
dest.maxx = (double)br.GetEast().Degrees();
dest.miny = (double)br.GetSouth().Degrees();
dest.maxy = (double)br.GetNorth().Degrees();
return dest;
}
示例3: main
int main(int argc, char **argv)
{
Args args(argc, argv, "PATH");
const auto map_path = args.ExpectNext();
args.ExpectEnd();
ZZIP_DIR *dir = zzip_dir_open(map_path, nullptr);
if (dir == nullptr) {
fprintf(stderr, "Failed to open %s\n", map_path);
return EXIT_FAILURE;
}
NullOperationEnvironment operation;
RasterTileCache rtc;
if (!LoadTerrainOverview(dir, rtc, operation)) {
fprintf(stderr, "LoadOverview failed\n");
zzip_dir_close(dir);
return EXIT_FAILURE;
}
GeoBounds bounds = rtc.GetBounds();
printf("bounds = %f|%f - %f|%f\n",
(double)bounds.GetWest().Degrees(),
(double)bounds.GetNorth().Degrees(),
(double)bounds.GetEast().Degrees(),
(double)bounds.GetSouth().Degrees());
SharedMutex mutex;
do {
UpdateTerrainTiles(dir, rtc, mutex,
rtc.GetWidth() / 2, rtc.GetHeight() / 2, 1000);
} while (rtc.IsDirty());
zzip_dir_close(dir);
return EXIT_SUCCESS;
}
示例4: main
int main(int argc, char **argv)
{
plan_tests(38);
GeoPoint g(Angle::Degrees(2), Angle::Degrees(4));
GeoBounds b(g);
ok1(equals(b.GetEast(), 2));
ok1(equals(b.GetWest(), 2));
ok1(equals(b.GetNorth(), 4));
ok1(equals(b.GetSouth(), 4));
ok1(b.IsEmpty());
g.latitude = Angle::Degrees(6);
g.longitude = Angle::Degrees(8);
b.Extend(g);
ok1(equals(b.GetEast(), 8));
ok1(equals(b.GetWest(), 2));
ok1(equals(b.GetNorth(), 6));
ok1(equals(b.GetSouth(), 4));
ok1(!b.IsEmpty());
g = b.GetCenter();
ok1(equals(g.latitude, 5));
ok1(equals(g.longitude, 5));
ok1(b.IsInside(Angle::Degrees(7), Angle::Degrees(4.5)));
ok1(!b.IsInside(Angle::Degrees(9), Angle::Degrees(4.5)));
ok1(!b.IsInside(Angle::Degrees(7), Angle::Degrees(1)));
ok1(!b.IsInside(Angle::Degrees(9), Angle::Degrees(1)));
b = b.Scale(2);
ok1(equals(b.GetEast(), 11));
ok1(equals(b.GetWest(), -1));
ok1(equals(b.GetNorth(), 7));
ok1(equals(b.GetSouth(), 3));
b = b.Scale(0.5);
ok1(equals(b.GetEast(), 8));
ok1(equals(b.GetWest(), 2));
ok1(equals(b.GetNorth(), 6));
ok1(equals(b.GetSouth(), 4));
GeoBounds c = MakeGeoBounds(2, 6, 8, 4);
ok1(c.Overlaps(b));
ok1(c.IntersectWith(b));
ok1(equals(c.GetWest(), 2));
ok1(equals(c.GetNorth(), 6));
ok1(equals(c.GetEast(), 8));
ok1(equals(c.GetSouth(), 4));
GeoBounds d = MakeGeoBounds(2, 6, 7, 5);
ok1(c.Overlaps(d));
ok1(c.IntersectWith(d));
ok1(equals(c.GetWest(), 2));
ok1(equals(c.GetNorth(), 6));
ok1(equals(c.GetEast(), 7));
ok1(equals(c.GetSouth(), 5));
d = MakeGeoBounds(8, 6, 1, 5);
ok1(!c.Overlaps(d));
ok1(!c.IntersectWith(d));
return exit_status();
}