Package org.geotools.feature.type

Examples of org.geotools.feature.type.GeometryTypeImpl


      return createGeometryType( geometry.getClass() );
    }
   
    public static GeometryType createGeometryType( Class<? extends Geometry> clazz )
    {
      return new GeometryTypeImpl( new NameImpl( "dummygeomtype" ), clazz, null, false, false, null, null, null );
    }
View Full Code Here


    public GeometryAttribute createGeometryAttribute(Object value, GeometryDescriptor descriptor,
            String id, CoordinateReferenceSystem crs) {
        if (crs != null && !(crs.equals(descriptor.getCoordinateReferenceSystem()))) {
            // update CRS
            GeometryType origType = (GeometryType) descriptor.getType();
            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());
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

                        boolean nillable = actualDescriptor.isNillable();
                        if (actualDescriptor instanceof GeometryDescriptor) {
                            // important to maintain CRS information encoding
                            if (Geometry.class.isAssignableFrom(targetNodeType.getBinding())) {
                                if (!(targetNodeType instanceof GeometryType)) {
                                    targetNodeType = new GeometryTypeImpl(targetNodeType.getName(),
                                            targetNodeType.getBinding(), crs != null ? crs
                                                    : ((GeometryDescriptor) actualDescriptor)
                                                            .getCoordinateReferenceSystem(),
                                            targetNodeType.isIdentified(), targetNodeType
                                                    .isAbstract(),
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);
View Full Code Here

        if (!(type instanceof AttributeTypeProxy)
                && (Geometry.class.isAssignableFrom(type.getBinding()) || CurvedGeometry.class
                        .isAssignableFrom(type.getBinding()))) {
            // create geometry descriptor with the simple feature type CRS
            GeometryType geomType = new GeometryTypeImpl(type.getName(), type.getBinding(), crs,
                    type.isIdentified(), type.isAbstract(), type.getRestrictions(),
                    type.getSuper(), type.getDescription());
            descriptor = typeFactory.createGeometryDescriptor(geomType, elemName, minOccurs,
                    maxOccurs, nillable, defaultValue);
        } else {
View Full Code Here

  private GeometryDescriptor wrapGeometryDescriptor(GeometryDescriptor gd) {
    GeometryType type = gd.getType();
    Class<?> binding = type.getBinding();
        if (MultiLineString.class.isAssignableFrom(binding)) {
      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(),
View Full Code Here

                GeometryDescriptor geomDescriptor = (GeometryDescriptor) desc;
                GeometryType geomType = geomDescriptor.getType();
   
                Class<?> geometryClass = getGeometryForDimensionality(dimensionality);
   
                GeometryType gt = new GeometryTypeImpl(geomType.getName(),
                        geometryClass, geomType.getCoordinateReferenceSystem(),
                        geomType.isIdentified(), geomType.isAbstract(),
                        geomType.getRestrictions(), geomType.getSuper(),
                        geomType.getDescription());
   
View Full Code Here

        AttributeType at = new AttributeTypeImpl(new NameImpl("ID"), String.class,
                false, false, Collections.EMPTY_LIST, null, null);
        builder.add(new AttributeDescriptorImpl(at, new NameImpl("ID"), 0, 1,
                false, null));
   
        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));
View Full Code Here

TOP

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

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.