Package org.opengis.feature.type

Examples of org.opengis.feature.type.Name


    /**
     * Inserts the feature to the index but does not stages it to be committed
     */
    protected ObjectId insert(GeoGIG geogig, Feature f) throws Exception {
        final WorkingTree workTree = geogig.getRepository().workingTree();
        Name name = f.getType().getName();
        String parentPath = name.getLocalPart();
        Node ref = workTree.insert(parentPath, f);
        ObjectId objectId = ref.getObjectId();
        return objectId;
    }
View Full Code Here


        return existed;
    }

    protected boolean delete(GeoGIG geogig, Feature f) throws Exception {
        final WorkingTree workTree = geogig.getRepository().workingTree();
        Name name = f.getType().getName();
        String localPart = name.getLocalPart();
        String id = f.getIdentifier().getID();
        boolean existed = workTree.delete(localPart, id);
        return existed;
    }
View Full Code Here

        @SuppressWarnings("unchecked")
        @Override
        public F next() {
            F next = super.next();
            String fid = ((SimpleFeature) next).getID();
            Name geometryAttributeName = builder.getFeatureType().getGeometryDescriptor().getName();
            builder.set(geometryAttributeName, next.getDefaultGeometryProperty().getValue());
            for (AttributeDescriptor attribute : builder.getFeatureType().getAttributeDescriptors()) {
                Name name = attribute.getName();
                if (!name.equals(geometryAttributeName)) {
                    Property property = next.getProperty(name);
                    if (property == null) {
                        throw new GeoToolsOpException(
                                GeoToolsOpException.StatusCode.INCOMPATIBLE_FEATURE_TYPE);
                    }
View Full Code Here

        }

        @Override
        public SimpleFeature apply(SimpleFeature input) {
            for (int i = 0; i < names.length; i++) {
                Name attName = names[i];
                Object attValue = values[i];
                input.setAttribute(attName, attValue);
            }
            input.getUserData().put(Hints.USE_PROVIDED_FID, Boolean.TRUE);
            return input;
View Full Code Here

    /**
     * @return the name of the feature type
     */
    @Override
    public Name getName() {
        Name name = type().getName();
        return name;
    }
View Full Code Here

        GeoGIG geogig = geogigCLI.newGeoGIG();
        try {
            final WorkingTree workTree = geogig.getRepository().workingTree();
            workTree.delete(points1.getType().getName());
            Name name = points1_FTmodified.getType().getName();
            String parentPath = name.getLocalPart();
            workTree.insert(parentPath, points1_FTmodified);
        } finally {
            geogig.close();
        }
    }
View Full Code Here

        List<ObjectId> ids = Lists.newArrayListWithCapacity(features.length);
        try {
            Repository repository = geogig.getRepository();
            final WorkingTree workTree = repository.workingTree();
            for (Feature f : features) {
                Name name = f.getType().getName();
                String parentPath = name.getLocalPart();
                Node ref = workTree.insert(parentPath, f);
                ObjectId objectId = ref.getObjectId();
                ids.add(objectId);
            }
        } finally {
View Full Code Here

    public static boolean delete(Feature f) throws Exception {
        GeoGIG geogig = geogigCLI.newGeoGIG();
        try {
            final WorkingTree workTree = geogig.getRepository().workingTree();
            Name name = f.getType().getName();
            String localPart = name.getLocalPart();
            String id = f.getIdentifier().getID();
            boolean existed = workTree.delete(localPart, id);
            return existed;
        } finally {
            geogig.close();
View Full Code Here

    @Override
    protected SimpleFeatureType buildFeatureType() throws IOException {

        SimpleFeatureType featureType = getNativeType();

        final Name name = featureType.getName();
        final Name assignedName = getEntry().getName();

        if (assignedName.getNamespaceURI() != null && !assignedName.equals(name)) {
            SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder();
            builder.init(featureType);
            builder.setName(assignedName);
            featureType = builder.buildFeatureType();
        }
View Full Code Here

    /**
     * @return
     */
    NodeRef getTypeRef() {
        GeoGigDataStore dataStore = getDataStore();
        Name name = getName();
        Transaction transaction = getTransaction();
        return dataStore.findTypeRef(name, transaction);
    }
View Full Code Here

TOP

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

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.