*/
try {
if (qCsr != null && cCsr != null) {
if (cCs != null)
results = new ForceCoordinateSystemFeatureResults(results, cCs);
results = new ReprojectFeatureResults(results, cCsr);
if (qCs != null)
results = new ForceCoordinateSystemFeatureResults(results, qCs);
results = new ReprojectFeatureResults(results, qCsr);
} else if (qCs != null && cCsr != null) {
// complex case 2, reprojected then forced
// mergedQuery.setCoordinateSystem(cCs);
// mergedQuery.setCoordinateSystemReproject(cCsr);
try {
if (cCs != null)
results = new ForceCoordinateSystemFeatureResults(results, cCs);
results = new ReprojectFeatureResults(source.getFeatures(mergedQuery), cCsr);
results = new ForceCoordinateSystemFeatureResults(results, qCs);
} catch (SchemaException e) {
throw new DataSourceException("This should not happen", e);
}
} else {
// easy case, we can just put toghether one forced cs and one
// reprojection cs
// in the mixed query and let it go
// mergedQuery.setCoordinateSystem(qCs != null ? qCs : cCs);
// mergedQuery.setCoordinateSystemReproject(qCsr != null ? qCsr
// : cCsr);
CoordinateReferenceSystem forcedCS = qCs != null ? qCs : cCs;
CoordinateReferenceSystem reprojectCS = qCsr != null ? qCsr : cCsr;
if (forcedCS != null)
results = new ForceCoordinateSystemFeatureResults(results, forcedCS);
if (reprojectCS != null)
results = new ReprojectFeatureResults(results, reprojectCS);
}
} catch (IOException e) {
throw e;
} catch (Exception e) {
throw new DataSourceException("A problem occurred while handling forced "