Package org.opengis.feature.type

Examples of org.opengis.feature.type.AttributeDescriptor


    }

    @Override
    public void validate() throws IllegalAttributeException {
        for (int i = 0; i < getAttributeCount(); i++) {
            AttributeDescriptor descriptor = getType().getDescriptor(i);
            Types.validate(descriptor, getAttribute(i));
        }
    }
View Full Code Here


     */
    class AttributeList extends AbstractList<Property> {

        @Override
        public Property get(int index) {
            AttributeDescriptor descriptor = featureType.getDescriptor(index);
            if (descriptor instanceof GeometryDescriptor) {
                return new SimpleGeometryAttribute(index);
            }
            return new Attribute(index);
        }
View Full Code Here

        for (int i = 1; i < featureChanges.size(); i++) {
            String[] tokens = featureChanges.get(i).split("\t");
            Preconditions.checkArgument(tokens.length == 2, "Wrong attribute definition: "
                    + featureChanges.get(i));
            String fieldName = tokens[0];
            AttributeDescriptor desc = ft.getDescriptor(fieldName);
            Preconditions.checkNotNull(desc, "Wrong attribute in feature description");
            FieldType type = FieldType.forBinding(desc.getType().getBinding());
            Object value = TextValueSerializer.fromString(type, tokens[1]);
            ftb.set(tokens[0], value);
        }
        return ftb.buildFeature(featureId);
    }
View Full Code Here

                cli.getConsole().println(
                        "The GeoJSON file '" + geoJSON + "' could not be found, skipping...");
                continue;
            }
            if (fidAttribute != null) {
                AttributeDescriptor attrib = dataStore.getSchema(dataStore.getNames().get(0))
                        .getDescriptor(fidAttribute);
                if (attrib == null) {
                    throw new InvalidParameterException(
                            "The specified attribute does not exist in the selected GeoJSON file");
                }
View Full Code Here

                cli.getConsole().println(
                        "The shapefile '" + shp + "' could not be found, skipping...");
                continue;
            }
            if (fidAttribute != null) {
                AttributeDescriptor attrib = dataStore.getSchema(dataStore.getNames().get(0))
                        .getDescriptor(fidAttribute);
                if (attrib == null) {
                    throw new InvalidParameterException(
                            "The specified attribute does not exist in the selected shapefile");
                }
View Full Code Here

            // creates a GeometryAttributeType disregarding the class binding
            if (Geometry.class.isAssignableFrom(typeClass)) {
                b.setCRS(metadata);
            }

            AttributeDescriptor buildDescriptor = b.buildDescriptor(attName);
            attDescriptors.add(buildDescriptor);
        }

        return attDescriptors;
    }
View Full Code Here

        builder.setName(typeName);
        builder.setNamespaceURI(namespace);

        for (Iterator<AttributeDescriptor> it = properties.iterator(); it.hasNext();) {
            AttributeDescriptor attType = it.next();
            builder.add(attType);
        }

        return builder.buildFeatureType();
    }
View Full Code Here

                    table = createSeTable(connection, qualifiedName, HACK_COL_NAME, configKeyword);
                    tableCreated = true;

                    final List<AttributeDescriptor> atts = featureType.getAttributeDescriptors();
                    AttributeDescriptor currAtt;

                    for (Iterator<AttributeDescriptor> it = atts.iterator(); it.hasNext();) {
                        currAtt = it.next();

                        if (currAtt instanceof GeometryDescriptor) {
View Full Code Here

      }else
        values[k] = value[i].getValue();
    }

    private boolean isMatch(ElementValue[] value, SimpleFeatureType ft, int i, int k) {
      AttributeDescriptor AttributeDescriptor = ft.getDescriptor(k);
      String typeName = ft.getTypeName();
     
      if( !AttributeDescriptor.getLocalName().equals(typeName) )
        return false;
     
      Class instanceClass = value[i].getValue().getClass();
     
      if( AttributeDescriptor instanceof ChoiceAttributeType ){
          ChoiceAttributeType choiceAT=(ChoiceAttributeType) AttributeDescriptor;
        Class[] choices = choiceAT.getChoices();
        for (int j = 0; j < choices.length; j++) {
          if( choices[j].isAssignableFrom(instanceClass))
            return true;
        }
      }
      return AttributeDescriptor.getType().getBinding().isAssignableFrom(instanceClass);
    }
View Full Code Here

        {
            final Transaction transaction = new DefaultTransaction("testModifyFeaturesTransaction");
            store.setTransaction(transaction);

            try {
                final AttributeDescriptor propDescriptor = schema.getDescriptor("INT32_COL");
                store.modifyFeatures(propDescriptor.getName(), Integer.valueOf(-1000),
                        oldValueFilter);
                transaction.commit();
            } catch (Exception e) {
                transaction.rollback();
            } finally {
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.