public TestMiscPointFeature(String name) {
super(name);
}
public void testIterator() {
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
FeatureDataset fd = null;
try {
Formatter formatter = new Formatter(System.err);
fd = FeatureDatasetFactoryManager.open(FeatureType.STATION, "src/test/data/point/StandardPointFeatureIteratorIssue.ncml", null, formatter);
if (fd != null && fd instanceof FeatureDatasetPoint) {
FeatureDatasetPoint fdp = (FeatureDatasetPoint) fd;
FeatureCollection fc = fdp.getPointFeatureCollectionList().get(0);
if (fc != null && fc instanceof StationTimeSeriesFeatureCollection) {
StationTimeSeriesFeatureCollection stsfc =
(StationTimeSeriesFeatureCollection) fc;
// subset criteria not important, just want to get data
// into flattened representation
PointFeatureCollection pfc = stsfc.flatten(
new LatLonRect(
new LatLonPointImpl(-90, -180),
new LatLonPointImpl(90, 180)),
new DateRange(
df.parse("1900-01-01"),
df.parse("2100-01-01")));
PointFeatureIterator pfi = pfc.getPointFeatureIterator(-1);
try {
while (pfi.hasNext()) {
PointFeature pf = pfi.next();
// the call to cursor.getParentStructure() in