Package org.geotools.feature

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


                        }

                    } else {
                        ab.setName(attribute.getName());
                        ab.setBinding(attribute.getType());
                        att = ab.buildDescriptor(attribute.getName(), ab.buildType());
                    }
                    tb.add(att);
                }
            }
            if (defaultGeometryName != null) {
View Full Code Here


                        || (!delegate.getSchema().getGeometryDescriptor().equals(descriptor))) {
                    tb.add(descriptor);
                } else {
                    AttributeTypeBuilder builder = new AttributeTypeBuilder();
                    builder.setBinding(MultiPolygon.class);
                    AttributeDescriptor attributeDescriptor = builder.buildDescriptor(descriptor
                            .getLocalName(), builder.buildType());
                    tb.add(attributeDescriptor);
                    if(tb.getDefaultGeometry() == null) {
                        tb.setDefaultGeometry(descriptor.getLocalName());
                    }
View Full Code Here

        builder.setNillable(geometryType.isNillable());

        // builder.setDefaultValue(defaultValue);
        builder.setCRS(crs);

        geometry = builder
                .buildDescriptor(geometryType.getLocalName(), builder.buildGeometryType());

        if (defaultGeometryType == null || geometryType == schema.getGeometryDescriptor()) {
            defaultGeometryType = geometry;
        }
View Full Code Here

        AttributeTypeBuilder builder = new AttributeTypeBuilder();
        builder.setName("the_geom");
        builder.setBinding(binding);
        builder.setCRS(first.features().next().getFeatureType().getCoordinateReferenceSystem());
        AttributeDescriptor descriptor = builder.buildDescriptor("the_geom");
        return descriptor;
    }

    /**
     * Delegate that will compute the intersections on the go
View Full Code Here

                builder.setBinding(descriptor.getType().getBinding());
                builder.setMinOccurs(descriptor.getMinOccurs());
                builder.setMaxOccurs(descriptor.getMaxOccurs());
                builder.setDefaultValue(descriptor.getDefaultValue());
                builder.setCRS(schema.getCoordinateReferenceSystem());
                AttributeDescriptor intersectionDescriptor = builder.buildDescriptor(schema
                        .getName().getLocalPart() + "_" + descriptor.getName(),
                        descriptor.getType());
                tb.add(intersectionDescriptor);
                tb.addBinding(descriptor.getType());
            }
View Full Code Here

            if ((override != null) && types[i] instanceof GeometryDescriptor) {
                AttributeTypeBuilder ab = new AttributeTypeBuilder();
                ab.init(types[i]);
                ab.setCRS(override);
                types[i] = ab.buildDescriptor(types[i].getLocalName(), ab.buildGeometryType());
            }
        }

        if (typeName == null)
            typeName = featureType.getTypeName();
View Full Code Here

                    builder.setMinOccurs(descriptor.getMinOccurs());
                    builder.setMaxOccurs(descriptor.getMaxOccurs());
                    builder.setDefaultValue(descriptor.getDefaultValue());
                    builder.setCRS(this.delegate.features().next().getFeatureType()
                            .getCoordinateReferenceSystem());
                    AttributeDescriptor attributeDescriptor = builder.buildDescriptor(descriptor
                            .getName(), builder.buildType());
                    tb.add(attributeDescriptor);
                } else {
                    tb.add(descriptor);
                }
View Full Code Here

                    ab.setCRS(crs);
                    if(srid != null) {
                        ab.addUserData(JDBCDataStore.JDBC_NATIVE_SRID, srid);
                    }
                    ab.addUserData(Hints.COORDINATE_DIMENSION, dimension);
                    att = ab.buildDescriptor(name, ab.buildGeometryType());
                } else {
                    //add the attribute
                    ab.setName(name);
                    ab.setBinding(binding);
                    att = ab.buildDescriptor(name, ab.buildType());
View Full Code Here

                    att = ab.buildDescriptor(name, ab.buildGeometryType());
                } else {
                    //add the attribute
                    ab.setName(name);
                    ab.setBinding(binding);
                    att = ab.buildDescriptor(name, ab.buildType());
                }
                // mark primary key columns
                if (pkey.getColumn(att.getLocalName()) != null) {
                    att.getUserData().put(JDBCDataStore.JDBC_PRIMARY_KEY_COLUMN, true);
                }
View Full Code Here

       
        // make up a fake attribute with the same name, something that might happen
        // in chains of retyping where attributes are rebuilt
        AttributeTypeBuilder ab = new AttributeTypeBuilder();
        ab.binding(Point.class);
        AttributeDescriptor madeUp = ab.buildDescriptor(aname("geometry"));
       
        featureStore.modifyFeatures(new AttributeDescriptor[] { madeUp },
            new Object[] { point }, Filter.INCLUDE);

        SimpleFeatureCollection features = featureStore.getFeatures();
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.