Revision 1731 branches/v02_desarrollo/libraries/libCq CMS for java.old/src/org/cresques/geo/cover/Coverage.java

View differences:

Coverage.java
25 25
import org.cresques.geo.Projection;
26 26
import org.cresques.geo.ReProjection;
27 27
import org.cresques.io.GeoRasterFile;
28
//import org.cresques.io.*;
29 28

  
30

  
31
/*class FileSupport {
32
	String extension;
33
	Class supportClass;
34
	public FileSupport(String e, Class c) {
35
		extension = e;
36
		supportClass = c;
37
	}
38
};*/
39

  
40 29
/**
41 30
 * Cobertura espacial
42 31
 * 
......
50 39
	};*/
51 40
	// Nombre de la cobertura
52 41
	protected String name = "Orto ICV 1:5.000";
42
	protected String fName = "cover";
53 43
	// Direcci?n raiz de los datos
54 44
	protected String dName = null; //"//sercart/cartografia/ortofotos/Orto_ICV/00009";
55 45
	protected int	nLevels = 1;
......
159 149
		} 
160 150
	}
161 151
	
152
	public IObjList [] loadMinuteo() {
153
		IObjList [] minuteo = null;
154
		return minuteo;
155
	}
156
	
157
	public void saveMinuteo(IObjList [] minuteo) {
158
		for (int i=0; i<minuteo.length; i++) {
159
			
160
		}
161
	}
162 162
	/**
163 163
	 * Genera el minuteo, reproyectado.
164 164
	 * @param targetProj proyeccion de destino
......
166 166
	 */
167 167
	
168 168
	public IObjList[] generateMinuteo(IProjection targetProj) {
169
		IObjList [] minuteo = new IObjList[nLevels];
169
		IObjList [] minuteo = loadMinuteo();
170
		if (minuteo != null) return minuteo;
171
		minuteo = new IObjList[nLevels];
170 172
		for (int i=0; i<minuteo.length; i++)
171 173
			minuteo[i] = new PxObjList();
172 174
		if (hojas.size()== 0)
......
183 185
			hName = (String) enum.nextElement();
184 186
			try {
185 187
				obj = hojas.get(hName);
186
				if (obj.getClass() == String.class) {
188
				if (obj instanceof String) {
187 189
					hCode = (String) obj;
188 190
					generateMinuteoHoja(dName+"/"+hCode, hName, layer, layer1);
189
				} else if (obj.getClass() == Hoja.class) {
191
				} else if (obj instanceof Hoja) {
190 192
					h = (Hoja) obj;
191 193
					generateMinuteoHoja(dName+"/"+h.getCode(), h, layer, layer1);
192 194
				}
193 195
			} catch (Exception e) {
194 196
				// TODO Tengo que tratar los errores de una forma mejor.
195 197
				System.err.println("Error al cargar la hoja "+hName);
198
				e.printStackTrace();
196 199
			}
197 200
		}
201
		saveMinuteo(minuteo);
198 202
		//app.setCurrentMinuteo(layer);
199 203
		if (proj != targetProj) {
200 204
			ICoordTrans rp = null;
......
205 209
			layer.reProject(rp);
206 210
			if (layer1 != null) layer1.reProject(rp);
207 211
		}
208
		
209 212
		return minuteo;
210 213
	}
211 214
	

Also available in: Unified diff