Revision 20119

View differences:

trunk/libraries/libRaster/src/org/gvsig/raster/dataset/MultiRasterDataset.java
256 256
		}
257 257
		return false;
258 258
	}
259
	    		
259
					
260 260
	/**
261 261
	 * Cierra la lista de datasets asociados al MultiRasterDataset
262 262
	 */
......
923 923
	 * (non-Javadoc)
924 924
	 * @see org.gvsig.raster.dataset.IRasterDataSource#getNoDataValue()
925 925
	 */
926
	public double getNoDataValue(int dataset) {
926
	public double getNoDataValue() {
927 927
		if (files.isEmpty())
928 928
			return RasterLibrary.defaultNoDataValue;
929 929

  
930
		if (dataset >= files.size())
931
			dataset = files.size() - 1;
932

  
933
		if (dataset < 0)
934
			dataset = 0;
935

  
936
		return ((RasterDataset) files.get(dataset)).getNoDataValue();
930
		return ((RasterDataset) files.get(0)).getNoDataValue();
937 931
	}
938 932

  
939 933
	/*
940 934
	 * (non-Javadoc)
941
	 * @see org.gvsig.raster.dataset.IRasterDataSource#getNoDataEnabled(int)
935
	 * @see org.gvsig.raster.dataset.IRasterDataSource#isNoDataEnabled()
942 936
	 */
943
	public boolean isNoDataEnabled(int dataset) {
937
	public boolean isNoDataEnabled() {
944 938
		if (files.isEmpty())
945 939
			return false;
946 940

  
947
		if (dataset >= files.size())
948
			dataset = files.size() - 1;
949

  
950
		if (dataset < 0)
951
			dataset = 0;
952

  
953
		return ((RasterDataset) files.get(dataset)).isNoDataEnabled();
941
		return ((RasterDataset) files.get(0)).isNoDataEnabled();
954 942
	}
955 943

  
956 944
	/*
......
964 952

  
965 953
	/*
966 954
	 * (non-Javadoc)
967
	 * @see org.gvsig.raster.dataset.IRasterDataSource#setNoDataValue(int, double)
955
	 * @see org.gvsig.raster.dataset.IRasterDataSource#setNoDataValue(double)
968 956
	 */
969
	public void setNoDataValue(int dataset, double value) {
970
		if (files.isEmpty())
971
			return;
972

  
973
		if (dataset >= files.size())
974
			return;
975

  
976
		if (dataset < 0)
977
			return;
978

  
979
		((RasterDataset) files.get(dataset)).setNoDataValue(value);
957
	public void setNoDataValue(double value) {
958
		for (int i = 0; i < files.size(); i++)
959
			((RasterDataset) files.get(i)).setNoDataValue(value);
980 960
	}
981 961

  
982 962
	/*
983 963
	 * (non-Javadoc)
984
	 * @see org.gvsig.raster.dataset.IRasterDataSource#setNoDataEnabled(int, boolean)
964
	 * @see org.gvsig.raster.dataset.IRasterDataSource#setNoDataEnabled(boolean)
985 965
	 */
986
	public void setNoDataEnabled(int dataset, boolean enabled) {
987
		if (files.isEmpty())
988
			return;
989

  
990
		if (dataset >= files.size())
991
			return;
992

  
993
		if (dataset < 0)
994
			return;
995

  
996
		((RasterDataset) files.get(dataset)).setNoDataEnabled(enabled);
966
	public void setNoDataEnabled(boolean enabled) {
967
		for (int i = 0; i < files.size(); i++)
968
			((RasterDataset) files.get(i)).setNoDataEnabled(enabled);
997 969
	}
998 970

  
999 971
	/**
......
1009 981
	}
1010 982
	
1011 983
	/**
1012
     * Este es el extent sobre el que se ajusta una petici?n para que esta no exceda el 
1013
     * extent m?ximo del raster. Para un raster sin rotar ser? igual al extent
1014
     * pero para un raster rotado ser? igual al extent del raster como si no 
1015
     * tuviera rotaci?n. Esto ha de ser as? ya que la rotaci?n solo se hace sobre la
1016
     * vista y las peticiones han de hacerse en coordenadas de la imagen sin shearing
1017
     * aplicado.
1018
     * @return Extent
1019
     */
1020
    public Extent getExtentForRequest() {
1021
        return ((RasterDataset)files.get(0)).getExtentWithoutRot();
1022
    }
984
		 * Este es el extent sobre el que se ajusta una petici?n para que esta no exceda el 
985
		 * extent m?ximo del raster. Para un raster sin rotar ser? igual al extent
986
		 * pero para un raster rotado ser? igual al extent del raster como si no 
987
		 * tuviera rotaci?n. Esto ha de ser as? ya que la rotaci?n solo se hace sobre la
988
		 * vista y las peticiones han de hacerse en coordenadas de la imagen sin shearing
989
		 * aplicado.
990
		 * @return Extent
991
		 */
992
		public Extent getExtentForRequest() {
993
				return ((RasterDataset)files.get(0)).getExtentWithoutRot();
994
		}
1023 995
	
1024 996
	/*
1025 997
	 * (non-Javadoc)
trunk/libraries/libRaster/src/org/gvsig/raster/dataset/IRasterDataSource.java
56 56
	 * Obtiene el valor NoData asociado al raster.
57 57
	 * @return
58 58
	 */
59
	public double getNoDataValue(int dataset);
59
	public double getNoDataValue();
60 60

  
61 61
	/**
62 62
	 * Vuelve a poner el valor noData como estaba inicialmente
......
67 67
	 * Define el valor NoData asociado al raster.
68 68
	 * @return
69 69
	 */
70
	public void setNoDataValue(int dataset, double value);
70
	public void setNoDataValue(double value);
71 71

  
72 72
	/**
73 73
	 * Obtiene si esta activo el valor NoData asociado al raster.
74 74
	 * @return
75 75
	 */
76
	public boolean isNoDataEnabled(int dataset);
76
	public boolean isNoDataEnabled();
77 77

  
78 78
	/**
79 79
	 * Define si se activa el valor NoData asociado al raster.
80 80
	 * @return
81 81
	 */
82
	public void setNoDataEnabled(int dataset, boolean enabled);
82
	public void setNoDataEnabled(boolean enabled);
83 83
	
84 84
	/**
85 85
	 * Obtiene la paleta correspondiente al nombre del fichero pasado por par?metro. 
trunk/libraries/libRaster/src/org/gvsig/raster/dataset/CompositeDataset.java
1203 1203

  
1204 1204
	/*
1205 1205
	 * (non-Javadoc)
1206
	 * @see org.gvsig.raster.dataset.IRasterDataSource#getNoDataValue(int)
1206
	 * @see org.gvsig.raster.dataset.IRasterDataSource#loadGeoPointsFromRmf()
1207 1207
	 */
1208
	public double getNoDataValue(int dataset) {
1209
		return RasterLibrary.defaultNoDataValue;
1208
	public GeoPoint[] loadGeoPointsFromRmf() throws IOException {
1209
		throw new IOException("Not implemented yet");
1210 1210
	}
1211 1211

  
1212 1212
	/*
1213 1213
	 * (non-Javadoc)
1214
	 * @see org.gvsig.raster.dataset.IRasterDataSource#resetNoDataValue()
1214
	 * @see org.gvsig.raster.dataset.IRasterDataSource#saveGeoPointsToRmf(org.gvsig.raster.datastruct.GeoPoint[])
1215 1215
	 */
1216
	public void resetNoDataValue() {
1216
	public void saveGeoPointsToRmf(GeoPoint[] geoPoints) throws IOException {
1217
		throw new IOException("Not implemented yet");	
1217 1218
	}
1218 1219

  
1219 1220
	/*
1220 1221
	 * (non-Javadoc)
1221
	 * @see org.gvsig.raster.dataset.IRasterDataSource#setNoDataValue(int, double)
1222
	 * @see org.gvsig.raster.dataset.IRasterDataSource#getNoDataValue()
1222 1223
	 */
1223
	public void setNoDataValue(int dataset, double value) {
1224
	public double getNoDataValue() {
1225
		int n = mosaic.length;
1226
		int m = mosaic[0].length;
1227
		if ((n == 0) || (m == 0))
1228
			return RasterLibrary.defaultNoDataValue;
1229
		return mosaic[0][0].getNoDataValue();
1224 1230
	}
1225
	
1231

  
1226 1232
	/*
1227 1233
	 * (non-Javadoc)
1228
	 * @see org.gvsig.raster.dataset.IRasterDataSource#loadGeoPointsFromRmf()
1234
	 * @see org.gvsig.raster.dataset.IRasterDataSource#resetNoDataValue()
1229 1235
	 */
1230
	public GeoPoint[] loadGeoPointsFromRmf() throws IOException {
1231
		throw new IOException("Not implemented yet");
1236
	public void resetNoDataValue() {
1237
		int n = mosaic.length;
1238
		int m = mosaic[0].length;
1239
		for (int row = 0; row < n; row++)
1240
			for (int col = 0; col < m; col++)
1241
				mosaic[row][col].resetNoDataValue();
1232 1242
	}
1233 1243

  
1234 1244
	/*
1235 1245
	 * (non-Javadoc)
1236
	 * @see org.gvsig.raster.dataset.IRasterDataSource#saveGeoPointsToRmf(org.gvsig.raster.datastruct.GeoPoint[])
1246
	 * @see org.gvsig.raster.dataset.IRasterDataSource#setNoDataValue(double)
1237 1247
	 */
1238
	public void saveGeoPointsToRmf(GeoPoint[] geoPoints) throws IOException {
1239
		throw new IOException("Not implemented yet");	
1248
	public void setNoDataValue(double value) {
1249
		int n = mosaic.length;
1250
		int m = mosaic[0].length;
1251
		for (int row = 0; row < n; row++)
1252
			for (int col = 0; col < m; col++)
1253
				mosaic[row][col].setNoDataValue(value);
1240 1254
	}
1241 1255

  
1242
	public boolean isNoDataEnabled(int dataset) {
1243
		return false;
1256
	/*
1257
	 * (non-Javadoc)
1258
	 * @see org.gvsig.raster.dataset.IRasterDataSource#isNoDataEnabled()
1259
	 */
1260
	public boolean isNoDataEnabled() {
1261
		int n = mosaic.length;
1262
		int m = mosaic[0].length;
1263
		if ((n == 0) || (m == 0))
1264
			return false;
1265
		return mosaic[0][0].isNoDataEnabled();
1244 1266
	}
1245 1267

  
1246
	public void setNoDataEnabled(int dataset, boolean enabled) {
1268
	/*
1269
	 * (non-Javadoc)
1270
	 * @see org.gvsig.raster.dataset.IRasterDataSource#setNoDataEnabled(boolean)
1271
	 */
1272
	public void setNoDataEnabled(boolean enabled) {
1273
		int n = mosaic.length;
1274
		int m = mosaic[0].length;
1275
		for (int row = 0; row < n; row++)
1276
			for (int col = 0; col < m; col++)
1277
				mosaic[row][col].setNoDataEnabled(enabled);
1247 1278
	}
1248 1279
}
trunk/libraries/libRaster/src/org/gvsig/raster/buffer/BufferFactory.java
557 557
	 * @return RasterBuf
558 558
	 */
559 559
	public IBuffer getRasterBuf() {
560
		if(rasterBuf != null && mDataset != null)
561
			rasterBuf.setNoDataValue(mDataset.getNoDataValue(0));
560
		if (rasterBuf != null && mDataset != null)
561
			rasterBuf.setNoDataValue(mDataset.getNoDataValue());
562 562
		return rasterBuf;
563 563
	}
564 564

  

Also available in: Unified diff