Revision 22945 branches/v2_0_0_prep/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/layers/vectorial/FLyrVect.java

View differences:

FLyrVect.java
82 82
import org.gvsig.fmap.mapcontext.layers.AbstractLinkProperties;
83 83
import org.gvsig.fmap.mapcontext.layers.FLayer;
84 84
import org.gvsig.fmap.mapcontext.layers.FLyrDefault;
85
import org.gvsig.fmap.mapcontext.layers.FLyrVectLinkProperties;
86 85
import org.gvsig.fmap.mapcontext.layers.LayerEvent;
87 86
import org.gvsig.fmap.mapcontext.layers.SpatialCache;
88 87
import org.gvsig.fmap.mapcontext.layers.XMLException;
......
1886 1885
		return (FeatureStore)getDataStore();
1887 1886
	}
1888 1887

  
1889
	public FeatureCollection queryByPoint(Point2D mapPoint, double tol) throws ReadException {
1888
	public FeatureCollection queryByPoint(Point2D mapPoint, double tol, FeatureType featureType) throws ReadException {
1890 1889
//		double halfTol=tol*0.5;
1891 1890
//		Envelope envelope=new DefaultEnvelope(mapPoint.getX()-halfTol,mapPoint.getY()-halfTol,mapPoint.getX()+halfTol,mapPoint.getY()+halfTol);
1892 1891
//		return queryByEnvelope(envelope);
1893 1892
		Geometry geom = GeometryManager.getInstance().getGeometryFactory()
1894 1893
				.createCircle(mapPoint, tol);
1895 1894

  
1896
		return queryByGeometry(geom);
1895
		return queryByGeometry(geom, featureType);
1897 1896
	}
1898 1897

  
1899 1898

  
1900
	public FeatureCollection queryByGeometry(Geometry geom) throws ReadException {
1899
	public FeatureCollection queryByGeometry(Geometry geom, FeatureType featureType) throws ReadException {
1901 1900
		try {
1902 1901
			return (FeatureCollection)
1903 1902
				getFeatureStore().getDataCollection(
1904
					getFeatureStore().getDefaultFeatureType(),
1903
					featureType,
1905 1904
					getDataStoreFilterForGeomerty(
1906 1905
							geom,
1907
							getFeatureStore().getDefaultFeatureType().getDefaultGeometry(),
1906
							featureType.getDefaultGeometry(),
1908 1907
							null),
1909 1908
					null);
1910 1909
		} catch (GeometryOperationNotSupportedException e) {
......
1939 1938
				+ "), " + geomFileName + ") ";
1940 1939
	}
1941 1940

  
1942
	public FeatureCollection queryByEnvelope(Envelope rect)
1941
	public FeatureCollection queryByEnvelope(Envelope rect, FeatureType featureType)
1943 1942
			throws ReadException {
1944
		return this.queryByGeometry(rect.getGeometry());
1943
		return this.queryByGeometry(rect.getGeometry(),featureType);
1945 1944
	}
1946 1945

  
1947 1946
	public XMLItem[] getInfo(Point p, double tolerance, Cancellable cancel) throws ReadException, LoadLayerException {
1948 1947
		Point2D pReal = this.getMapContext().getViewPort().toMapPoint(p);
1949
        FeatureCollection featureCollection = queryByPoint(pReal, tolerance);
1948
        FeatureCollection featureCollection = queryByPoint(pReal, tolerance, getFeatureStore().getDefaultFeatureType());
1950 1949
        VectorialXMLItem[] item = new VectorialXMLItem[1];
1951 1950
        item[0] = new VectorialXMLItem(featureCollection, this);
1952 1951

  

Also available in: Unified diff