Revision 360 org.gvsig.projection.jcrs/trunk/org.gvsig.projection.jcrs/org.gvsig.projection.jcrs.lib/src/main/java/org/gvsig/crs/proj/CrsProj.java
CrsProj.java | ||
---|---|---|
53 | 53 |
|
54 | 54 |
private SpatialReference spatialReference; |
55 | 55 |
private String _strCrs; |
56 |
// private String abrev = null; |
|
57 |
// private Bounds bounds = null; |
|
58 | 56 |
|
59 |
|
|
60 |
// public class Bounds { |
|
61 |
// double minX; |
|
62 |
// double maxX; |
|
63 |
// double minY; |
|
64 |
// double maxY; |
|
65 |
// public Bounds(double minX, double maxX, double minY, double maxY){ |
|
66 |
// this.minX = minX; |
|
67 |
// this.maxX = maxX; |
|
68 |
// this.minY = minY; |
|
69 |
// this.maxY = maxY; |
|
70 |
// } |
|
71 |
// |
|
72 |
// |
|
73 |
// public double getMinX() { |
|
74 |
// return minX; |
|
75 |
// } |
|
76 |
// |
|
77 |
// |
|
78 |
// public double getMaxX() { |
|
79 |
// return maxX; |
|
80 |
// } |
|
81 |
// |
|
82 |
// |
|
83 |
// public double getMinY() { |
|
84 |
// return minY; |
|
85 |
// } |
|
86 |
// |
|
87 |
// |
|
88 |
// public double getMaxY() { |
|
89 |
// return maxY; |
|
90 |
// } |
|
91 |
// |
|
92 |
// } |
|
93 |
|
|
94 | 57 |
public CrsProj(String proj4String) { |
95 | 58 |
try { |
96 | 59 |
if( proj4String == null ) { |
... | ... | |
106 | 69 |
|
107 | 70 |
} |
108 | 71 |
|
109 |
//FIXME: Esto era un parche para intentar generar el envelope de un sistema de referencia. |
|
110 |
//TODO: A eliminar. |
|
111 |
// public CrsProj(String proj4String, String abrev) { |
|
112 |
// //FIXME: Esto es un parche para ver la diferencia entre las cadenas proj4 |
|
113 |
// // que nos da gvSIG y las que nos da gdal. A Eliminar |
|
114 |
//// if(StringUtils.startsWith(abrev, "EPSG:")){ |
|
115 |
//// SpatialReference sr = new SpatialReference(); |
|
116 |
//// sr.ImportFromEPSG(Integer.parseInt(StringUtils.removeStart(abrev, "EPSG:"))); |
|
117 |
//// proj4String = sr.ExportToProj4(); |
|
118 |
//// } |
|
119 |
// |
|
120 |
// this(proj4String); |
|
121 |
//// try { |
|
122 |
//// if (proj4String == null) { |
|
123 |
//// logger.error("Can't create CRS from 'null' value."); |
|
124 |
//// return; |
|
125 |
//// } |
|
126 |
//// createCrs(proj4String); |
|
127 |
//// } catch (CrsProjException e) { |
|
128 |
//// logger.error("Can't create CRS from '" + proj4String + "'.", e); |
|
129 |
//// } |
|
130 |
// this.abrev = abrev; |
|
131 |
// showInfo(); |
|
132 |
// } |
|
133 |
// |
|
134 |
// public Bounds getBounds() { |
|
135 |
// if (bounds == null) { |
|
136 |
// String unit = spatialReference.GetAttrValue("UNIT"); |
|
137 |
// String unitConv = spatialReference.GetAttrValue("UNIT", 1); |
|
138 |
// if (StringUtils.equalsIgnoreCase(unit, osr.SRS_UA_DEGREE)) { |
|
139 |
// bounds = new Bounds(-180, 180, -90, 90); |
|
140 |
// } else if (StringUtils.equalsIgnoreCase(unit, osr.SRS_UA_RADIAN)) { |
|
141 |
// bounds = new Bounds(-Math.PI, Math.PI, -Math.PI / 2, Math.PI / 2); |
|
142 |
// } else { |
|
143 |
// bounds = |
|
144 |
// new Bounds(-spatialReference.GetSemiMajor() * 2* Math.PI / Double.parseDouble(unitConv), |
|
145 |
// +spatialReference.GetSemiMajor() * 2 * Math.PI / Double.parseDouble(unitConv), |
|
146 |
// -spatialReference.GetSemiMinor() * 2 * Math.PI / Double.parseDouble(unitConv), |
|
147 |
// +spatialReference.GetSemiMinor() * 2 * Math.PI / Double.parseDouble(unitConv)); |
|
148 |
// } |
|
149 |
// } |
|
150 |
// |
|
151 |
// return bounds; |
|
152 |
// } |
|
153 |
|
|
154 | 72 |
private void showInfo() { |
155 | 73 |
logger.info("========================================================================="); |
156 | 74 |
logger.info("_strCrs" + " = " + _strCrs); |
Also available in: Unified diff