Package org.geotools.feature

Examples of org.geotools.feature.GeometryAttributeImpl


      return new GeometryDescriptorImpl( geometryType, new NameImpl( "dummygeom" ), 0, 1, true, null );
    }
   
    public static GeometryAttribute createGeometryAttribute( GeometryDescriptor geometryDescriptor, Geometry geometry )
    {
      GeometryAttributeImpl geometryAttribute = new GeometryAttributeImpl( null, geometryDescriptor, null );
      geometryAttribute.setValue( geometry );
     
      return geometryAttribute;
    }
View Full Code Here


    public GeometryAttribute getDefaultGeometryProperty() {
        GeometryDescriptor geometryDescriptor = featureType.getGeometryDescriptor();
        GeometryAttribute geometryAttribute = null;
        if (geometryDescriptor != null) {
            Object defaultGeometry = getDefaultGeometry();
            geometryAttribute = new GeometryAttributeImpl(defaultGeometry, geometryDescriptor, null);
        }
        return geometryAttribute;
    }
View Full Code Here

            return null;
        } else {
            Integer index = nameToRevTypeIndex.get(name).intValue();
            if (descriptor instanceof GeometryDescriptor) {
                Object value = getAttribute(index);
                return new GeometryAttributeImpl(value, (GeometryDescriptor) descriptor, null);
            } else {
                return new Attribute(index);
            }
        }
    }
View Full Code Here

                .getAttribute(backendGeomPropertyName) : feature.getAttribute(name);
        AttributeDescriptor attrDescr = featureTyp.getDescriptor(name);
        if (attrDescr == null)
            return null;
        if (attrDescr instanceof GeometryDescriptor)
            return new GeometryAttributeImpl(value, (GeometryDescriptor) attrDescr, null);
        else
            return new AttributeImpl(value, attrDescr, null);

    }
View Full Code Here

        return feature.getBounds();
    }

    public GeometryAttribute getDefaultGeometryProperty() {
        Object value = feature.getAttribute(backendGeomPropertyName);
        GeometryAttribute attr = new GeometryAttributeImpl(value, featureTyp
                .getGeometryDescriptor(), null);
        return attr;
    }
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

                        }
                        GeometryDescriptor geomDescriptor = typeFactory.createGeometryDescriptor(
                                geomType, rootName, parentDescriptor.getMinOccurs(),
                                parentDescriptor.getMaxOccurs(), parentDescriptor.isNillable(),
                                parentDescriptor.getDefaultValue());
                        GeometryAttributeImpl geom = new GeometryAttributeImpl(value,
                                geomDescriptor, null);
                        ArrayList<Property> geomAtts = new ArrayList<Property>();
                        geomAtts.add(geom);
                        parent.setValue(geomAtts);
                        return geom;
View Full Code Here

    public GeometryAttribute getDefaultGeometryProperty() {
        GeometryDescriptor geometryDescriptor = featureType.getGeometryDescriptor();
        GeometryAttribute geometryAttribute = null;
        if(geometryDescriptor != null){
            Object defaultGeometry = getDefaultGeometry();
            geometryAttribute = new GeometryAttributeImpl(defaultGeometry, geometryDescriptor, null);           
        }
        return geometryAttribute;
    }
View Full Code Here

            return null;
        } else {
            int index = idx.intValue();
            AttributeDescriptor descriptor = featureType.getDescriptor(index);
            if(descriptor instanceof GeometryDescriptor){
                return new GeometryAttributeImpl(values[index], (GeometryDescriptor) descriptor, null);
            }else{
                return new Attribute( index );
            }
        }
    }
View Full Code Here

      Collection<Property> value = new ArrayList<Property>();
     
      for (PropertyDescriptor pd : schema.getDescriptors()) {
        if (pd instanceof AttributeDescriptor) {
          if (pd instanceof GeometryDescriptor) {
            value.add(new GeometryAttributeImpl (((AttributeDescriptor) pd).getDefaultValue(), (GeometryDescriptor) pd, null) );
          } else {
            value.add(new AttributeImpl (((AttributeDescriptor) pd).getDefaultValue(), (AttributeDescriptor) pd, null) );
          }
        }               
        }
View Full Code Here

TOP

Related Classes of org.geotools.feature.GeometryAttributeImpl

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.