@Test public void testReadTrack() throws Exception { CrsGeoCoding geoCoding = new CrsGeoCoding(DefaultGeographicCRS.WGS84, new Rectangle(360, 180), new AffineTransform()); InputStreamReader reader = new InputStreamReader(getClass().getResourceAsStream("TrackData.csv")); FeatureCollection<SimpleFeatureType, SimpleFeature> featureCollection = ImportTrackAction.readTrack(reader, geoCoding); assertNotNull(featureCollection); assertEquals(23, featureCollection.size()); SimpleFeature[] simpleFeatures = featureCollection.toArray(new SimpleFeature[0]); assertEquals(23, simpleFeatures.length); assertEquals("ID00000000", simpleFeatures[0].getID()); assertEquals("ID00000011", simpleFeatures[11].getID()); assertEquals("ID00000022", simpleFeatures[22].getID()); }
private static FeatureCollection<SimpleFeatureType, SimpleFeature> readTrack(File file, GeoCoding geoCoding) throws IOException { try (Reader reader = new FileReader(file)) { return readTrack(reader, geoCoding); } }
ImportTrackAction extends AbstractSnapAction implements ContextAwareAction, LookupListener { private static FeatureCollection<SimpleFeatureType, SimpleFeature> readTrack(File file, GeoCoding geoCoding) throws IOException { try (Reader reader = new FileReader(file)) { return readTrack(reader, geoCoding); } } }
ImportTrackAction extends AbstractSnapAction implements ContextAwareAction, LookupListener { private static FeatureCollection<SimpleFeatureType, SimpleFeature> readTrack(File file, GeoCoding geoCoding) throws IOException { try (Reader reader = new FileReader(file)) { return readTrack(reader, geoCoding); } } ImportTrackAction();  ImportTrackAction(Lookup lookup); }
ImportTrackAction extends AbstractSnapAction implements ContextAwareAction, LookupListener { private static FeatureCollection<SimpleFeatureType, SimpleFeature> readTrack(File file, GeoCoding geoCoding) throws IOException { try (Reader reader = new FileReader(file)) { return readTrack(reader, geoCoding); } } ImportTrackAction();  ImportTrackAction(Lookup lookup); @Override Action createContextAwareInstance(Lookup lookup); @Override void actionPerformed(ActionEvent ae); @Override void resultChanged(LookupEvent lookupEvent); }
ImportTrackAction extends AbstractSnapAction implements ContextAwareAction, LookupListener { private static FeatureCollection<SimpleFeatureType, SimpleFeature> readTrack(File file, GeoCoding geoCoding) throws IOException { try (Reader reader = new FileReader(file)) { return readTrack(reader, geoCoding); } } ImportTrackAction();  ImportTrackAction(Lookup lookup); @Override Action createContextAwareInstance(Lookup lookup); @Override void actionPerformed(ActionEvent ae); @Override void resultChanged(LookupEvent lookupEvent);  }