Examples of NodeIdentifier


Examples of org.geotools.caching.spatialindex.NodeIdentifier

     
      GridRootNode gn = g.getRootNode();
      tovisit.add(gn.getIdentifier());
      if (nodeids != null) {
            for( Iterator<NodeIdentifier> iterator = nodeids.iterator(); iterator.hasNext(); ) {
                NodeIdentifier id = (NodeIdentifier) iterator.next();
                if (id.isValid()) {
                    tovisit.add(id);
                }
            }
            init();
        }
View Full Code Here

Examples of org.geotools.caching.spatialindex.NodeIdentifier

      if (currentNodeIterator == null || !currentNodeIterator.hasNext()){
        if (tovisit.size() == 0){
          //nothing found; no other things to look at
          return null;
        }
        NodeIdentifier nodeid = tovisit.pop();
        GridNode currentNode = (GridNode)grid.readNode(nodeid);
        currentNodeIterator = currentNode.getData().iterator();
      }
    }
   
View Full Code Here

Examples of org.geotools.caching.spatialindex.NodeIdentifier

  public boolean evict() {
    synchronized (queue) {
      Iterator<NodeIdentifier> it = queue.keySet().iterator();
      while (it.hasNext()) {
        NodeIdentifier node = it.next();
        if (!node.isLocked()) {
          try {
            node.writeLock();
            try {
              tree.evict(node);
              queue.remove(node);
            } finally {
              node.writeUnLock();
            }
          } catch (Exception ex) {
            ex.printStackTrace();
            return false;
          }
View Full Code Here

Examples of org.geotools.caching.spatialindex.NodeIdentifier

        // done.
        boolean recordaccess = this.tracker.getDoRecordAccess();
        try {
            this.tracker.setDoRecordAccess(false);
            for( Iterator<NodeIdentifier> iterator = nodes.iterator(); iterator.hasNext(); ) {
                NodeIdentifier nodeIdentifier = (NodeIdentifier) iterator.next();
                nodeIdentifier.setValid(true);
            }
        } finally {
            this.tracker.setDoRecordAccess(recordaccess);
        }
    }
View Full Code Here

Examples of org.geotools.caching.spatialindex.NodeIdentifier

        // done.
        boolean recordaccess = this.tracker.getDoRecordAccess();
        try {
            this.tracker.setDoRecordAccess(false);
            for( Iterator<NodeIdentifier> iterator = nodes.iterator(); iterator.hasNext(); ) {
                NodeIdentifier nodeIdentifier = (NodeIdentifier) iterator.next();
                nodeIdentifier.setValid(false);
            }
        } finally {
            this.tracker.setDoRecordAccess(recordaccess);
        }
    }
View Full Code Here

Examples of org.geotools.caching.spatialindex.NodeIdentifier

        boolean added = false;
        if (cc.getChildCount() > MAX_INSERTION) {
            GridRootNode node = getRootNode();
            added = insertDataToNode(node, data, shape);
        } else {
            NodeIdentifier next = null;
            while( (next = cc.getNext()) != null ){
                if (insertDataToNodeID(next, data, shape)){
                    added = true;
                }
            }
View Full Code Here

Examples of org.geotools.caching.spatialindex.NodeIdentifier

        if(bounds == null){
            return;             //cannot do anything because we need to know the bounds of the data.
        }
        this.mbr = new Region(new double[] { bounds.getMinX(), bounds.getMinY() }, new double[] { bounds.getMaxX(), bounds.getMaxY() });
        this.dimension = this.mbr.getDimension();
        NodeIdentifier id = findUniqueInstance(new RegionNodeIdentifier(this.mbr));
        //GridRootNode tmpRootNode = new GridRootNode(gridsize, (RegionNodeIdentifier)id);
       
        this.rootNode = null;
        try{
            this.rootNode = storage.get(id);
View Full Code Here

Examples of org.geotools.caching.spatialindex.NodeIdentifier

      
       //here we need to visit just the children that may intersect
        List<Integer> childrenindex = tmpRoot.getChildren(query);
        for( Iterator<Integer> iterator = childrenindex.iterator(); iterator.hasNext(); ) {
            Integer childid = (Integer) iterator.next();
            NodeIdentifier child = tmpRoot.getChildIdentifier(childid);
            Node childNode = readNode(child);
            v.visitNode(childNode);
            if (v.isDataVisitor()) {
                visitData(childNode, v, query, type);
            }
View Full Code Here

Examples of org.geotools.caching.spatialindex.NodeIdentifier

        List<NodeIdentifier> missing = new ArrayList<NodeIdentifier>();
        List<NodeIdentifier> found = new ArrayList<NodeIdentifier>();

        if (!this.root.isValid()) {
            NodeCursor cc = new NodeCursor(getRootNode(), search);
            NodeIdentifier next = null;
            while ((next=cc.getNext()) != null){
                if (!next.isValid()){
                    missing.add(next);
                }else{
                    found.add(next);
                }
            }
View Full Code Here

Examples of org.geotools.caching.spatialindex.NodeIdentifier

        while (this.getStatistics().getNumberOfData() >= this.featureCapacity) {
          if (!getEvictionPolicy().evict()) {
            // no more space left and nothing else to evict
            // need to evict the areas covered by this feature
            NodeCursor cc = new NodeCursor(getRootNode(), shape);
            NodeIdentifier next = null;
            int cnt = 0;
            while ((next = cc.getNext()) != null) {
              Node n = readNode(next);
              cnt += n.getDataCount();
              n.clear();
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.