Package org.geotools.feature.simple

Examples of org.geotools.feature.simple.SimpleFeatureTypeBuilder.minOccurs()


        }
       
        for ( int i = 0; i < names.size(); i++ ) {
            String attName = names.get( i );
            if ( mandatory.contains( attName ) ) {
                b.minOccurs( 1 );
                b.nillable(false);
            }
            if ( "description".equalsIgnoreCase( attName) ) {
                b.length( 5000 );
            }
View Full Code Here


            if (Geometry.class.isAssignableFrom(theClass) && crs != null) {
                ftBuilder.crs(crs);
            }

            // create the type
            ftBuilder.minOccurs(min).maxOccurs(max).add(property.getName(), theClass);

            //set the default geometry explicitly. Note we're comparing the GML namespace
            //with String.startsWith to catch up on the GML 3.2 namespace too, which is hacky.
            final String propNamespace = property.getTargetNamespace();
            if (Geometry.class.isAssignableFrom(theClass)
View Full Code Here

            this.band = band;
            this.classification = classification;

            SimpleFeatureTypeBuilder tb = new SimpleFeatureTypeBuilder();
            for (AttributeDescriptor att : zones.getSchema().getAttributeDescriptors()) {
                tb.minOccurs(att.getMinOccurs());
                tb.maxOccurs(att.getMaxOccurs());
                tb.restrictions(att.getType().getRestrictions());
                if (att instanceof GeometryDescriptor) {
                    GeometryDescriptor gatt = (GeometryDescriptor) att;
                    tb.crs(gatt.getCoordinateReferenceSystem());
View Full Code Here

            this.dataAttribute = dataAttribute;
            this.data = data;

            SimpleFeatureTypeBuilder tb = new SimpleFeatureTypeBuilder();
            for (AttributeDescriptor att : zones.getSchema().getAttributeDescriptors()) {
                tb.minOccurs(att.getMinOccurs());
                tb.maxOccurs(att.getMaxOccurs());
                tb.restrictions(att.getType().getRestrictions());
                if (att instanceof GeometryDescriptor) {
                    GeometryDescriptor gatt = (GeometryDescriptor) att;
                    tb.crs(gatt.getCoordinateReferenceSystem());
View Full Code Here

            typeBuilder.setName(sourceFeatureType.getName().getLocalPart());
            typeBuilder.setNamespaceURI(sourceFeatureType.getName().getNamespaceURI());
            for (PropertyDescriptor attbType : sourceFeatureType.getDescriptors()) {
                typeBuilder.add((AttributeDescriptor) attbType);
            }
            typeBuilder.minOccurs(1).maxOccurs(1).nillable(false).add("lrs_measure", Double.class);
            typeBuilder
                    .setDefaultGeometry(sourceFeatureType.getGeometryDescriptor().getLocalName());
            return typeBuilder.buildFeatureType();
        } catch (Exception e) {
            LOGGER.warning("Error creating type: " + e);
View Full Code Here

                    typeBuilder.add(geomAttbType.getLocalName(), Point.class);
                } else {
                    typeBuilder.add((AttributeDescriptor) attbType);
                }
            }
            typeBuilder.minOccurs(1).maxOccurs(1).nillable(false).add("nearest_distance",
                    Double.class);
            typeBuilder.minOccurs(1).maxOccurs(1).nillable(false).add("nearest_bearing",
                    Double.class);
            typeBuilder
                    .setDefaultGeometry(sourceFeatureType.getGeometryDescriptor().getLocalName());
View Full Code Here

                    typeBuilder.add((AttributeDescriptor) attbType);
                }
            }
            typeBuilder.minOccurs(1).maxOccurs(1).nillable(false).add("nearest_distance",
                    Double.class);
            typeBuilder.minOccurs(1).maxOccurs(1).nillable(false).add("nearest_bearing",
                    Double.class);
            typeBuilder
                    .setDefaultGeometry(sourceFeatureType.getGeometryDescriptor().getLocalName());
            return typeBuilder.buildFeatureType();
        } catch (Exception e) {
View Full Code Here

                    GeometryDescriptor gd = (GeometryDescriptor) ad;
                    Class<?> binding = ad.getType().getBinding();
                    if(Point.class.isAssignableFrom(binding)) {
                        tb.add(ad);
                    } else {
                        tb.minOccurs(ad.getMinOccurs());
                        tb.maxOccurs(ad.getMaxOccurs());
                        tb.nillable(ad.isNillable());
                        tb.add(ad.getLocalName(), Point.class, gd.getCoordinateReferenceSystem());
                    }
                } else {
View Full Code Here

            typeBuilder.setName(sourceFeatureType.getName().getLocalPart());
            typeBuilder.setNamespaceURI(sourceFeatureType.getName().getNamespaceURI());
            for (PropertyDescriptor attbType : sourceFeatureType.getDescriptors()) {
                typeBuilder.add((AttributeDescriptor) attbType);
            }
            typeBuilder.minOccurs(1).maxOccurs(1).nillable(false).add("nearest_distance",
                    Double.class);
            typeBuilder.minOccurs(1).maxOccurs(1).nillable(false).add("nearest_bearing",
                    Double.class);
            typeBuilder
                    .setDefaultGeometry(sourceFeatureType.getGeometryDescriptor().getLocalName());
View Full Code Here

            for (PropertyDescriptor attbType : sourceFeatureType.getDescriptors()) {
                typeBuilder.add((AttributeDescriptor) attbType);
            }
            typeBuilder.minOccurs(1).maxOccurs(1).nillable(false).add("nearest_distance",
                    Double.class);
            typeBuilder.minOccurs(1).maxOccurs(1).nillable(false).add("nearest_bearing",
                    Double.class);
            typeBuilder
                    .setDefaultGeometry(sourceFeatureType.getGeometryDescriptor().getLocalName());
            return typeBuilder.buildFeatureType();
        } catch (Exception e) {
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.