Examples of FeatureId


Examples of org.opengis.filter.identity.FeatureId

     * @throws Exception
     */
    public void testTable() throws Exception {
        SimpleFeatureSource table = store.getFeatureSource("table");
        // GenericEntity.f004=description-f004|name-f004
        FeatureId fid1 = ff.featureId("GenericEntity.f004");
        Filter select = ff.id(Collections.singleton(fid1));
        SimpleFeatureCollection featureCollection = table.getFeatures(select);
        featureCollection.accepts(new FeatureVisitor() {
            public void visit(Feature f) {
                SimpleFeature feature = (SimpleFeature) f;
View Full Code Here

Examples of org.opengis.filter.identity.FeatureId

        SimpleFeatureStore roadAuto = (SimpleFeatureStore) store.getFeatureSource("road");
        List<FeatureId> fids = roadAuto.addFeatures(DataUtilities.collection(chrisFeature));

        // checke the id was preserved
        assertEquals(1, fids.size());
        FeatureId fid = SimpleFeatureBuilder.createDefaultFeatureIdentifier("fid5");
        assertTrue(fids.contains(fid));

        // manually check the feature with the proper id is actually there
        SimpleFeatureIterator it = roadAuto.getFeatures(ff.id(Collections.singleton(fid)))
                .features();
View Full Code Here

Examples of org.opengis.filter.identity.FeatureId

    /**
     * Test converting String to FeatureId successful. This is required by feature chaining.
     * @throws Exception
     */
    public void testFeatureId() throws Exception {
        FeatureId id = Converters.convert("blah", FeatureId.class);
        assertNotNull(id);
        assertEquals(id.getID(), "blah");
    }
View Full Code Here

Examples of org.opengis.filter.identity.FeatureId

    }

    public Object getProperty(Object object, QName name)
        throws Exception {
        if ("fid".equals(name.getLocalPart())) {
            FeatureId featureId = (FeatureId) object;

            //&lt;xsd:attribute name="fid" type="xsd:anyURI" use="required"/&gt;
            if (featureId != null) {
                return new URI(featureId.getID());
            }
        }

        return null;
    }
View Full Code Here

Examples of org.opengis.filter.identity.FeatureId

        List<FeatureId> newFids = featureStore.addFeatures(collection);
        assertEquals(1, newFids.size());
        // this.assertFidsMatch();

        Query query = new Query(schema.getTypeName());
        FeatureId id = newFids.iterator().next();
        String fid = id.getID();

        Filter filter = fac.id(Collections.singleton(id));
        query.setFilter(filter);
        SimpleFeatureIterator features = featureStore.getFeatures(query).features();
        try {
View Full Code Here

Examples of org.opengis.filter.identity.FeatureId

        for (Iterator iter = fids.entrySet().iterator(); iter.hasNext();) {
            i++;
            Map.Entry entry = (Map.Entry) iter.next();
            String fid = (String) entry.getKey();
            FeatureId id = fac.featureId(fid);
            Filter filter = fac.id(Collections.singleton(id));
            query.setFilter(filter);
            SimpleFeatureIterator features = null;
            try {
              features = featureStore.getFeatures(query).features();
View Full Code Here

Examples of org.opengis.filter.identity.FeatureId

    }

    public void testParse() throws Exception {
        FilterMockData.featureId(document, document);

        FeatureId featureId = (FeatureId) parse();
        assertEquals("foo", featureId.getID());
    }
View Full Code Here

Examples of org.opengis.filter.identity.FeatureId

        if (mapping.getFeatureIdExpression().equals(Expression.NIL)) {
            // no real feature id mapping,
            // so let's find by database row id
            Set<FeatureId> ids = new HashSet<FeatureId>();
            FeatureId featureId = namespaceAwareFilterFactory.featureId(fId);
            ids.add(featureId);
            fidFilter = namespaceAwareFilterFactory.id(ids);
        } else {
            // in case the expression is wrapped in a function, eg. strConcat
            // that's why we don't always filter by id, but do a PropertyIsEqualTo
View Full Code Here

Examples of org.opengis.filter.identity.FeatureId

        if (!added.isEmpty()) {
            FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
            InsertedFeatureType inserted = factory.createInsertedFeatureType();
            tr.getInsertResults().getFeature().add(inserted);
            for (String addedId : added) {
                FeatureId featureId = ff.featureId(addedId);
                inserted.getFeatureId().add(featureId);
            }
        }

        Configuration configuration = getStrategy().getWfsConfiguration();
View Full Code Here

Examples of org.opengis.filter.identity.FeatureId

        FilterFactory2 ffac = CommonFactoryFinder.getFilterFactory2(GeoTools.getDefaultHints());
        Set fids = new HashSet();
        try {
            while (iter.hasNext()) {
                String id = iter.next().getID();
                FeatureId fid = ffac.featureId(id);
                fids.add(fid);
            }
            Id filter = ffac.id(fids);
            return filter;
        } finally {
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.