svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.expressionevaluator / org.gvsig.expressionevaluator.geometry / org.gvsig.expressionevaluator.geometry.lib / org.gvsig.expressionevaluator.geometry.lib.impl / src / main / java / org / gvsig / expressionevaluator / impl / ProjectionUtils.java @ 44644
History | View | Annotate | Download (739 Bytes)
1 | 44006 | jjdelcerro | package org.gvsig.expressionevaluator.impl; |
---|---|---|---|
2 | |||
3 | import org.cresques.cts.IProjection; |
||
4 | |||
5 | /**
|
||
6 | *
|
||
7 | * @author jjdelcerro
|
||
8 | */
|
||
9 | @SuppressWarnings("UseSpecificCatch") |
||
10 | public class ProjectionUtils { |
||
11 | |||
12 | public static int getCode(IProjection projection) { |
||
13 | if( projection==null ) { |
||
14 | return 0; |
||
15 | } |
||
16 | String[] x = projection.getAbrev().split(":"); |
||
17 | try {
|
||
18 | int code = Integer.parseInt(x[1]); |
||
19 | return code;
|
||
20 | } catch(Exception ex) { |
||
21 | return -1; |
||
22 | } |
||
23 | } |
||
24 | |||
25 | public static String getAuthority(IProjection projection) { |
||
26 | if( projection==null ) { |
||
27 | return null; |
||
28 | } |
||
29 | String[] x = projection.getAbrev().split(":"); |
||
30 | return x[0]; |
||
31 | } |
||
32 | } |