Examples of AttributeDescriptor


Examples of org.opengis.feature.type.AttributeDescriptor

                return f.getID();

            if (columnIndex >= fType.getAttributeCount()) {
                return null;
            }
            AttributeDescriptor at = fType.getDescriptor(columnIndex - 1);
            if (at == null)
                return null;
            if ( at instanceof GeometryDescriptor ) {
                String s = f.getAttribute(columnIndex - 1).getClass().getName();
                return s.substring(s.lastIndexOf('.') + 1);
View Full Code Here

Examples of org.opengis.feature.type.AttributeDescriptor

  public final Object getAttribute( int index ) {
        return getAttribute(featureType.getDescriptor(index).getName().getLocalPart());
    }

    public final Object getAttribute( String xPath ) {
      AttributeDescriptor type=featureType.getDescriptor(xPath);
     
      if( type instanceof GeometryDescriptor ){
      return findTransformedGeometry(xPath);
      }
       
View Full Code Here

Examples of org.opengis.feature.type.AttributeDescriptor

    @Override
    public List<Object> getAttributes() {
        List<Object> attributes = new ArrayList<Object>( delegate.getAttributes());
        for (int i = 0; i < attributes.size(); i++) {
            Object object = attributes.get(i);
            AttributeDescriptor attributeType = delegate.getFeatureType().getDescriptor(i);
           
           
            int index = indexOf( featureType, attributeType.getName().getLocalPart() );
            if( index==-1 )
                continue;
            if( attributeType instanceof GeometryDescriptor ){
                attributes.set(index,findTransformedGeometry(attributeType.getName().getLocalPart()));
            }else{
                attributes.set(index,object);
            }
        }
        return attributes;
View Full Code Here

Examples of org.opengis.feature.type.AttributeDescriptor

            }
            if (expression instanceof PropertyName) {
                PropertyName name = (PropertyName) expression;
                if( input != null && input.getSchema() != null ){
                    SimpleFeatureType schema = input.getSchema();
                    AttributeDescriptor descriptor = schema.getDescriptor(name.getPropertyName());
                    if (descriptor != null) {
                        Class<?> binding = descriptor.getType().getBinding();
                        if (Number.class.isAssignableFrom(binding)) {
                            return Appropriate.APPROPRIATE.getScore();
                        }
                    }
                }
View Full Code Here

Examples of org.opengis.feature.type.AttributeDescriptor

                FeatureUtils.stringToId(filterFactory,feature2.getID()));

        this.oldValue = feature2.getAttribute(xpath);
        feature2.setAttribute(xpath, value);

        AttributeDescriptor attributeType = layer.getSchema().getDescriptor(xpath);
        resource.modifyFeatures(attributeType, value, fidFilter);
    }
View Full Code Here

Examples of org.opengis.feature.type.AttributeDescriptor

    public void rollback( IProgressMonitor monitor ) throws Exception {
        SimpleFeature feature = editFeature.get(monitor);
        feature.setAttribute(xpath, oldValue);
        ILayer layer = editLayer.get(monitor);
        FeatureStore<SimpleFeatureType, SimpleFeature> resource = layer.getResource(FeatureStore.class, null);
        AttributeDescriptor attributeType = layer.getSchema().getDescriptor(xpath);
        FilterFactory filterFactory = CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
    Id id = filterFactory.id(
                FeatureUtils.stringToId(filterFactory, feature.getID()));
        resource.modifyFeatures(attributeType, oldValue, id);
    }
View Full Code Here

Examples of org.opengis.feature.type.AttributeDescriptor

    }

    @Override
    public void setAttribute( int index, Object value ) {
        SimpleFeatureType schema = getFeatureType();
        AttributeDescriptor attribute = schema.getAttributeDescriptors().get(index);
        String name = attribute.getLocalName();
        SetAttributeCommand sync = new SetAttributeCommand(name, value);
        dirty.add(name);
        manager.getMap().sendCommandASync(sync);
    }
View Full Code Here

Examples of org.opengis.feature.type.AttributeDescriptor

     * @param type attribute descriptor
     */
    private Object toDefaultValue( PropertyDescriptor descriptor ) {
        Object value = null;
        if( descriptor instanceof AttributeDescriptor ){
            AttributeDescriptor attributeDescriptor = (AttributeDescriptor) descriptor;
            value = attributeDescriptor.getDefaultValue();
            if( value != null ){
                return value;
            }
        }
        Class< ? > type = descriptor.getType().getBinding();
View Full Code Here

Examples of org.opengis.feature.type.AttributeDescriptor

            SimpleFeature f = (SimpleFeature) element;           
            if (columnIndex == 0) return f.getID();
            if( owningFeatureTableControl.features==null )
                return ""; //$NON-NLS-1$
            String attName = owningFeatureTableControl.getViewer().getTable().getColumn(columnIndex).getText();
            AttributeDescriptor at = f.getFeatureType().getDescriptor(attName);
            if (Geometry.class.isAssignableFrom(at.getType().getBinding())) { //was at.isGeometry()
                Object att = f.getAttribute(attName);
                if( att==null )
                    return ""; //$NON-NLS-1$
                String s =
                    att.getClass().getName();
View Full Code Here

Examples of org.opengis.feature.type.AttributeDescriptor

   */
  public String getAttributeName(int attIndex) {

    assert attIndex < getAttributeCount();

    AttributeDescriptor attributeType = featureType.getDescriptor(attIndex);

    return attributeType.getLocalName();
  }
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.