Ocean
TestBasemap.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef FACEBOOK_OCEAN_TEST_TESTIO_TESTMAPS_TEST_BASEMAP_H
9 #define FACEBOOK_OCEAN_TEST_TESTIO_TESTMAPS_TEST_BASEMAP_H
10 
12 
13 #include "ocean/io/maps/Basemap.h"
14 
15 namespace Ocean
16 {
17 
18 namespace Test
19 {
20 
21 namespace TestIO
22 {
23 
24 namespace TestMaps
25 {
26 
27 /**
28  * This class implements a test for the Basemap class.
29  * @ingroup testiomaps
30  */
31 class OCEAN_TEST_IO_MAPS_EXPORT TestBasemap
32 {
33  public:
34 
35  /**
36  * Tests all functions of the Basemap class.
37  * @param testDuration The number of seconds for each test
38  * @return True, if succeeded
39  */
40  static bool test(const double testDuration);
41 
42  /**
43  * Tests the newTileFromPBFData functions.
44  * @return True, if succeeded
45  */
46  static bool testTileFromPBFData();
47 
48  /**
49  * Tests whether the impoter does not read all features.
50  * @return True, if succeeded
51  */
52  static bool testMissingFeatures();
53 
54  protected:
55 
56  /**
57  * Applies an HTTP get request.
58  * @param url The URL of the request
59  * @param response The resulting response
60  * @return True, if succeeded
61  */
62  static bool httpRequest(const std::string& url, std::vector<uint8_t>& response);
63 
64  /**
65  * Gets the url for a specific tile.
66  * @param level The detail level, with range [1, 22]
67  * @param tileIndexPair The pair with tile indices, must be valid
68  * @param url The resulting url
69  */
70  static bool getTileUrl(unsigned int level, const IO::Maps::Basemap::TileIndexPair& tileIndexPair, std::string& url);
71 };
72 
73 }
74 
75 }
76 
77 }
78 
79 }
80 
81 #endif // FACEBOOK_OCEAN_TEST_TESTIO_TESTMAPS_TEST_BASEMAP_H
This class holds the tile indics in latitude and longitude direction.
Definition: Basemap.h:624
This class implements a test for the Basemap class.
Definition: TestBasemap.h:32
static bool testMissingFeatures()
Tests whether the impoter does not read all features.
static bool testTileFromPBFData()
Tests the newTileFromPBFData functions.
static bool test(const double testDuration)
Tests all functions of the Basemap class.
static bool httpRequest(const std::string &url, std::vector< uint8_t > &response)
Applies an HTTP get request.
static bool getTileUrl(unsigned int level, const IO::Maps::Basemap::TileIndexPair &tileIndexPair, std::string &url)
Gets the url for a specific tile.
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15