@Override public SimpleFeatureType apply( ImportTask task, DataStore dataStore, SimpleFeatureType featureType) throws Exception { return convertFeatureType(featureType); }
@Override public SimpleFeatureType apply(ImportTask task, DataStore dataStore, SimpleFeatureType featureType) throws Exception { return convertFeatureType(featureType); }
public SimpleFeatureType convertParsedFeatureType( SimpleFeatureType ft, String name, Set<String> untypedAttributes) { SimpleFeatureType transformedType = kmlTransform.convertFeatureType(ft); SimpleFeatureTypeBuilder ftb = new SimpleFeatureTypeBuilder(); ftb.init(transformedType); Set<String> existringAttrNames = new HashSet<String>(); for (AttributeDescriptor ad : ft.getAttributeDescriptors()) { existringAttrNames.add(ad.getLocalName()); } for (String attr : untypedAttributes) { if (!existringAttrNames.contains(attr)) { ftb.add(attr, String.class); } } ftb.setName(name); ftb.setCRS(KML_CRS); ftb.setSRS(KML_SRS); return ftb.buildFeatureType(); }
public SimpleFeatureType convertParsedFeatureType(SimpleFeatureType ft, String name, Set<String> untypedAttributes) { SimpleFeatureType transformedType = kmlTransform.convertFeatureType(ft); SimpleFeatureTypeBuilder ftb = new SimpleFeatureTypeBuilder(); ftb.init(transformedType); Set<String> existringAttrNames = new HashSet<String>(); for (AttributeDescriptor ad : ft.getAttributeDescriptors()) { existringAttrNames.add(ad.getLocalName()); } for (String attr : untypedAttributes) { if (!existringAttrNames.contains(attr)) { ftb.add(attr, String.class); } } ftb.setName(name); ftb.setCRS(KML_CRS); ftb.setSRS(KML_SRS); return ftb.buildFeatureType(); }
public void testFeatureType() throws Exception { SimpleFeatureType result = kmlPlacemarkTransform.convertFeatureType(origType); assertBinding(result, "LookAt", Point.class); assertBinding(result, "Region", LinearRing.class); assertBinding(result, "Folder", String.class); }