Package com.vividsolutions.jts.index.quadtree

Examples of com.vividsolutions.jts.index.quadtree.Quadtree


    return true;
  }

  private void buildQuadtree()
  {
    quadtree = new Quadtree();

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


  /**
   * This methods creates a quadtree and fills it with all existing edges
   */
  private void buildSpacialEdgeTree() {
    tree = new Quadtree();
    for (EdgeModel edge : edges) {
      Envelope e = new Envelope(
        edge.getFromNode().getLongitude(),
        edge.getToNode().getLongitude(),
        edge.getFromNode().getLatitude(),
View Full Code Here

        // public "views" requiring synchronised( mutex )
        modified2 = Collections.unmodifiableMap(modifiedFeatures);
        added = Collections.unmodifiableMap(addedFeatures);
        order = Collections.unmodifiableList(addedFidList);

        spatialIndex = new Quadtree();
        mutex = this;
    }
View Full Code Here

        synchronized (mutex) {
            nextFID = 0;
            addedFeatures.clear();
            addedFidList.clear();
            modifiedFeatures.clear();
            spatialIndex = new Quadtree();
        }
    }
View Full Code Here

     */
    public Map<String, SimpleFeature> getAdded() {
        return added;
    }
  protected Quadtree copySTRtreeFrom(Diff diff) {
    Quadtree tree = new Quadtree();
   
    synchronized (diff) {
      Iterator<Entry<String,SimpleFeature>> i = diff.added.entrySet().iterator();
      while (i.hasNext()) {
        Entry<String,SimpleFeature> e = i.next();
        SimpleFeature f = (SimpleFeature) e.getValue();
        if (!diff.modifiedFeatures.containsKey(f.getID())) {
          tree.insert(ReferencedEnvelope.reference(f.getBounds()), f);
        }
      }
      Iterator<Entry<String,SimpleFeature>> j = diff.getModified().entrySet().iterator();
      while( j.hasNext() ){
        Entry<String,SimpleFeature> e = j.next();
        SimpleFeature f = (SimpleFeature) e.getValue();
        tree.insert(ReferencedEnvelope.reference(f.getBounds()), f);
      }
    }
   
    return tree;
  }
View Full Code Here

 
  public PolygonGraphGenerator(GraphBuilder builder,PolygonRelationship rel) {
    setGraphBuilder(builder);
    this.rel = rel;
   
    index = new Quadtree();
  }
View Full Code Here

  public void testSpatialIndex()
  throws Exception
  {
    SpatialIndexTester tester = new SpatialIndexTester();
    tester.setSpatialIndex(new Quadtree());
    tester.init();
    tester.run();
    assertTrue(tester.isSuccess());
  }
View Full Code Here

 
  public void testSerialization()
  throws Exception
  {
    SpatialIndexTester tester = new SpatialIndexTester();
    tester.setSpatialIndex(new Quadtree());
    tester.init();
    Quadtree tree = (Quadtree) tester.getSpatialIndex();
    byte[] data = SerializationUtil.serialize(tree);
    tree = (Quadtree) SerializationUtil.deserialize(data);
    tester.setSpatialIndex(tree);
    tester.run();
    assertTrue(tester.isSuccess());
View Full Code Here


  public Roadmap(City city){
    log = city.log;
    this.city = city;
    roads = new Quadtree();
    //Load configuration file
    try {
      File configFile = new File("config/roadmapConfig.properties");
      File parent = configFile.getParentFile();
      if(!parent.exists() && !parent.mkdirs()){
View Full Code Here

TOP

Related Classes of com.vividsolutions.jts.index.quadtree.Quadtree

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.