Revision 1367 org.gvsig.raster.wms/trunk/org.gvsig.raster.wms/org.gvsig.raster.wms.io/src/main/java/org/gvsig/raster/wms/io/WMSProvider.java

View differences:

WMSProvider.java
48 48
import org.gvsig.fmap.dal.coverage.exception.BandAccessException;
49 49
import org.gvsig.fmap.dal.coverage.exception.BandNotFoundInListException;
50 50
import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException;
51
import org.gvsig.fmap.dal.coverage.exception.InfoByPointException;
51 52
import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
52 53
import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
53 54
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
......
107 108
	//The out size depends on the last request
108 109
	private int                         lastWidthRequest         = 0;
109 110
	private int                         lastHeightRequest        = 0;
110
	private Rectangle2D                 lastExtent               = null;
111 111
	//Only for fixed size. Complete extent and FIXED_SIZE in long side
112 112
	private File                        fileLayerPixelSize       = null;
113 113
	private File                        lastRequest              = null;
......
681 681
	}
682 682
	
683 683
	public WMSStatus loadWMSStatus(Rectangle2D bBox) {
684
		lastExtent = bBox;
685 684
		WMSDataParameters p = (WMSDataParameters)parameters;
686 685
		WMSStatus wmsStatus = new WMSStatus();
687 686
		wmsStatus.setLayerNames(Utilities.createVector(p.getLayerQuery(), ","));
......
1165 1164
		this.param = param;
1166 1165
	}
1167 1166
	
1168
	/**
1169
     * @param wmsStatus
1170
     * @param i
1171
     * @param j
1172
     * @param max_value
1173
     * @return
1174
     * @throws RemoteServiceException
1175
     */
1176
    public String getFeatureInfo(int i, int j, int max_value, ICancellable cancellable) throws RemoteServiceException {
1177
    	WMSStatus wmsStatus = loadWMSStatus(lastExtent);
1178
    	return getConnector().getFeatureInfo(wmsStatus, i, j, max_value, cancellable);
1179
    }
1180
    
1181
    /*
1182
	 * (non-Javadoc)
1183
	 * @see org.gvsig.raster.impl.provider.RasterProvider#getInfoByPoint(double, double)
1184
	 */
1185
	public String getInfoByPoint(double x, double y, ICancellable cancellable) throws RemoteServiceException {
1186
		return getFeatureInfo((int) x, (int) y, Integer.MAX_VALUE, cancellable);
1187
	}
1188
	
1189
	public String getInfoByPoint(int x, int y, Extent bbox, int w, int h, ICancellable cancellable) throws RemoteServiceException {
1167
	public String getInfoByPoint(int x, int y, Extent bbox, int w, int h, ICancellable cancellable) throws InfoByPointException {
1190 1168
		WMSDataParameters p = (WMSDataParameters)parameters;
1191 1169
		WMSStatus wmsStatus = new WMSStatus();
1192 1170
		wmsStatus.setLayerNames(Utilities.createVector(p.getLayerQuery(), ","));
......
1200 1178
		wmsStatus.setExtent(bbox.toRectangle2D());
1201 1179
		wmsStatus.setHeight(h);
1202 1180
		wmsStatus.setWidth(w);
1203
		return getConnector().getFeatureInfo(wmsStatus, x, y, Integer.MAX_VALUE, cancellable);
1181
		try {
1182
			return getConnector().getFeatureInfo(wmsStatus, x, y, Integer.MAX_VALUE, cancellable);
1183
		} catch (RemoteServiceException e) {
1184
			throw new InfoByPointException("Error in getFeatureInfo", e);
1185
		}
1204 1186
	}
1205 1187
	
1206 1188
	/**

Also available in: Unified diff