Revision 23574
branches/v2_0_0_prep/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/layers/vectorial/FLyrVect.java | ||
---|---|---|
1413 | 1413 |
* TODO Este metodo es de utilidad. Sacarlo de aqui? |
1414 | 1414 |
*/ |
1415 | 1415 |
public String getDataStoreFilterForGeomerty(Geometry geom, |
1416 |
String geomFileName, String srs) throws ReadException,
|
|
1416 |
String geomAttributeName, String srs) throws ReadException,
|
|
1417 | 1417 |
GeometryOperationException, |
1418 | 1418 |
GeometryOperationNotSupportedException { |
1419 | 1419 |
String txtGeom; |
... | ... | |
1430 | 1430 |
|
1431 | 1431 |
|
1432 | 1432 |
return " intersects(GeomFromText('" + txtGeom + "', " + "'" + srs + "'" |
1433 |
+ "), " + geomFileName + ") ";
|
|
1433 |
+ "), " + geomAttributeName + ") ";
|
|
1434 | 1434 |
} |
1435 | 1435 |
|
1436 |
/* |
|
1437 |
* TODO Este metodo es de utilidad. Sacarlo de aqui? |
|
1438 |
*/ |
|
1439 |
public String getDataStoreFilterForEnvelope(Envelope envelope, |
|
1440 |
String geomAttributeName, String srs) throws ReadException, |
|
1441 |
GeometryOperationException, GeometryOperationNotSupportedException { |
|
1442 |
String txtGeom; |
|
1443 |
|
|
1444 |
txtGeom = (String) envelope.getGeometry().invokeOperation(ToWKT.CODE, |
|
1445 |
null); |
|
1446 |
|
|
1447 |
if (srs == null) { |
|
1448 |
try { |
|
1449 |
srs = (String) getFeatureStore().getMetadata().get("srs"); |
|
1450 |
} catch (BaseException e) { |
|
1451 |
throw new ReadException("getDataStoreFilterForGeomerty", e); |
|
1452 |
} |
|
1453 |
} |
|
1454 |
|
|
1455 |
return " intersects(GeomFromText('" + txtGeom + "', " + "'" + srs + "'" |
|
1456 |
+ "), boundary(" + geomAttributeName + ")) "; |
|
1457 |
} |
|
1458 |
|
|
1436 | 1459 |
public FeatureCollection queryByEnvelope(Envelope rect, FeatureType featureType) |
1437 | 1460 |
throws ReadException { |
1438 |
return this.queryByGeometry(rect.getGeometry(),featureType); |
|
1461 |
try { |
|
1462 |
return (FeatureCollection) getFeatureStore().getDataCollection( |
|
1463 |
featureType, |
|
1464 |
getDataStoreFilterForEnvelope(rect, featureType |
|
1465 |
.getDefaultGeometry(), null), null); |
|
1466 |
} catch (GeometryOperationNotSupportedException e) { |
|
1467 |
throw new ReadException("queryByGeometry", e); |
|
1468 |
} catch (GeometryOperationException e) { |
|
1469 |
throw new ReadException("queryByGeometry", e); |
|
1470 |
} |
|
1439 | 1471 |
} |
1440 | 1472 |
|
1441 | 1473 |
public XMLItem[] getInfo(Point p, double tolerance, Cancellable cancel) throws ReadException, LoadLayerException { |
Also available in: Unified diff