Cogs.Core
WMSRasterSource.h
1#pragma once
2#include "HTTPRasterSource.h"
3
4namespace Cogs::Core::TerrainProvider {
5
6 enum struct WMSValueDataType
7 {
8 Short,
9 UnsignedSHort,
10 Float,
11 Double
12 };
13
14 enum struct WMSVersion
15 {
16 Unknown,
17 v1_0_0,
18 v1_1_0,
19 v1_1_1,
20 v1_3_0
21 };
22
24 {
25 StringRef name = NoString; // Required
26 StringRef style = Strings::add("default");
27 unsigned minLevel = 0;
28 unsigned maxLevel = ~0u;
29 std::vector<std::pair<StringRef, StringRef>> otherArguments;
30 };
31
33 {
34 virtual ~WMSConfig() {}
35
36 std::vector<WMSLayerDescription> layerDescriptions;
37 std::vector<std::pair<StringRef, StringRef>> otherArguments;
38
39 WMSVersion version = WMSVersion::v1_1_0;
40 WMSValueDataType dataType = WMSValueDataType::Short;
41 bool serverIsLittleEndian = true;
42 bool retryFailedRequests = true;
43 };
44
46 {
47 public:
48 WMSRasterSource(Context* context);
50
51 bool init(const WMSConfig& conf, std::unique_ptr<ICache>&& icache);
52 void getConfig(WMSConfig& conf) const;
53
54 protected:
55 std::vector<WMSLayerDescription> layerDescriptions;
56 std::vector<std::pair<StringRef, StringRef>> otherArguments;
57 WMSVersion version = WMSVersion::v1_1_0;
58 WMSValueDataType dataType = WMSValueDataType::Short;
59 bool serverIsLittleEndian = true;
60 bool retryFailedRequests = true;
61
62 bool createFetchTileUrl(std::string& url, TileId id) final;
63 };
64
65}
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition: Context.h:83