Package org.geotools.feature

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


        b.setBinding( String.class );
        b.setName( "_id" );
        b.setNillable( false );
        b.setDefaultValue( null );
        b.setLength( 1024 );
        AttributeDescriptor a = b.buildDescriptor( "_id" );
        builder.add( a );

        // We could get this out of the table, exercise for the reader... TODO
        try
        {
View Full Code Here


            log.warning( "Unknown geometry for layer " + layerName
                    + " (but has valid distinct geometry.type)" );
            return;
        }

        a = b.buildDescriptor( "geometry" );
        builder.add( a );

        // Add the 2 known keywords...
        keywords.add( "_id" );
        keywords.add( "geometry" );
View Full Code Here

                b.setName( propName );
                b.setBinding( dbcol.getClass() );
                b.setNillable( true );
                b.setDefaultValue( null );
                b.setLength( 1024 );
                AttributeDescriptor a = b.buildDescriptor( propName );
                builder.add( a );

                // add attrs for nested JSON or Array objects
                if (dbcol instanceof BasicDBObject || dbcol instanceof BasicBSONList)
                {
View Full Code Here

                if( descriptor instanceof GeometryDescriptor ){
                    GeometryDescriptor geometryDescriptor = (GeometryDescriptor) descriptor;
                    AttributeTypeBuilder adjust = new AttributeTypeBuilder( b.factory );
                    adjust.init( geometryDescriptor );
                    adjust.setCRS( crs );
                    b.add( adjust.buildDescriptor( geometryDescriptor.getLocalName() ));
                    continue;
                }
                b.add( descriptor);
            }           
            return b.buildFeatureType();
View Full Code Here

           
            //add attributes in order
            for( AttributeDescriptor descriptor : original.getAttributeDescriptors() ){
                AttributeTypeBuilder ab = new AttributeTypeBuilder( b.factory );
                ab.init( descriptor );
                b.add( ab.buildDescriptor( descriptor.getLocalName() ));
            }           
            return b.buildFeatureType();
        }
}
View Full Code Here

        ab.setName(name);
        if (computedCRS != null) {
            ab.setCRS(computedCRS);
        }

        return ab.buildDescriptor(name);
    }
   
    /**
     * Computes the output attribute descriptor for this {@link Definition} given only the original feature type.
     * The code will attempt a static analysis on the original
View Full Code Here

                // the geometry crs are not getting modified by the filter functions
                expression.accept(typeEvaluator, null);
                ab.setCRS(typeEvaluator.getCoordinateReferenceSystem());
            }

            return ab.buildDescriptor(name);
        } else {
            // in case no evaluation succeeds
            Class computedBinding = Object.class;

            // see if we are just passing a property trough
View Full Code Here

                    throw new IllegalArgumentException(
                            "Original feature type does not have a property named " + name);
                } else {
                    ab.init(descriptor);
                    ab.setName(name);
                    return ab.buildDescriptor(name);
                }
            } else {
                // try static analysis
                computedBinding = (Class) expression.accept(typeEvaluator, null);
                if(computedBinding == null) {
View Full Code Here

                ab.setName(name);
                if (computedCRS != null) {
                    ab.setCRS(computedCRS);
                }

                return ab.buildDescriptor(name);
            }
        }
    }

    private CoordinateReferenceSystem evaluateCRS(SimpleFeature originalFeature) {
View Full Code Here

                        try {
                            if (srid != null) {
                                ab.setCRS(CRS.decode("EPSG:" + srid));
                                ab.setName(attribute.getName());
                                ab.setBinding(attribute.getType());
                                att = ab.buildDescriptor(attribute.getName(),
                                        ab.buildGeometryType());
                                if (attribute.isDefaultGeometry() != null
                                        && attribute.isDefaultGeometry()) {
                                    defaultGeometryName = attribute.getName();
                                }
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.