Package org.geotools.feature

Examples of org.geotools.feature.TypeBuilder


     */
    public static FeatureType createExample01MultiValuedComplexProperty(
            FeatureTypeFactory typeFactory) {
        FeatureType wqPlusType;

        TypeBuilder builder = new TypeBuilder(typeFactory);
        builder.setNamespaceURI(NSURI);

        builder.setName("sitename");
        builder.setBinding(String.class);
        AttributeType SITENAME = builder.attribute();

        builder.setName("anzlic_noType");
        builder.setBinding(String.class);
        AttributeType ANZLIC_NO = builder.attribute();

        builder.setName("locationType");
        builder.setBinding(Point.class);
        GeometryType LOCATION = builder.geometry();

        // build complex attribute
        AttributeType MEASUREMENT = createMeasurementType(typeFactory);

        builder.setName("project_noType");
        builder.setBinding(String.class);
        AttributeType PROJECT_NO = builder.attribute();

        builder.setName("wq_plus");

        builder.cardinality(1, 1);
        builder.addAttribute("sitename", SITENAME);

        builder.cardinality(0, 1);
        builder.addAttribute("anzlic_no", ANZLIC_NO);

        builder.cardinality(0, 1);
        builder.addAttribute("location", LOCATION);

        builder.cardinality(0, Integer.MAX_VALUE);
        builder.addAttribute("measurement", MEASUREMENT);

        builder.cardinality(0, 1);
        builder.addAttribute("project_no", PROJECT_NO);

        wqPlusType = builder.feature();

        return wqPlusType;
    }
View Full Code Here


     * @param descFactory
     * @return
     */
    public static FeatureType createExample02MultipleMultivalued(FeatureTypeFactory typeFactory) {

        TypeBuilder builder = new TypeBuilder(typeFactory);
        builder.setNamespaceURI(NSURI);

        AttributeType measurement = createMeasurementType(typeFactory);
        AttributeType the_geom = builder.name("the_geom").bind(Geometry.class).attribute();
        AttributeType sitename = builder.name("sitename").bind(String.class).attribute();

        builder.cardinality(0, Integer.MAX_VALUE);
        builder.addAttribute("measurement", measurement);

        builder.cardinality(1, 1);
        builder.addAttribute("the_geom", the_geom);

        builder.nillable(true);
        builder.cardinality(1, Integer.MAX_VALUE);
        builder.addAttribute("sitename", sitename);

        builder.setName("wq_plus");
        FeatureType wqPlusType = builder.feature();
        return wqPlusType;
    }
View Full Code Here

     * @param typeFactory
     * @param descFactory
     * @return
     */
    public static FeatureType createExample03MultipleGeometries(FeatureTypeFactory typeFactory) {
        TypeBuilder builder = new TypeBuilder(typeFactory);
        builder.setNamespaceURI(NSURI);

        AttributeType measurement = createMeasurementType(typeFactory);

        AttributeType gmlLocationAssociation = createGmlLocation(typeFactory);

        AttributeType gmlPointAssociation = createGmlPoint(typeFactory);

        builder.setName("wq_plus");
        builder.cardinality(0, Integer.MAX_VALUE);
        builder.addAttribute("measurement", measurement);

        builder.cardinality(1, 1);
        builder.nillable(true);
        builder.addAttribute("location", gmlLocationAssociation);

        builder.cardinality(1, 1);
        builder.nillable(true);
        builder.addAttribute("nearestSlimePit", gmlPointAssociation);

        builder.cardinality(1, Integer.MAX_VALUE);
        builder.addAttribute("sitename", String.class);

        // use the second geometry attribute as the default one just for testing
        builder.defaultGeometry("nearestSlimePit");

        FeatureType wqPlusType = builder.feature();

        return wqPlusType;
    }
View Full Code Here

     * @param typeFactory
     * @param descFactory
     * @return
     */
    public static FeatureType createExample04Type(FeatureTypeFactory typeFactory) {
        TypeBuilder builder = new TypeBuilder(typeFactory);
        builder.setNamespaceURI(NSURI);

        builder.cardinality(1, Integer.MAX_VALUE);
        builder.addAttribute("name", String.class);

        builder.setName(GML_NSURI);
        builder.cardinality(1, Integer.MAX_VALUE);
        builder.addAttribute("name", String.class);

        builder.setNamespaceURI(NSURI);
        builder.setName("wq_plus");

        FeatureType wqPlusType = builder.feature();
        return wqPlusType;
    }
View Full Code Here

        FeatureType wqPlusType = builder.feature();
        return wqPlusType;
    }

    public static ComplexType createMeasurementType(FeatureTypeFactory typeFactory) {
        TypeBuilder builder = new TypeBuilder(typeFactory);
        builder.setNamespaceURI(NSURI);

        builder.setName("determinand_description");
        builder.setBinding(String.class);
        AttributeType detdesc = builder.attribute();

        builder.setName("result");
        builder.setBinding(String.class);

        AttributeType result = builder.attribute();

        builder.setName("measurementType");
        builder.cardinality(1, 1);
        builder.addAttribute("determinand_description", detdesc);
        builder.addAttribute("result", result);

        ComplexType measurement = builder.complex();

        return measurement;
    }
View Full Code Here

     * DefaultTypeRegistry, etc.
     *
     * @return
     */
    public static AttributeType createGmlLocation(FeatureTypeFactory typeFactory) {
        TypeBuilder builder = new TypeBuilder(typeFactory);
        builder.setNamespaceURI(GML_NSURI);
        builder.setName("LocationPropertyType");
        builder.setBinding(Point.class);

        AttributeType type = builder.geometry();

        return type;
    }
View Full Code Here

     * GML3TypeRegistry, DefaultTypeRegistry, etc.
     *
     * @return
     */
    public static AttributeType createGmlPoint(FeatureTypeFactory typeFactory) {
        TypeBuilder builder = new TypeBuilder(typeFactory);
        builder.setNamespaceURI(GML_NSURI);

        builder.setName("PointPropertyType");
        CoordinateReferenceSystem fakeCrs = null;
        try {
            fakeCrs = CRS.decode("EPSG:4326");
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException(e);
        }
        builder.setCRS(fakeCrs);
        builder.setBinding(Point.class);

        GeometryType type = builder.geometry();
        return type;
    }
View Full Code Here

     * @return FeatureType
     */
    public static FeatureType createExample05NoNamespaceURI(FeatureTypeFactory typeFactory) {
        FeatureType wqPlusType;

        TypeBuilder builder = new TypeBuilder(typeFactory);

        builder.setName("sitename");
        builder.setBinding(String.class);
        AttributeType SITENAME = builder.attribute();

        builder.setName("anzlic_noType");
        builder.setBinding(String.class);
        AttributeType ANZLIC_NO = builder.attribute();

        builder.setName("locationType");
        builder.setBinding(Point.class);
        GeometryType LOCATION = builder.geometry();

        // build complex attribute
        AttributeType MEASUREMENT = createMeasurementType(typeFactory);

        builder.setName("project_noType");
        builder.setBinding(String.class);
        AttributeType PROJECT_NO = builder.attribute();

        builder.setName("wq_plus");

        builder.cardinality(1, 1);
        builder.addAttribute("sitename", SITENAME);

        builder.cardinality(0, 1);
        builder.addAttribute("anzlic_no", ANZLIC_NO);

        builder.cardinality(0, 1);
        builder.addAttribute("location", LOCATION);

        builder.cardinality(0, Integer.MAX_VALUE);
        builder.addAttribute("measurement", MEASUREMENT);

        builder.cardinality(0, 1);
        builder.addAttribute("project_no", PROJECT_NO);

        wqPlusType = builder.feature();

        return wqPlusType;
    }
View Full Code Here

     *
     * @return
     */
    public static FeatureType createComplexWaterQualityType() {
        FeatureTypeFactory tfac = new UniqueNameFeatureTypeFactoryImpl();
        TypeBuilder builder = new TypeBuilder(tfac);

        FeatureType wq_plusType;

        AttributeType detdesc = builder.name("determinand_description").bind(String.class)
                .attribute();
        AttributeType result = builder.name("result").bind(Float.class).attribute();

        builder.setName("measurement");
        builder.addAttribute("determinand_description", detdesc);
        builder.addAttribute("result", result);

        ComplexType MEASUREMENT = builder.complex();

        /*
         * <li>sitename <li>anzlic_no <li>project_no <li>location <li>measurement
         * (0..*) <ul> <li>determinand_description</li> <li>result</li>
         * </ul>
         */

        AttributeType sitename = builder.name("sitename").bind(String.class).attribute();
        AttributeType anzlic_no = builder.name("anzlic_no").bind(String.class).attribute();
        AttributeType project_no = builder.name("project_no").bind(String.class).attribute();
        AttributeType location = builder.name("location").bind(Point.class).geometry();

        builder.setName("wq_plus");
        builder.addAttribute("sitename", sitename);
        builder.addAttribute("anzlic_no", anzlic_no);
        builder.addAttribute("project_no", project_no);

        builder.cardinality(0, Integer.MAX_VALUE);
        builder.addAttribute("measurement", MEASUREMENT);

        builder.cardinality(1, 1);
        builder.addAttribute("location", location);

        wq_plusType = builder.feature();

        return wq_plusType;
    }
View Full Code Here

        return wq_plusType;
    }

    public static FeatureType createComplexWaterSampleType() {
        FeatureTypeFactory tfac = new UniqueNameFeatureTypeFactoryImpl();
        TypeBuilder builder = new TypeBuilder(tfac);

        FeatureType sampleType;

        AttributeType parameter = builder.name("parameter").bind(String.class).attribute();
        AttributeType value = builder.name("value").bind(Double.class).attribute();

        builder.setName("measurement");
        builder.addAttribute("parameter", parameter);
        builder.addAttribute("value", value);
        ComplexType MEASUREMENT = builder.complex();

        builder.setName("sample");
        builder.cardinality(0, Integer.MAX_VALUE);
        builder.addAttribute("measurement", MEASUREMENT);

        sampleType = builder.feature();

        return sampleType;
    }
View Full Code Here

TOP

Related Classes of org.geotools.feature.TypeBuilder

Copyright © 2018 www.massapicom. 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.