Package org.geotools.feature

Examples of org.geotools.feature.AttributeTypeBuilder.buildDescriptor()


        build.setBinding(geometryClass);

        GeometryType geometryType = build.buildGeometryType();

        List<AttributeDescriptor> attributes = new ArrayList<AttributeDescriptor>();
        attributes.add(build.buildDescriptor(BasicFeatureTypes.GEOMETRY_ATTRIBUTE_NAME, geometryType));

        if (extraPropertyNames != null) {
            Set<String> usedNames = new HashSet<String>();
            // record names in case of duplicates
            usedNames.add(BasicFeatureTypes.GEOMETRY_ATTRIBUTE_NAME);
View Full Code Here


                    usedNames.add(propertyName);

                    build.setNillable(true);
                    build.setBinding(String.class);

                    attributes.add(build.buildDescriptor(propertyName));
                }
            }
        }

        return attributes;
View Full Code Here

                if ( rebuild ) {
                    //rebuild with proper crs
                    AttributeTypeBuilder b = new AttributeTypeBuilder();
                    b.init(old);
                    b.setCRS( getCRS(info.getSRS()) );
                    ad = b.buildDescriptor(old.getLocalName());
                }
            }
            catch( Exception e ) {
                //log exception
            }
View Full Code Here

        //@todo improve FeatureTypeBuilder to support this directly
        AttributeDescriptor existing = builder.remove(field);
        AttributeTypeBuilder attBuilder = new AttributeTypeBuilder();
        attBuilder.init(existing);
        attBuilder.setBinding(type);
        builder.add(index, attBuilder.buildDescriptor(field));

        return builder.buildFeatureType();
    }

    public SimpleFeature apply(ImportTask task, DataStore dataStore, SimpleFeature oldFeature,
View Full Code Here

        typeBuilder.setName(convertTypeName(featureType.getTypeName()));

        AttributeTypeBuilder attBuilder = new AttributeTypeBuilder();
        for (AttributeDescriptor att : featureType.getAttributeDescriptors()) {
            attBuilder.init(att);
            typeBuilder.add(attBuilder.buildDescriptor(convertAttributeName(att.getLocalName())));
        }
       
        return typeBuilder.buildFeatureType();
    }
View Full Code Here

        SimpleFeatureTypeBuilder typeBuilder = new SimpleFeatureTypeBuilder();
        typeBuilder.setName("badatts");

        AttributeTypeBuilder attBuilder = new AttributeTypeBuilder();
        attBuilder.setBinding(String.class);
        typeBuilder.add(attBuilder.buildDescriptor("123_number_first"));
        attBuilder.setBinding(String.class);
        typeBuilder.add(attBuilder.buildDescriptor("i has spaces"));

        SimpleFeatureType badatts = typeBuilder.buildFeatureType();
        badatts = FeatureDataConverter.DEFAULT.convertType(badatts, null, null, null);
View Full Code Here

        AttributeTypeBuilder attBuilder = new AttributeTypeBuilder();
        attBuilder.setBinding(String.class);
        typeBuilder.add(attBuilder.buildDescriptor("123_number_first"));
        attBuilder.setBinding(String.class);
        typeBuilder.add(attBuilder.buildDescriptor("i has spaces"));

        SimpleFeatureType badatts = typeBuilder.buildFeatureType();
        badatts = FeatureDataConverter.DEFAULT.convertType(badatts, null, null, null);

        assertEquals("_123_number_first", badatts.getAttributeDescriptors().get(0).getLocalName());
View Full Code Here

    AttributeTypeBuilder attBuilder = new AttributeTypeBuilder();
    builder.add(toGeometryAttribute(iShapeType, crs,attBuilder));
    builder.setDefaultGeometry("geom");
    for (int i = 0; i < sFields.length; i++) {
      AttributeType type = attBuilder.binding(fields[i]).buildType();
      AttributeDescriptor descriptor = attBuilder.buildDescriptor(sFields[i], type);
      builder.add(descriptor);
    }
    return builder.buildFeatureType();
   
  }
View Full Code Here

            return gsft;
        }

        public AttributeDescriptor getFeatureDescriptor() {
            AttributeTypeBuilder builder = new AttributeTypeBuilder();
            AttributeDescriptor descriptor = builder.buildDescriptor(new NameImpl(GS_NAMESPACE, "Record"), delegate.getFeatureType());
            return descriptor;
        }

        public String getOutputSchema() {
            return delegate.getOutputSchema();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.