Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There is a code example here: <a href="http://docs.geotools.org/latest/userguide/library/main/collection.html#join" rel="nofollow">http://docs.geotools.org/latest/userguide/library/main/collection.html#join</a></p> <p>It shows how to nest loops:</p> <pre><code>void polygonInteraction() { SimpleFeatureCollection polygonCollection = null; SimpleFeatureCollection fcResult = null; final SimpleFeatureCollection found = FeatureCollections.newCollection(); FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(); SimpleFeature feature = null; Filter polyCheck = null; Filter andFil = null; Filter boundsCheck = null; String qryStr = null; SimpleFeatureIterator it = polygonCollection.features(); try { while (it.hasNext()) { feature = it.next(); BoundingBox bounds = feature.getBounds(); boundsCheck = ff.bbox(ff.property("the_geom"), bounds); Geometry geom = (Geometry) feature.getDefaultGeometry(); polyCheck = ff.intersects(ff.property("the_geom"), ff.literal(geom)); andFil = ff.and(boundsCheck, polyCheck); try { fcResult = featureSource.getFeatures(andFil); // go through results and copy out the found features fcResult.accepts(new FeatureVisitor() { public void visit(Feature feature) { found.add((SimpleFeature) feature); } }, null); } catch (IOException e1) { System.out.println("Unable to run filter for " + feature.getID() + ":" + e1); continue; } } } finally { it.close(); } } </code></pre> <p>If you want to ignore some features you have already visited, and skip content::</p> <pre><code>HashSet&lt;FeatureId&gt; skip = new HashSet&lt;FeatureId&gt;(); ... if( skip.contains( feature.getId() ) ) continue; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload