File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
main/groovy/geoscript/proj
test/groovy/geoscript/proj Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,14 @@ class Projection {
70
70
return CRS . lookupIdentifier(crs, true )
71
71
}
72
72
73
+ /**
74
+ * Get the EPSG code
75
+ * @return The EPSG code
76
+ */
77
+ int getEpsg () {
78
+ CRS . lookupEpsgCode(crs, true )
79
+ }
80
+
73
81
/**
74
82
* Get the well known text
75
83
* @return The well known texts
Original file line number Diff line number Diff line change @@ -32,6 +32,15 @@ class ProjectionTestCase {
32
32
assertEquals " EPSG:2927" , p1. id
33
33
}
34
34
35
+ @Test void getEpsg () {
36
+ Projection p = new Projection (" EPSG:2927" )
37
+ assertEquals 2927 , p. epsg
38
+ p = new Projection (" EPSG:4326" )
39
+ assertEquals 4326 , p. epsg
40
+ p = new Projection (" EPSG:3857" )
41
+ assertEquals 3857 , p. epsg
42
+ }
43
+
35
44
@Test void getWkt () {
36
45
Projection p1 = new Projection (" EPSG:4326" )
37
46
You can’t perform that action at this time.
0 commit comments