org.geotools.index.quadtree.QuadTree.getRoot()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(86)

本文整理了Java中org.geotools.index.quadtree.QuadTree.getRoot方法的一些代码示例,展示了QuadTree.getRoot的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QuadTree.getRoot方法的具体详情如下:
包路径:org.geotools.index.quadtree.QuadTree
类名称:QuadTree
方法名:getRoot

QuadTree.getRoot介绍

暂无

代码示例

代码示例来源:origin: org.geotools/gt-shapefile

private void printStats(QuadTree tree) throws StoreException {
  Map<Integer, Integer> stats = new HashMap<Integer, Integer>();
  gatherStats(tree.getRoot(), stats);
    List<Integer> nums = new ArrayList<Integer>(stats.keySet());
  Collections.sort(nums);
  LOGGER.log(Level.FINE, "Index statistics");
  for (Integer num : nums) {
    LOGGER.log(Level.FINE, num + " -> "  + stats.get(num));
  }
  }

代码示例来源:origin: org.geotools/gt-shapefile-old

private void printStats(QuadTree tree) throws StoreException {
  Map<Integer, Integer> stats = new HashMap<Integer, Integer>();
  gatherStats(tree.getRoot(), stats);
    List<Integer> nums = new ArrayList<Integer>(stats.keySet());
  Collections.sort(nums);
  LOGGER.log(Level.FINE, "Index statistics");
  for (Integer num : nums) {
    LOGGER.log(Level.FINE, num + " -> "  + stats.get(num));
  }
  }

代码示例来源:origin: org.geotools/gt-shapefile

public LazySearchIterator(QuadTree tree, Envelope bounds) {
  super();
  this.tree = tree;
  this.indexfile = tree.getIndexfile();
  tree.registerIterator(this);
  this.current = tree.getRoot();
  this.bounds = bounds;
  this.closed = false;
  this.next = null;
  this.indexfile = indexfile;
}

代码示例来源:origin: org.geotools/gt-shapefile-old

public LazySearchIterator(QuadTree tree, Envelope bounds) {
  super();
  this.tree = tree;
  this.indexfile = tree.getIndexfile();
  tree.registerIterator(this);
  this.current = tree.getRoot();
  this.bounds = bounds;
  this.closed = false;
  this.next = null;
  this.indexfile = indexfile;
}

代码示例来源:origin: org.geotools/gt2-shapefile-renderer

/**
 * QuadTree Query
 * 
 * @param bbox
 * @return
 * @throws DataSourceException
 * @throws IOException
 * @throws TreeException DOCUMENT ME!
 */
Collection queryQuadTree( Envelope bbox ) throws DataSourceException, IOException, TreeException {
  Collection tmp = null;
  try {
    // old code was checking the resulting collection wasn't empty and it that
    // case it closed the qtree straight away. qtree gets closed anyways with
    // this code path, but it's quite a bit faster because it avoid one disk access
    // just to check the collection is not empty
    if ((qtree != null) && !bbox.contains(qtree.getRoot().getBounds()))
      return qtree.search(bbox);
  }catch (Exception e) {
    ShapefileRenderer.LOGGER.warning(e.getLocalizedMessage());
  }
  return null;
}

代码示例来源:origin: org.geotools/gt2-shapefile

public Iterator iterator() {
  LazySearchIterator object;
  try {
    object = new LazySearchIterator(tree.getRoot().copy(), tree.getIndexfile(), bounds);
  } catch (IOException e) {
    throw new RuntimeException(e);
  }
  tree.registerIterator(object);
  return object;
}

代码示例来源:origin: org.geotools/gt-shapefile

public CachedQuadTree(QuadTree tree) throws IOException {
  offsets = new Indices();
  this.root = cloneAndTranslate(tree.getRoot(), tree.getIndexfile());
}

代码示例来源:origin: org.geotools/gt-shapefile-renderer

/**
 * QuadTree Query
 * 
 * @param bbox
 * @return
 * @throws DataSourceException
 * @throws IOException
 * @throws TreeException
 *                 DOCUMENT ME!
 */
CloseableIterator<Data> queryQuadTree(Envelope bbox) throws DataSourceException,
    IOException, TreeException {
  try {
    // old code was checking the resulting collection wasn't empty and
    // it that
    // case it closed the qtree straight away. qtree gets closed anyways
    // with
    // this code path, but it's quite a bit faster because it avoid one
    // disk access
    // just to check the collection is not empty
    if ((qtree != null) && !bbox.contains(qtree.getRoot().getBounds()))
      return qtree.search(bbox);
  } catch (Exception e) {
    ShapefileRenderer.LOGGER.warning(e.getLocalizedMessage());
  }
  return null;
}

代码示例来源:origin: org.geotools/gt-shapefile-old

public CachedQuadTree(QuadTree tree) throws IOException {
  offsets = new Indices();
  this.root = cloneAndTranslate(tree.getRoot(), tree.getIndexfile());
}

代码示例来源:origin: org.geotools/gt-shapefile

this.writeNode(tree.getRoot(), channel, order);
} catch (IOException e) {
  throw new StoreException(e);

代码示例来源:origin: org.geotools/gt2-shapefile

this.writeNode(tree.getRoot(), channel, order);
} catch (IOException e) {
  throw new StoreException(e);

代码示例来源:origin: org.geotools/gt-shapefile-old

this.writeNode(tree.getRoot(), channel, order);
} catch (IOException e) {
  throw new StoreException(e);

代码示例来源:origin: org.geotools/gt2-shapefile

/**
 * QuadTree Query
 *
 * @param bbox
 *
 *
 * @throws DataSourceException
 * @throws IOException
 * @throws TreeException
 *             DOCUMENT ME!
 */
private Collection queryQuadTree(Envelope bbox) throws DataSourceException,
    IOException, TreeException {
  Collection tmp = null;
  try {
    QuadTree quadTree=openQuadTree();
    if ((quadTree != null) && !bbox.contains(quadTree.getRoot().getBounds())) {
      tmp = quadTree.search(bbox);
      
      if( tmp==null || !tmp.isEmpty())
        return tmp;
    }
    if( quadTree!=null )
      quadTree.close();
  }catch (Exception e) {
    throw new DataSourceException("Error querying QuadTree", e);
  }
  return null;
}

代码示例来源:origin: org.geotools/gt-shapefile-old

LOGGER.fine("Optimizing the tree (this might take some time)");
optimizeTree(tree, tree.getRoot(), 0, reader, shpIndex);
if (LOGGER.isLoggable(Level.FINE)) {
  LOGGER.fine("Tree optimized");

代码示例来源:origin: org.geotools/gt-shapefile

LOGGER.fine("Optimizing the tree (this might take some time)");
optimizeTree(tree, tree.getRoot(), 0, reader, shpIndex);
if (LOGGER.isLoggable(Level.FINE)) {
  LOGGER.fine("Tree optimized");

代码示例来源:origin: org.geotools/gt-shapefile

QuadTree quadTree = openQuadTree();
if ((quadTree != null)
    && !bbox.contains(quadTree.getRoot().getBounds())) {
  tmp = quadTree.search(bbox);

代码示例来源:origin: org.geotools/gt-shapefile-old

QuadTree quadTree = openQuadTree();
if ((quadTree != null)
    && !bbox.contains(quadTree.getRoot().getBounds())) {
  tmp = quadTree.search(bbox);

相关文章