File tree Expand file tree Collapse file tree 3 files changed +22
-6
lines changed
Expand file tree Collapse file tree 3 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,13 @@ See also [`EPSG`](@ref), [`ESRI`](@ref).
1111"""
1212abstract type CRSCode end
1313
14+ """
15+ CoordRefSystems.integer(::Type{<:CRSCode})
16+
17+ Get the integer code associated with the `CRSCode` type.
18+ """
19+ function integer end
20+
1421"""
1522 EPSG{code}
1623
@@ -21,12 +28,7 @@ See [EPSG Geodetic Parameter Dataset](https://en.wikipedia.org/wiki/EPSG_Geodeti
2128"""
2229abstract type EPSG{Code} <: CRSCode end
2330
24- """
25- ESRI{code}
26-
27- ESRI dataset `code`. Codes can be searched at [epsg.io](https://epsg.io).
28- """
29- abstract type ESRI{Code} <: CRSCode end
31+ integer (:: Type{EPSG{Code}} ) where {Code} = Code
3032
3133function wkt2 (:: Type{EPSG{Code}} ) where {Code}
3234 epsg = joinpath (pkgdir (@__MODULE__ ), " artifacts" , " epsg-wkt2" )
@@ -50,6 +52,15 @@ function wkt2(::Type{EPSG{Code}}) where {Code}
5052 str
5153end
5254
55+ """
56+ ESRI{code}
57+
58+ ESRI dataset `code`. Codes can be searched at [epsg.io](https://epsg.io).
59+ """
60+ abstract type ESRI{Code} <: CRSCode end
61+
62+ integer (:: Type{ESRI{Code}} ) where {Code} = Code
63+
5364function wkt2 (:: Type{ESRI{Code}} ) where {Code}
5465 throw (ArgumentError ("""
5566 OGC WKT-CRS version 2 does not support ESRI:$Code .
Original file line number Diff line number Diff line change 1+ @testset " Codes" begin
2+ @test CoordRefSystems. integer (EPSG{4326 }) == 4326
3+ @test CoordRefSystems. integer (ESRI{102100 }) == 102100
4+ end
Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ testfiles = [
7171 " crs/traits.jl" ,
7272
7373 # EPSG/ESRI codes
74+ " codes.jl" ,
7475 " get.jl" ,
7576
7677 # WKT strings
You can’t perform that action at this time.
0 commit comments