Package com.vividsolutions.jts.index.strtree

Examples of com.vividsolutions.jts.index.strtree.STRtree


    return true;
  }

  private void buildIndex()
  {
    index = new STRtree();

    for (int i = 0; i < rings.size(); i++) {
      LinearRing ring = (LinearRing) rings.get(i);
      Envelope env = ring.getEnvelopeInternal();
      index.insert(env, ring);
View Full Code Here


     * into groups of close geometries.
     * This makes unioning more efficient, since vertices are more likely
     * to be eliminated on each round.
     */
//    STRtree index = new STRtree();
    STRtree index = new STRtree(STRTREE_NODE_CAPACITY);
    for (Iterator i = inputPolys.iterator(); i.hasNext(); ) {
      Geometry item = (Geometry) i.next();
      index.insert(item.getEnvelopeInternal(), item);
    }
    List itemTree = index.itemsTree();

//    printItemEnvelopes(itemTree);
   
    Geometry unionAll = unionTree(itemTree);
    return unionAll;
View Full Code Here

    // handle empty geometries
    if (inputGeom.isEmpty()) {
      return;
    }
   
    STRtree geomTree = FacetSequenceTreeBuilder.build(inputGeom);
   
    Object[] nearest = geomTree.nearestNeighbour(new MinClearanceDistance());
    MinClearanceDistance mcd = new MinClearanceDistance();
    minClearance = mcd.distance(
        (FacetSequence) nearest[0],
        (FacetSequence) nearest[1]);
    minClearancePts = mcd.getCoordinates();
View Full Code Here

  // Seems to be better to use a minimum node capacity
  private static final int STR_TREE_NODE_CAPACITY = 4;

  public static STRtree build(Geometry g) {
    STRtree tree = new STRtree(STR_TREE_NODE_CAPACITY);
    List sections = computeFacetSequences(g);
    for (Iterator i = sections.iterator(); i.hasNext();) {
      FacetSequence section = (FacetSequence) i.next();
      tree.insert(section.getEnvelope(), section);
    }
    tree.build();
    return tree;
  }
View Full Code Here

   *
   * @return the computed distance
   */
  public double getDistance(Geometry g)
  {
    STRtree tree2 = FacetSequenceTreeBuilder.build(g);
    Object[] obj = cachedTree.nearestNeighbour(tree2,
        new FacetSequenceDistance());
    return facetDistance(obj);
  }
View Full Code Here

        try {
            SpatialFilter.getJCSCache().clear();
        } catch (CacheException e) {
            e.printStackTrace();
        }
        _index = new STRtree();
        FeatureIterator<SimpleFeature> features = null;
        try {
            features = _featureStore.getFeatures().features();
            while (features.hasNext()) {
                SimpleFeature feature = features.next();
View Full Code Here

    return true;
  }

  private void buildIndex()
  {
    index = new STRtree();

    for (int i = 0; i < rings.size(); i++) {
      LinearRing ring = (LinearRing) rings.get(i);
      Envelope env = ring.getEnvelopeInternal();
      index.insert(env, ring);
View Full Code Here

     * into groups of close geometries.
     * This makes unioning more efficient, since vertices are more likely
     * to be eliminated on each round.
     */
//    STRtree index = new STRtree();
    STRtree index = new STRtree(STRTREE_NODE_CAPACITY);
    for (Iterator i = inputPolys.iterator(); i.hasNext(); ) {
      Geometry item = (Geometry) i.next();
      index.insert(item.getEnvelopeInternal(), item);
    }
    List itemTree = index.itemsTree();

//    printItemEnvelopes(itemTree);
   
    Geometry unionAll = unionTree(itemTree);
    return unionAll;
View Full Code Here

    // handle empty geometries
    if (inputGeom.isEmpty()) {
      return;
    }
   
    STRtree geomTree = FacetSequenceTreeBuilder.build(inputGeom);
   
    Object[] nearest = geomTree.nearestNeighbour(new MinClearanceDistance());
    MinClearanceDistance mcd = new MinClearanceDistance();
    minClearance = mcd.distance(
        (FacetSequence) nearest[0],
        (FacetSequence) nearest[1]);
    minClearancePts = mcd.getCoordinates();
View Full Code Here

  // Seems to be better to use a minimum node capacity
  private static final int STR_TREE_NODE_CAPACITY = 4;

  public static STRtree build(Geometry g) {
    STRtree tree = new STRtree(STR_TREE_NODE_CAPACITY);
    List sections = computeFacetSequences(g);
    for (Iterator i = sections.iterator(); i.hasNext();) {
      FacetSequence section = (FacetSequence) i.next();
      tree.insert(section.getEnvelope(), section);
    }
    tree.build();
    return tree;
  }
View Full Code Here

TOP

Related Classes of com.vividsolutions.jts.index.strtree.STRtree

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.