protected PointPlacemarkDescriptor(String featureTypeName) { this.baseFeatureType = Placemark.createPointFeatureType(featureTypeName ); }
public static SimpleFeatureType createGcpFeatureType() { return createPointFeatureType("org.esa.beam.GroundControlPoint"); }
public static SimpleFeatureType createPinFeatureType() { return createPointFeatureType("org.esa.beam.Pin"); }
public static SimpleFeatureType getExtendedFeatureType(SimpleFeatureType featureType) { final SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder(); builder.init(featureType); final SimpleFeatureType pointFeatureType = Placemark.createPointFeatureType( featureType.getName().getLocalPart()); for (AttributeDescriptor attributeDescriptor : pointFeatureType.getAttributeDescriptors()) { builder.add(attributeDescriptor); } List<AttributeDescriptor> attributeDescriptors = featureType.getAttributeDescriptors(); final SimpleFeatureType extendedFeatureType = builder.buildFeatureType(); extendedFeatureType.getUserData().put("originalAttributeDescriptors", attributeDescriptors); return extendedFeatureType; }
private void testThatPlacemarkDescriptorIsFound(String featureTypeName, String className, int expected) { PlacemarkDescriptorRegistry registry = PlacemarkDescriptorRegistry.getInstance(); SimpleFeatureType ft = Placemark.createPointFeatureType(featureTypeName); List<PlacemarkDescriptor> descriptors = registry.getPlacemarkDescriptors(ft); assertNotNull(descriptors); assertEquals(expected, descriptors.size()); assertTrue(descriptors.contains(registry.getPlacemarkDescriptor(className))); }
@Test public void testVectorDataNodeAndPlacemarkGroup() { Product p = new Product("p", "pt", 512, 512); ProductNodeGroup<VectorDataNode> vectorDataGroup = p.getVectorDataGroup(); Placemark placemark = Placemark.createPointPlacemark(PointDescriptor.getInstance(), "placemark_1", null, null, new PixelPos(10, 10), null, null); VectorDataNode vectorDataNode = new VectorDataNode("Features", Placemark.createPointFeatureType("feature")); FeatureCollection<SimpleFeatureType, SimpleFeature> featureCollection = vectorDataNode.getFeatureCollection(); vectorDataGroup.add(vectorDataNode); //Also: Sets the owner of the vectorDataNode vectorDataNode.getPlacemarkGroup(); //Also: Creates the PlacemarkGroup (owner has to be set!) featureCollection.add(placemark.getFeature()); assertEquals(1, vectorDataNode.getFeatureCollection().size()); assertEquals(vectorDataNode.getFeatureCollection().size(), vectorDataNode.getPlacemarkGroup().getNodeCount()); }