use of ucar.nc2.ft.FeatureCollection in project sis by apache.
the class DecoderWrapper method getDiscreteSampling.
/**
* If this decoder can handle the file content as features, returns handlers for them.
*
* @return {@inheritDoc}
* @throws IOException if an I/O operation was necessary but failed.
* @throws DataStoreException if the library of geometric objects is not available.
*/
@Override
@SuppressWarnings("null")
public DiscreteSampling[] getDiscreteSampling() throws IOException, DataStoreException {
if (features == null && file instanceof NetcdfDataset) {
features = FeatureDatasetFactoryManager.wrap(null, (NetcdfDataset) file, this, new Formatter(new LogAdapter(listeners), listeners.getLocale()));
}
List<FeatureCollection> fc = null;
if (features instanceof FeatureDatasetPoint) {
fc = ((FeatureDatasetPoint) features).getPointFeatureCollectionList();
}
final FeaturesWrapper[] wrappers = new FeaturesWrapper[(fc != null) ? fc.size() : 0];
try {
for (int i = 0; i < wrappers.length; i++) {
wrappers[i] = new FeaturesWrapper(fc.get(i), geomlib, listeners);
}
} catch (IllegalArgumentException e) {
throw new DataStoreException(e.getLocalizedMessage(), e);
}
return wrappers;
}
Aggregations