@@ -16,6 +16,7 @@ def test_minimal_global(minimal_global_raw_cfg, minimal_dc):
16
16
assert cfg .ready
17
17
assert cfg .initialised
18
18
assert not cfg .wcs_tiff_statistics
19
+ assert cfg .default_geographic_CRS == "" # No WCS
19
20
20
21
21
22
def test_global_no_title (minimal_global_raw_cfg ):
@@ -41,6 +42,42 @@ def test_wcs_only(minimal_global_raw_cfg, wcs_global_cfg, minimal_dc):
41
42
assert not cfg .wms
42
43
assert not cfg .wmts
43
44
assert cfg .wcs_tiff_statistics
45
+ assert cfg .default_geographic_CRS == "urn:ogc:def:crs:OGC:1.3:CRS84"
46
+
47
+ def test_geog_crs (minimal_global_raw_cfg , wcs_global_cfg , minimal_dc ):
48
+ OWSConfig ._instance = None
49
+ minimal_global_raw_cfg ["global" ]["services" ] = {
50
+ "wcs" : True ,
51
+ "wms" : False ,
52
+ "wmts" : False ,
53
+ }
54
+ minimal_global_raw_cfg ["wcs" ] = wcs_global_cfg
55
+ minimal_global_raw_cfg ["global" ]["published_CRSs" ] = {
56
+ "EPSG:3857" : { # Web Mercator
57
+ "geographic" : False ,
58
+ "horizontal_coord" : "x" ,
59
+ "vertical_coord" : "y" ,
60
+ },
61
+ }
62
+ with pytest .raises (ConfigException ) as e :
63
+ cfg = OWSConfig (cfg = minimal_global_raw_cfg )
64
+ assert "At least one geographic CRS must be supplied" in str (e .value )
65
+ OWSConfig ._instance = None
66
+ minimal_global_raw_cfg ["global" ]["published_CRSs" ] = {
67
+ "EPSG:3857" : { # Web Mercator
68
+ "geographic" : False ,
69
+ "horizontal_coord" : "x" ,
70
+ "vertical_coord" : "y" ,
71
+ },
72
+ "EPSG:99899" : { # Made up
73
+ "geographic" : True ,
74
+ "horizontal_coord" : "longitude" ,
75
+ "vertical_coord" : "latitude" ,
76
+ },
77
+ }
78
+ cfg = OWSConfig (cfg = minimal_global_raw_cfg )
79
+ cfg .make_ready (minimal_dc )
80
+ assert cfg .default_geographic_CRS == "EPSG:99899"
44
81
45
82
46
83
def test_contact_details_parse (minimal_global_cfg ):
0 commit comments