Package org.opengis.feature.type

Examples of org.opengis.feature.type.AttributeDescriptor


            // 1st pass check all named attributes are accounted for
            for( AttributeMatcher current : attributes ) {
                if (current.name == null) {
                    continue; // skip
                }
                AttributeDescriptor currentMatch = current.match(schema, matched);
                if (currentMatch == null) {
                    return NO_MATCH;
                }
                matched.add(currentMatch);
            }
            // section pass check unnamed attributes ... match default geometry type?
            for( AttributeMatcher current : attributes ) {
                if (current.name != null) {
                    continue;
                }
                accuracy++;

                AttributeDescriptor currentMatch = current.match(schema, matched);
                if (currentMatch == null) {
                    return NO_MATCH;
                }
                matched.add(currentMatch);
            }
View Full Code Here


         * @return
         */
        public AttributeDescriptor match( SimpleFeatureType featureType,
                List<AttributeDescriptor> used ) {
            if (name != null) {
                AttributeDescriptor attr = featureType.getDescriptor(name);
                if (type == null || attr == null)
                    return null;
                if (type != attr.getType().getBinding())
                    return null;
                return attr;
            }
            for( int i = 0; i < featureType.getAttributeCount(); i++ ) {
                if (!used.contains(featureType.getDescriptor(i))) {
View Full Code Here

        tableColumn.setText("FID"); //$NON-NLS-1$
        tableColumn.setWidth(100);

        if (fType != null) {
            for( int i = 0; i < fType.getAttributeCount(); i++ ) {
                AttributeDescriptor aType = fType.getDescriptor(i);
                if (table.getColumnCount() > i + 1) {
                    tableColumn = table.getColumn(i + 1);
                } else {
                    tableColumn = new TableColumn(table, SWT.CENTER | SWT.BORDER);
                }

                tableColumn.setText(aType.getLocalName());

                tableColumn.setWidth(100);
            }
            for( int i = fType.getAttributeCount() + 1; i < table.getColumnCount(); i++ ) {
                tableColumn = table.getColumn(i);
View Full Code Here

                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

  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

    @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

            }
            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

                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

    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

    }

    @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

TOP

Related Classes of org.opengis.feature.type.AttributeDescriptor

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.