Package org.opengis.feature

Examples of org.opengis.feature.Feature


                newValues.add(Optional.absent());
            }
        }
        RevFeature newFeature = RevFeatureImpl.build(ImmutableList.copyOf(newValues));
        FeatureBuilder featureBuilder = new FeatureBuilder(featureType);
        Feature feature = featureBuilder.build(node.name(), newFeature);
        return feature;
    }
View Full Code Here


                                .get();
                        featureTypes.put(newObject.getMetadataId(), featureType);
                    }

                    FeatureBuilder featureBuilder = new FeatureBuilder(featureType);
                    Feature feature = featureBuilder.build(diffEntry.newObjectId().toString(),
                            (RevFeature) revObject);
                    String name = diffEntry.newPath();
                    patch.addAddedFeature(name, feature, featureType);
                } else if (revObject instanceof RevTree) {
                    ObjectId metadataId = diffEntry.getNewObject().getMetadataId();
                    if (!metadataId.isNull()) {
                        RevFeatureType featureType = command(RevObjectParse.class)
                                .setObjectId(metadataId).call(RevFeatureType.class).get();
                        patch.addAlteredTree(diffEntry);
                        patch.addFeatureType(featureType);
                    }
                }
            } else if (diffEntry.changeType() == ChangeType.REMOVED) {
                RevObject revObject = command(RevObjectParse.class)
                        .setObjectId(diffEntry.oldObjectId()).call().get();
                if (revObject instanceof RevFeature) {
                    RevFeatureType featureType;
                    if (featureTypes.containsKey(oldObject.getMetadataId())) {
                        featureType = featureTypes.get(oldObject.getMetadataId());
                    } else {
                        featureType = command(RevObjectParse.class)
                                .setObjectId(oldObject.getMetadataId()).call(RevFeatureType.class)
                                .get();
                        featureTypes.put(oldObject.getMetadataId(), featureType);
                    }

                    FeatureBuilder featureBuilder = new FeatureBuilder(featureType);
                    Feature feature = featureBuilder.build(diffEntry.oldObjectId().toString(),
                            (RevFeature) revObject);
                    String name = diffEntry.oldPath();
                    patch.addRemovedFeature(name, feature, featureType);
                } else if (revObject instanceof RevTree) {
                    ObjectId metadataId = diffEntry.getOldObject().getMetadataId();
View Full Code Here

     * Computes the aggregated bounds of {@code features}, assuming all of them are in the same CRS
     */
    protected ReferencedEnvelope boundsOf(Feature... features) {
        ReferencedEnvelope bounds = null;
        for (int i = 0; i < features.length; i++) {
            Feature f = features[i];
            if (bounds == null) {
                bounds = (ReferencedEnvelope) f.getBounds();
            } else {
                bounds.include(f.getBounds());
            }
        }
        return bounds;
    }
View Full Code Here

    protected ReferencedEnvelope boundsOf(CoordinateReferenceSystem targetCrs, Feature... features)
            throws Exception {
        ReferencedEnvelope bounds = new ReferencedEnvelope(targetCrs);

        for (int i = 0; i < features.length; i++) {
            Feature f = features[i];
            BoundingBox fbounds = f.getBounds();
            if (!CRS.equalsIgnoreMetadata(targetCrs, fbounds)) {
                fbounds = fbounds.toBounds(targetCrs);
            }
            bounds.include(fbounds);
        }
View Full Code Here

    }

    @Test
    public void testNonAsciiCharacters() throws Exception {

        Feature feature = feature(featureType1, "TestType.feature.1", "геогит", Boolean.TRUE,
                Byte.valueOf("18"), new Double(100.01), new BigDecimal("1.89e1021"),
                new Float(12.5), new Integer(1000), new BigInteger("90000000"), "POINT(1 1)",
                new Long(800000), UUID.fromString("bd882d24-0fe9-11e1-a736-03b3c0d0d06d"));

        testFeatureReadWrite(feature);
View Full Code Here

     */
    public boolean filterObject(RevFeatureType type, String featurePath, RevObject object) {
        if (object.getType() == TYPE.FEATURE) {
            RevFeature revFeature = (RevFeature) object;
            FeatureBuilder builder = new FeatureBuilder(type);
            Feature feature = builder.build("TEMP_ID", revFeature);

            Filter typeFilter = repositoryFilters.get(featurePath);
            if (typeFilter == null) {
                typeFilter = repositoryFilters.get("default");
            }
View Full Code Here

    public void testExportDiff() throws Exception {
        insertAndAdd(points1);
        final RevCommit insertCommit = geogig.command(CommitOp.class).setAll(true).call();

        final String featureId = points1.getIdentifier().getID();
        final Feature modifiedFeature = feature((SimpleFeatureType) points1.getType(), featureId,
                "changedProp", new Integer(1500));
        insertAndAdd(modifiedFeature, points2);
        final RevCommit changeCommit = geogig.command(CommitOp.class).setAll(true).call();

        Feature[] points = new Feature[] { modifiedFeature, points2 };
View Full Code Here

    public void testExportDiffUsingOldVersion() throws Exception {
        insertAndAdd(points1);
        final RevCommit insertCommit = geogig.command(CommitOp.class).setAll(true).call();

        final String featureId = points1.getIdentifier().getID();
        final Feature modifiedFeature = feature((SimpleFeatureType) points1.getType(), featureId,
                "changedProp", new Integer(1500));
        insertAndAdd(modifiedFeature, points2);
        final RevCommit changeCommit = geogig.command(CommitOp.class).setAll(true).call();

        Feature[] points = new Feature[] { points1 };
View Full Code Here

                final RevFeature revFeature = (RevFeature) obj;
                final ObjectId id = obj.getId();
                List<String> list = fidIndex.get(id);
                final String fid = list.remove(0);

                Feature feature = featureBuilder.build(fid, revFeature);
                return (SimpleFeature) feature;
            }
View Full Code Here

        // ............|
        // ............o - points 1 modified
        // ............|
        // ............o - master - HEAD - Lines 1 modified
        // branch1 and master are conflicting
        Feature points1ModifiedB = feature(pointsType, idP1, "StringProp1_3", new Integer(2000),
                "POINT(1 1)");
        Feature points1Modified = feature(pointsType, idP1, "StringProp1_2", new Integer(1000),
                "POINT(1 1)");
        insertAndAdd(points1);
        runCommand(true, "commit -m Commit1");
        runCommand(true, "branch branch1");
        runCommand(true, "branch branch2");
View Full Code Here

TOP

Related Classes of org.opengis.feature.Feature

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.