Package org.geotools.feature.simple

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


                if( originalAttributeType == null && originalAttributeType instanceof GeometryType ) {
                    crs = ((GeometryType)originalAttributeType).getCoordinateReferenceSystem();
                } else {
                    crs = originalFeatureType.getCoordinateReferenceSystem();
                }
                build.crs(crs);
                build.add(name, binding);
            }
            else {
                build.add(name, binding);
            }
View Full Code Here


            AttributeDescriptor attribute = schema.getDescriptor(i);
            if (!(attribute instanceof GeometryDescriptor)) {
                builder.add(attribute);
            } else {
                GeometryDescriptor geom = schema.getGeometryDescriptor();
                builder.crs(crs).defaultValue(null).restrictions(geom.getType().getRestrictions())
                        .nillable(geom.isNillable()).add(geom.getLocalName(), geomBinding);
            }
        }

        return builder.buildFeatureType();
View Full Code Here

    }
   
    private static SimpleFeatureType createOptimalSchema(String featureTypeName) throws SchemaException {
      SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder();
      builder.setName(featureTypeName);
        builder.crs(DefaultGeographicCRS.WGS84).add("bounds", MultiPolygon.class);
        builder.length(128).nillable(true).add("description", String.class);
        builder.length(80).nillable(false).defaultValue("").add("extensionId", String.class);
        builder.length(80).nillable(true).add("groupId", String.class);
        builder.length(80).nillable(false).add("id", String.class);
        builder.length(1024).nillable(false).defaultValue("").add("memento", String.class);
View Full Code Here

    if (crs == null) {
        crs = DefaultGeographicCRS.WGS84;
    }
    SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder();
    builder.setName("test");
    builder.crs(crs).add("geom", Geometry.class);
    builder.setCRS(crs);
    builder.add("name", String.class);
    SimpleFeatureType ft = builder.buildFeatureType();
    int size = Math.max(geom.length, attributeValue.length);
    SimpleFeature[] features = new SimpleFeature[size];
View Full Code Here

            String name = child.getComponent().getName();
            Object valu = child.getValue();

            // if the next property is of type geometry, let's set its CRS
            if (Geometry.class.isAssignableFrom(valu.getClass()) && crs != null) {
                ftBuilder.crs(crs);
            }

            ftBuilder.add(name, (valu != null) ? valu.getClass() : Object.class);
        }
View Full Code Here

                max = 1;
            }

            // if the next property is of type geometry, let's set its CRS
            if (Geometry.class.isAssignableFrom(theClass) && crs != null) {
                ftBuilder.crs(crs);
            }

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

                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());
                }
                tb.add("z_" + att.getLocalName(), att.getType().getBinding());
            }
            if(classification != null) {
                tb.add("classification", Integer.class);
View Full Code Here

                GeometryDescriptor geometryType = (GeometryDescriptor) attributeType;
                AttributeDescriptor forced;

                tb.descriptor( geometryType );
                if ( !forceOnlyMissing || geometryType.getCoordinateReferenceSystem() == null ) {
                    tb.crs( crs );
                }

                tb.add( geometryType.getLocalName(), geometryType.getType().getBinding() );
            } else {
                tb.add(attributeType);
View Full Code Here

                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());
                }
                tb.add("z_" + att.getLocalName(), att.getType().getBinding());
            }
            AttributeDescriptor dataDescriptor = data.getSchema().getDescriptor(dataAttribute);
            tb.add("count", Long.class);
View Full Code Here

                    GeometryType geometryType = (GeometryType)originalAttributeType;
                    crs = geometryType.getCoordinateReferenceSystem();
                } else {
                    crs = origional.getCoordinateReferenceSystem();
                }
                build.crs(crs);
                build.add(name, binding);
            }
            else {
                build.add(name, binding);
            }
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.