@Test public void testReadFeaturesInInput1() throws IOException { InputStreamReader reader = new InputStreamReader(getClass().getResourceAsStream("input_with_properties.csv")); final VectorDataNode dataNode = VectorDataNodeReader.read("blah", reader, createDummyProduct(), crsProvider, placemarkDescriptorProvider, DefaultGeographicCRS.WGS84, VectorDataNodeIO.DEFAULT_DELIMITER_CHAR, ProgressMonitor.NULL); FeatureCollection<SimpleFeatureType, SimpleFeature> fc = dataNode.getFeatureCollection(); SimpleFeatureType simpleFeatureType = fc.getSchema(); assertNotNull(simpleFeatureType); assertNotNull(simpleFeatureType.getCoordinateReferenceSystem()); assertEquals("org.esa.beam.FT1", simpleFeatureType.getTypeName()); assertEquals(4, simpleFeatureType.getAttributeCount()); List<AttributeDescriptor> list = simpleFeatureType.getAttributeDescriptors(); AttributeDescriptor ad0 = list.get(0); AttributeDescriptor ad1 = list.get(1); AttributeDescriptor ad2 = list.get(2); AttributeDescriptor ad3 = list.get(3); assertEquals("name", ad0.getType().getName().getLocalPart()); assertEquals(String.class, ad0.getType().getBinding()); assertEquals("geom", ad1.getType().getName().getLocalPart()); assertEquals(Geometry.class, ad1.getType().getBinding()); assertEquals("pixel", ad2.getType().getName().getLocalPart()); assertEquals(Integer.class, ad2.getType().getBinding()); assertEquals("description", ad3.getType().getName().getLocalPart()); assertEquals(String.class, ad3.getType().getBinding()); GeometryDescriptor geometryDescriptor = simpleFeatureType.getGeometryDescriptor(); assertEquals("geom", geometryDescriptor.getType().getName().getLocalPart()); assertEquals(3, fc.size()); FeatureIterator<SimpleFeature> featureIterator = fc.features(); SimpleFeature f1 = featureIterator.next(); assertEquals("ID65", f1.getID()); assertEquals("mark1", f1.getAttribute(0)); assertEquals(0, f1.getAttribute(2)); assertEquals("This is mark1.", f1.getAttribute(3)); SimpleFeature f2 = featureIterator.next(); assertEquals("ID66", f2.getID()); assertEquals("mark2", f2.getAttribute(0)); assertEquals(1, f2.getAttribute(2)); assertEquals(null, f2.getAttribute(3)); SimpleFeature f3 = featureIterator.next(); assertEquals("ID67", f3.getID()); assertEquals("mark3", f3.getAttribute(0)); assertEquals(2, f3.getAttribute(2)); assertEquals("This is mark3.", f3.getAttribute(3)); }
public static VectorDataNode read(String sourceName, Reader reader, Product product, FeatureUtils.FeatureCrsProvider crsProvider, PlacemarkDescriptorProvider placemarkDescriptorProvider, CoordinateReferenceSystem modelCrs, char delimiterChar, ProgressMonitor pm) throws IOException { return new VectorDataNodeReader(sourceName, product, reader, crsProvider, placemarkDescriptorProvider, true, delimiterChar).read(modelCrs, pm); }
VectorDataNodeReader { public static VectorDataNode read(String sourceName, Reader reader, Product product, FeatureUtils.FeatureCrsProvider crsProvider, PlacemarkDescriptorProvider placemarkDescriptorProvider, CoordinateReferenceSystem modelCrs, char delimiterChar, ProgressMonitor pm) throws IOException { return new VectorDataNodeReader(sourceName, product, reader, crsProvider, placemarkDescriptorProvider, true, delimiterChar).read(modelCrs, pm); } }
VectorDataNodeReader { public static VectorDataNode read(String sourceName, Reader reader, Product product, FeatureUtils.FeatureCrsProvider crsProvider, PlacemarkDescriptorProvider placemarkDescriptorProvider, CoordinateReferenceSystem modelCrs, char delimiterChar, ProgressMonitor pm) throws IOException { return new VectorDataNodeReader(sourceName, product, reader, crsProvider, placemarkDescriptorProvider, true, delimiterChar).read(modelCrs, pm); } private  VectorDataNodeReader(String sourceName, Product product, Reader reader, FeatureUtils.FeatureCrsProvider crsProvider,
                                 PlacemarkDescriptorProvider placemarkDescriptorProvider, boolean convertToVertices, char delimiterChar); }
VectorDataNodeReader { public static VectorDataNode read(String sourceName, Reader reader, Product product, FeatureUtils.FeatureCrsProvider crsProvider, PlacemarkDescriptorProvider placemarkDescriptorProvider, CoordinateReferenceSystem modelCrs, char delimiterChar, ProgressMonitor pm) throws IOException { return new VectorDataNodeReader(sourceName, product, reader, crsProvider, placemarkDescriptorProvider, true, delimiterChar).read(modelCrs, pm); } private  VectorDataNodeReader(String sourceName, Product product, Reader reader, FeatureUtils.FeatureCrsProvider crsProvider,
                                 PlacemarkDescriptorProvider placemarkDescriptorProvider, boolean convertToVertices, char delimiterChar); static VectorDataNode read(String sourceName, Reader reader, Product product, FeatureUtils.FeatureCrsProvider crsProvider,
                                      PlacemarkDescriptorProvider placemarkDescriptorProvider, CoordinateReferenceSystem modelCrs,
                                      char delimiterChar, ProgressMonitor pm); static VectorDataNode read(String sourceName, Reader reader, Product product, FeatureUtils.FeatureCrsProvider crsProvider,
                                      PlacemarkDescriptorProvider placemarkDescriptorProvider, CoordinateReferenceSystem modelCrs,
                                      char delimiterChar, boolean convertToVertices, ProgressMonitor pm); }
VectorDataNodeReader { public static VectorDataNode read(String sourceName, Reader reader, Product product, FeatureUtils.FeatureCrsProvider crsProvider, PlacemarkDescriptorProvider placemarkDescriptorProvider, CoordinateReferenceSystem modelCrs, char delimiterChar, ProgressMonitor pm) throws IOException { return new VectorDataNodeReader(sourceName, product, reader, crsProvider, placemarkDescriptorProvider, true, delimiterChar).read(modelCrs, pm); } private  VectorDataNodeReader(String sourceName, Product product, Reader reader, FeatureUtils.FeatureCrsProvider crsProvider,
                                 PlacemarkDescriptorProvider placemarkDescriptorProvider, boolean convertToVertices, char delimiterChar); static VectorDataNode read(String sourceName, Reader reader, Product product, FeatureUtils.FeatureCrsProvider crsProvider,
                                      PlacemarkDescriptorProvider placemarkDescriptorProvider, CoordinateReferenceSystem modelCrs,
                                      char delimiterChar, ProgressMonitor pm); static VectorDataNode read(String sourceName, Reader reader, Product product, FeatureUtils.FeatureCrsProvider crsProvider,
                                      PlacemarkDescriptorProvider placemarkDescriptorProvider, CoordinateReferenceSystem modelCrs,
                                      char delimiterChar, boolean convertToVertices, ProgressMonitor pm);  }