Package chunmap.model.elem

Examples of chunmap.model.elem.Envelope


    return grid;
  }

  private void createAllTile(Grid grid, String path) throws IOException {

    Envelope oenvelop = map.getLayerCollection().getEnvelop();

    double w = grid.getSubEnvelop().getWidth();
    double h = grid.getSubEnvelop().getHeight();
    double zw = oenvelop.getWidth();
    double zh = oenvelop.getHeight();
    // double vw = map.getView().getEnvelop().getWidth();
    // double vh = map.getView().getEnvelop().getHeight();
    double ox = oenvelop.getMinX();
    double oy = oenvelop.getMinY();

    double dn = zw / w + 0.4999;
    double dm = zh / h + 0.4999;
    int n = (int) Math.round(dn);
    int m = (int) Math.round(dm);

    double dx, dy;

    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {

        // compute envelop
        dx = i * w + ox;
        dy = j * h + oy;

        // pixels expand
        // double dd = buffer / map.getView().getScale();

        Envelope envelop = new Envelope(dx, dy, dx + w, dy + h);
        map.getView().setViewEnvelop(envelop);
        // map.getView().pan(0, dy);

        createImage(grid, path, i, j);
      }
View Full Code Here


      x = Integer.valueOf(s[0]);
      String[] ss = s[1].split("\\.");
      y = Integer.valueOf(ss[0]);
    }

    Envelope env = getEnvelop(x, y, scale);
    tile.setEnvelop(env);
    tile.setX(x);
    tile.setY(y);
    return tile;
  }
View Full Code Here

    double dx = i * w + ox;
    double dy = j * h + oy;
    double dd = buffer / scale;

    Envelope envelop = new Envelope(dx, dy, dx + w + dd, dy + h + dd);
    return envelop;
  }
View Full Code Here

  /**
   * {@link chunmap.model.elem.Envelope#getCenter()} 的测试方法。
   */
  @Test
  public void testGetCenter() {
    Envelope envelop = new Envelope(10, 16, 20, 22);
    CPoint p = envelop.getCenter();
    CPoint expected = new Coordinate2D(15, 19);
    boolean b = p.equals(expected);
    assertTrue(b);
  }
View Full Code Here

    assertTrue(b);
  }

  @Test
  public void testMergeEnvelop() {
    Envelope envelop1 = new Envelope(10, 16, 20, 22);
    Envelope envelop2 = new Envelope(7, 18, 17, 25);
    // Envelop expected=new Envelop(7,20,16,25);
    EnvelopeBuf env = new EnvelopeBuf();
    env.mergeEnvelop(envelop1);
    env.mergeEnvelop(envelop2);
    envelop1 = env.toEnvelop();
View Full Code Here

    assertTrue(b1 && b2 && b3 && b4);
  }

  @Test
  public void testContain() {
    Envelope envelop1 = new Envelope(10, 16, 20, 22);
    CPoint p = new Coordinate2D(11, 17);

    boolean b1 = envelop1.contain(p);
    assertTrue(b1);
  }
View Full Code Here

    assertTrue(b1);
  }

  @Test
  public void testContain2() {
    Envelope envelop1 = new Envelope(10, 16, 10, 16);
    CPoint p = new Coordinate2D(10, 16);

    boolean b1 = envelop1.contain(p);
    assertTrue(b1);
  }
View Full Code Here

  }

  @Test
  public void testContain3() {
    CPoint p = new Coordinate2D(10, 16);
    Envelope envelop1 = new GeoPoint(p).getEnvelop();
    boolean b1 = envelop1.contain(p);
    assertTrue(b1);
  }
View Full Code Here

        double sizeX = dis / countX;//每个Tile的大小,投影坐标下

        double minX = (tile.x * sizeX) - Mercator.maxDis;
        double maxY = Mercator.maxDis - (tile.y * sizeX);

        return new Envelope(minX, maxY-sizeX, minX + sizeX, maxY);
    }
View Full Code Here

    }

    //查找要显示的Tile
    public List<GMTile> getTileSet(Envelope envelope, double scale)
    {
      Envelope fenv=envelope;
      if(envelope.hasIntersect(StaticDataSource.envelope)){
        fenv=envelope.intersection(StaticDataSource.envelope);
      }
     
      Envelope env=fenv.transform(proj.getTransform());
    double bi=env.getWidth()/envelope.getWidth();
    double s=scale/bi;
   
        List<GMTile> list= code.getTileSet(env, s);
        List<GMTile> plist=new ArrayList<GMTile>();
        for (GMTile t : list)
View Full Code Here

TOP

Related Classes of chunmap.model.elem.Envelope

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.