Package org.geotools.feature.type

Examples of org.geotools.feature.type.GeometryDescriptorImpl


      return new GeometryTypeImpl( new NameImpl( "dummygeomtype" ), clazz, null, false, false, null, null, null );
    }
   
    public static GeometryDescriptor createGeometryDescriptor( GeometryType geometryType )
    {
      return new GeometryDescriptorImpl( geometryType, new NameImpl( "dummygeom" ), 0, 1, true, null );
    }
View Full Code Here


            int maxOccurs = descriptor.getMaxOccurs();
            boolean nillable = descriptor.isNillable();
            // TODO: handle default value
            Object defaultValue = null;
            if (type instanceof GeometryType) {
                descriptor = new GeometryDescriptorImpl((GeometryType) type, name, minOccurs,
                        maxOccurs, nillable, defaultValue);
            } else {
                descriptor = new AttributeDescriptorImpl(type, name, minOccurs, maxOccurs,
                        nillable, defaultValue);
            }
View Full Code Here

            GeometryType geomType = new GeometryTypeImpl(origType.getName(), origType.getBinding(),
                    crs, origType.isIdentified(), origType.isAbstract(),
                    origType.getRestrictions(), origType.getSuper(), origType.getDescription());
            geomType.getUserData().putAll(origType.getUserData());

            descriptor = new GeometryDescriptorImpl(geomType, descriptor.getName(), descriptor
                    .getMinOccurs(), descriptor.getMaxOccurs(), descriptor.isNillable(),
                    ((GeometryDescriptor) descriptor).getDefaultValue());
            descriptor.getUserData().putAll(descriptor.getUserData());
        }
        return new GeometryAttributeImpl(value, descriptor, buildSafeGmlObjectId(id));
View Full Code Here

        MemoryDataStore memDS = new MemoryDataStore();

        List<AttributeDescriptor> attrs = new ArrayList<AttributeDescriptor>();
        attrs.addAll(typ.getAttributeDescriptors());

        GeometryDescriptorImpl geom2Descr = new GeometryDescriptorImpl(typ.getGeometryDescriptor()
                .getType(), new NameImpl("the_geom5"), typ.getGeometryDescriptor().getMinOccurs(),
                typ.getGeometryDescriptor().getMaxOccurs(), typ.getGeometryDescriptor()
                        .isNillable(), typ.getGeometryDescriptor().getDefaultValue());
        attrs.add(geom2Descr);
        geom2Descr = new GeometryDescriptorImpl(typ.getGeometryDescriptor().getType(),
                new NameImpl("the_geom10"), typ.getGeometryDescriptor().getMinOccurs(), typ
                        .getGeometryDescriptor().getMaxOccurs(), typ.getGeometryDescriptor()
                        .isNillable(), typ.getGeometryDescriptor().getDefaultValue());
        attrs.add(geom2Descr);
        geom2Descr = new GeometryDescriptorImpl(typ.getGeometryDescriptor().getType(),
                new NameImpl("the_geom20"), typ.getGeometryDescriptor().getMinOccurs(), typ
                        .getGeometryDescriptor().getMaxOccurs(), typ.getGeometryDescriptor()
                        .isNillable(), typ.getGeometryDescriptor().getDefaultValue());
        attrs.add(geom2Descr);

        geom2Descr = new GeometryDescriptorImpl(typ.getGeometryDescriptor().getType(),
                new NameImpl("the_geom50"), typ.getGeometryDescriptor().getMinOccurs(), typ
                        .getGeometryDescriptor().getMaxOccurs(), typ.getGeometryDescriptor()
                        .isNillable(), typ.getGeometryDescriptor().getDefaultValue());
        attrs.add(geom2Descr);
View Full Code Here

    private static MemoryDataStore createMemStoreMixed(SimpleFeatureType typ, String name,
            String fname) throws IOException {
        MemoryDataStore memDS = new MemoryDataStore();
        List<AttributeDescriptor> attrs = new ArrayList<AttributeDescriptor>();
        attrs.addAll(typ.getAttributeDescriptors());
        GeometryDescriptorImpl geom2Descr = new GeometryDescriptorImpl(typ.getGeometryDescriptor()
                .getType(), new NameImpl("the_geom2"), typ.getGeometryDescriptor().getMinOccurs(),
                typ.getGeometryDescriptor().getMaxOccurs(), typ.getGeometryDescriptor()
                        .isNillable(), typ.getGeometryDescriptor().getDefaultValue());
        attrs.add(geom2Descr);
        SimpleFeatureTypeImpl sft = new SimpleFeatureTypeImpl(new NameImpl(fname), attrs, typ
View Full Code Here

    /**
    * Test extracting geometry from geometryattribute should be successful.
    */
    public void testGeometry() {
      Geometry geometry = new EmptyGeometry();
    GeometryAttribute geoatt = new GeometryAttributeImpl(geometry, new GeometryDescriptorImpl(new GeometryTypeImpl(new NameImpl(""), EmptyGeometry.class, null, false, false, null, null, null), new NameImpl(""), 0, 0, false, null), null);
    Geometry geometry2 = Converters.convert(geoatt, Geometry.class);
       assertTrue(geometry == geometry2);
    }
View Full Code Here

            Class clazz = type(type);
            if (Geometry.class.isAssignableFrom(clazz)) {
                GeometryType at = new GeometryTypeImpl(new NameImpl(name), clazz, crs, false,
                        false, Collections.EMPTY_LIST, null, null);
                return new GeometryDescriptorImpl(at, new NameImpl(name), 0, 1, nillable, null);
            } else {
                AttributeType at = new AttributeTypeImpl(new NameImpl(name), clazz, false, false,
                        Collections.EMPTY_LIST, null, null);
                return new AttributeDescriptorImpl(at, new NameImpl(name), 0, 1, nillable, null);
            }
View Full Code Here

      GeometryType curvedType = new GeometryTypeImpl(type.getName(),
          MultiCurvedGeometry.class, type.getCoordinateReferenceSystem(),
          type.isIdentified(), type.isAbstract(),
          type.getRestrictions(), type.getSuper(),
          type.getDescription());
      return new GeometryDescriptorImpl(curvedType, gd.getName(),
          gd.getMinOccurs(), gd.getMaxOccurs(), gd.isNillable(),
          gd.getDefaultValue());
        } else if (LineString.class.isAssignableFrom(binding)) {
              GeometryType curvedType = new GeometryTypeImpl(type.getName(),
                      CurvedGeometry.class, type.getCoordinateReferenceSystem(),
                      type.isIdentified(), type.isAbstract(),
                      type.getRestrictions(), type.getSuper(),
                      type.getDescription());
              return new GeometryDescriptorImpl(curvedType, gd.getName(),
                      gd.getMinOccurs(), gd.getMaxOccurs(), gd.isNillable(),
                      gd.getDefaultValue());
        } else {
      return gd;
    }
View Full Code Here

                        geometryClass, geomType.getCoordinateReferenceSystem(),
                        geomType.isIdentified(), geomType.isAbstract(),
                        geomType.getRestrictions(), geomType.getSuper(),
                        geomType.getDescription());
   
                builder.add(new GeometryDescriptorImpl(gt,
                        geomDescriptor.getName(), geomDescriptor.getMinOccurs(),
                        geomDescriptor.getMaxOccurs(), geomDescriptor.isNillable(),
                        geomDescriptor.getDefaultValue()));
            } else {
                builder.add(desc);
View Full Code Here

   
        GeometryType gt = new GeometryTypeImpl(new NameImpl("GEOMETRY"),
                Geometry.class, crs, false, false, Collections.EMPTY_LIST, null,
                null);
   
        builder.add(new GeometryDescriptorImpl(gt, new NameImpl("GEOMETRY"), 0, 1,
                false, null));
   
        FeatureType fType = builder.buildFeatureType();
        List<FeatureType> layers = new ArrayList<FeatureType>();
        layers.add(fType);
View Full Code Here

TOP

Related Classes of org.geotools.feature.type.GeometryDescriptorImpl

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.