Skip to content

Commit 75d0433

Browse files
🤖 Format .jl files (#166)
Co-authored-by: juliohm <[email protected]>
1 parent 25fcaf3 commit 75d0433

File tree

2 files changed

+58
-11
lines changed

2 files changed

+58
-11
lines changed

src/crsstrings.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,9 @@ end
136136
# Schema requires keys: "subtype" and "axis"
137137
function wkt2json_cs(wkt::Dict)
138138
geosubtype = rootkey(wkt)
139-
endswith(string(geosubtype), "CRS") || throw(ArgumentError("Expected base_crs key (such as GEOGCRS or PROJCRS), got $(geosubtype)"))
140-
139+
endswith(string(geosubtype), "CRS") ||
140+
throw(ArgumentError("Expected base_crs key (such as GEOGCRS or PROJCRS), got $(geosubtype)"))
141+
141142
jsondict = Dict{String,Any}()
142143
cstype = finditem(:CS, wkt[geosubtype])[:CS][1]
143144
jsondict["subtype"] = string(cstype)
@@ -259,15 +260,15 @@ function wkt2json_datum(wkt::Dict)
259260
else
260261
jsondict["type"] = "GeodeticReferenceFrame"
261262
end
262-
263+
263264
prime = finditem(:PRIMEM, wkt[geosubtype])
264265
if !isnothing(prime)
265266
jsondict["prime_meridian"] = Dict{String,Any}()
266267
jsondict["prime_meridian"]["name"] = prime[:PRIMEM][1]
267268
longitude = valueunit(prime[:PRIMEM][2], prime[:PRIMEM])
268269
jsondict["prime_meridian"]["longitude"] = longitude
269270
end
270-
271+
271272
jsondict
272273
end
273274

test/crsstrings.jl

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,71 @@
11
@testset "PROJJSON" begin
22
epsgcodes = [
33
# https://github.com/JuliaEarth/CoordRefSystems.jl/blob/10b3f944ece7d5c4669eed6dc163ae8d9761afcd/src/get.jl
4-
2157, 2193, 3035, 3310, 3395, 3857, 4171, 4207, 4208, 4230, 4231, 4267, 4269, 4274, 4275, 4277,
5-
4314, 4326, 4618, 4659, 4666, 4668, 4674, 4745, 4746, 4988, 4989, 5070, 5324, 5527, 8086, 8232,
6-
8237, 8240, 8246, 8249, 8252, 8255, 9777, 9782, 9988, 10176, 10414, 25832, 27700, 28355, 29903,
4+
2157,
5+
2193,
6+
3035,
7+
3310,
8+
3395,
9+
3857,
10+
4171,
11+
4207,
12+
4208,
13+
4230,
14+
4231,
15+
4267,
16+
4269,
17+
4274,
18+
4275,
19+
4277,
20+
4314,
21+
4326,
22+
4618,
23+
4659,
24+
4666,
25+
4668,
26+
4674,
27+
4745,
28+
4746,
29+
4988,
30+
4989,
31+
5070,
32+
5324,
33+
5527,
34+
8086,
35+
8232,
36+
8237,
37+
8240,
38+
8246,
39+
8249,
40+
8252,
41+
8255,
42+
9777,
43+
9782,
44+
9988,
45+
10176,
46+
10414,
47+
25832,
48+
27700,
49+
28355,
50+
29903,
751
# 32662, # deprecated in 2008, https://github.com/JuliaEarth/CoordRefSystems.jl/issues/262
8-
2180, 32600, 32700,
9-
52+
2180,
53+
32600,
54+
32700,
55+
1056
# CRS codes with WKT fields that do not occur in the prior codes.
1157
# These WKT fields are only relavent in special circumstances such
1258
# as when using custom measurment units.
1359
2986, # a PROJJSON with coordinate_system.axis[1].meridian
1460
3407, # a PROJJSON with non-standard units ("Clarke's foot") requires unit.conversion_factor
1561
31288, # a PROJJSON with base_crs.datum.prime_meridian
16-
62+
1763
# Additional codes the exhibit edge cases (EC) when comparing our output with GDAL.
1864
# These edge cases are documented and worked around in the deltaprojjson function.
1965
# In a way, these codes test our testing functions.
2066
2157, # EC#0
2167
4267, # EC#1
22-
22248, # EC#2
68+
22248 # EC#2
2369
]
2470

2571
# organize tests by CRS type for ease of debugging

0 commit comments

Comments
 (0)