Revision 11076 trunk/libraries/libRaster/src/org/gvsig/raster/dataset/io/EcwDriver.java

View differences:

EcwDriver.java
44 44
import com.ermapper.ecw.JNCSInvalidSetViewException;
45 45
import com.ermapper.ecw.JNCSProgressiveUpdate;
46 46

  
47
import es.gva.cit.jgdal.GdalException;
48

  
49

  
47 50
/**
48 51
 * Driver de Ecw
49 52
 * 
......
97 100
	 * @param fName Nombre del fichero ecw
98 101
	 * @throws NotSupportedExtensionException
99 102
	 */
100
	public EcwDriver(IProjection proj, String fName)throws NotSupportedExtensionException {
101
		 super(proj, fName);
103
	public EcwDriver(IProjection proj, Object param)throws NotSupportedExtensionException {
104
		 super(proj, ((String)param));
102 105
	     extent = new Extent();
103 106
	     try {
104 107

  
105
	    	 if (!new File(fName).exists() && !fName.startsWith("ecwp:"))
108
	    	 if (!new File(((String)param)).exists() && !((String)param).startsWith("ecwp:"))
106 109
	    		 throw new NotSupportedExtensionException("Extension not supported");
107 110

  
108
	    	 file = new JNCSFile(fName, false);
111
	    	 file = new JNCSFile(((String)param), false);
109 112
	    	 load();
110 113
	    	 //readGeoInfo(fName);
111 114
	    	 bandCount = file.numBands;
......
149 152
	 * Calcula la bounding box en la que est? metido el raster teniendo en cuenta
150 153
	 * el tama?o de pixel y la rotaci?n. 
151 154
	 */
152
	private void boundingBoxWithoutRotation(){
155
	private void boundingBoxWithoutRotation() {
153 156
		double ox = file.originX;
154 157
		double oy = file.originY;
155 158
		double resx = file.cellIncrementX;
......
224 227
	 * @param nHeight Alto en pixeles del buffer
225 228
	 * @return desplazamiento dentro del buffer en X e Y
226 229
	 */ 
227
	private int[] calcStepBuffer(Extent dataExtent, int nWidth, int nHeight, int[] stpBuffer){
230
	private int[] calcStepBuffer(Extent dataExtent, int nWidth, int nHeight, int[] stpBuffer) {
228 231
    	Extent imageExtent = new Extent(bBoxWithoutRot.minX, bBoxWithoutRot.minY, bBoxWithoutRot.maxX, bBoxWithoutRot.maxY);
229 232
    	Extent ajustDataExtent = RasterUtilities.calculateAdjustedView(dataExtent, imageExtent);
230
    	if(!RasterUtilities.compareExtents(dataExtent, ajustDataExtent)){
233
    	if(!RasterUtilities.compareExtents(dataExtent, ajustDataExtent)) {
231 234
    		Point2D p1 = worldToRaster(new Point2D.Double(ajustDataExtent.minX(), ajustDataExtent.maxY()));
232 235
    		Point2D p2 = worldToRaster(new Point2D.Double(ajustDataExtent.maxX(), ajustDataExtent.minY()));
233 236
    		Point2D p3 = worldToRaster(new Point2D.Double(dataExtent.minX(), dataExtent.maxY()));

Also available in: Unified diff