Examples of RasterTile


Examples of org.geomajas.layer.tile.RasterTile

    // back-transform scale to latlon
    double latlonScale = ZOOMED_IN_SCALE * googleEnvelope.getWidth() / latlonEnvelope.getWidth();
    // paint with reprojection (affine is fine for now...:-)
    List<RasterTile> tiles = defaultWms.paint(latlon, latlonEnvelope, latlonScale);
    Assert.assertEquals(1, tiles.size());
    RasterTile tile = tiles.get(0);
    Assert.assertEquals("http://apps.geomajas.org/geoserver/wms?SERVICE=WMS&layers=bluemarble&"
        + "WIDTH=512&HEIGHT=512&bbox=-20.032430835865227,-28.207099921352835,11.947593278789554,"
        + "3.7729241933019466&format=image/png&version=1.1.1&srs=EPSG:4326&styles=&request=GetMap",
        tile.getUrl());
    Assert.assertEquals(4, tile.getCode().getTileLevel());
    Assert.assertEquals(5, tile.getCode().getX());
    Assert.assertEquals(12, tile.getCode().getY());
    Assert.assertEquals(-223.0, tile.getBounds().getX(), DELTA);
    Assert.assertEquals(-42.0, tile.getBounds().getY(), DELTA);
    Assert.assertEquals(356.0, tile.getBounds().getHeight(), DELTA);
    Assert.assertEquals(356.0, tile.getBounds().getWidth(), DELTA);
  }
View Full Code Here

Examples of org.geomajas.layer.tile.RasterTile

  }

  @Test
  public void testMaxLevel() throws Exception {
    Envelope envelope = new Envelope(10000, 10002, 5000, 5002);
    RasterTile tile;
    List<RasterTile> tiles;
    tiles = google.paint(google.getCrs(), envelope, MAX_LEVEL_SCALE);
    Assert.assertEquals(1, tiles.size());
    tile = tiles.get(0);
    Assert.assertEquals("http://mt0.google.com/vt?v=w2.95&x=8196&y=8189&z=14", tile.getUrl());
    tiles = googleMaxLevel.paint(googleMaxLevel.getCrs(), envelope, MAX_LEVEL_SCALE);
    Assert.assertEquals(1, tiles.size());
    tile = tiles.get(0);
    Assert.assertEquals("http://mt0.google.com/vt?v=w2.95&x=2049&y=2047&z=12", tile.getUrl());
  }
View Full Code Here

Examples of org.geomajas.layer.tile.RasterTile

  }

  @Test
  public void testConfigUrlStrategy() throws Exception {
    Envelope envelope = new Envelope(10000, 10002, 5000, 5002);
    RasterTile tile;
    List<RasterTile> tiles;
    tiles = googleStrategy.paint(googleStrategy.getCrs(), envelope, MAX_LEVEL_SCALE);
    Assert.assertEquals(1, tiles.size());
    tile = tiles.get(0);
    Assert.assertEquals("http://mt3.google.com/vt?v=w2.95&x=8196&y=8189&z=14", tile.getUrl());
    tiles = googleStrategy.paint(googleStrategy.getCrs(), envelope, MAX_LEVEL_SCALE);
    Assert.assertEquals(1, tiles.size());
    tile = tiles.get(0);
    Assert.assertEquals("http://mt3.google.com/vt?v=w2.95&x=8196&y=8189&z=14", tile.getUrl());
  }
View Full Code Here

Examples of org.geomajas.layer.tile.RasterTile

  @Test
  public void testNormal() throws Exception {
    List<RasterTile> tiles = google.paint(google.getCrs(),
        new Envelope(10000, 10010, 4000, 4010), ZOOMED_IN_SCALE);
    Assert.assertEquals(1, tiles.size());
    RasterTile tile = tiles.get(0);
    Assert.assertEquals("http://mt0.google.com/vt?v=w2.95&x=8&y=7&z=4", tile.getUrl());
    Assert.assertEquals(4, tile.getCode().getTileLevel());
    Assert.assertEquals(8, tile.getCode().getX());
    Assert.assertEquals(7, tile.getCode().getY());
    Assert.assertEquals(0.0, tile.getBounds().getX(), DELTA);
    Assert.assertEquals(-250.0, tile.getBounds().getY(), DELTA);
    Assert.assertEquals(250.0, tile.getBounds().getHeight(), DELTA);
    Assert.assertEquals(250.0, tile.getBounds().getWidth(), DELTA);
  }
View Full Code Here

Examples of org.geomajas.layer.tile.RasterTile

    Assert.assertEquals(4, tiles.size());
    Assert.assertEquals("http://mt0.google.com/vt?v=w2.95&x=8196&y=8188&z=14", tiles.get(0).getUrl());
    Assert.assertEquals("http://mt0.google.com/vt?v=w2.95&x=8196&y=8189&z=14", tiles.get(1).getUrl());
    Assert.assertEquals("http://mt0.google.com/vt?v=w2.95&x=8197&y=8188&z=14", tiles.get(2).getUrl());
    Assert.assertEquals("http://mt0.google.com/vt?v=w2.95&x=8197&y=8189&z=14", tiles.get(3).getUrl());
    RasterTile tile = tiles.get(3);
    Assert.assertEquals("http://mt0.google.com/vt?v=w2.95&x=8197&y=8189&z=14", tile.getUrl());
    Assert.assertEquals(14, tile.getCode().getTileLevel());
    Assert.assertEquals(8197, tile.getCode().getX());
    Assert.assertEquals(8189, tile.getCode().getY());
    Assert.assertEquals(1223, tile.getBounds().getX(), DELTA);
    Assert.assertEquals(-733.0, tile.getBounds().getY(), DELTA);
    Assert.assertEquals(245.0, tile.getBounds().getHeight(), DELTA);
    Assert.assertEquals(245.0, tile.getBounds().getWidth(), DELTA);
  }
View Full Code Here

Examples of org.geomajas.layer.tile.RasterTile

  @Test
  public void testSatellite() throws Exception {
    List<RasterTile> tiles = satellite.paint(geoService.getCrs("EPSG:900913"),
        new Envelope(10000, 10010, 4000, 4010), ZOOMED_IN_SCALE);
    Assert.assertEquals(1, tiles.size());
    RasterTile tile = tiles.get(0);
    Assert.assertEquals("http://khm0.google.com/kh?v=87&x=8&y=7&z=4", tile.getUrl());
    Assert.assertEquals(4, tile.getCode().getTileLevel());
    Assert.assertEquals(8, tile.getCode().getX());
    Assert.assertEquals(7, tile.getCode().getY());
    Assert.assertEquals(0.0, tile.getBounds().getX(), DELTA);
    Assert.assertEquals(-250.0, tile.getBounds().getY(), DELTA);
    Assert.assertEquals(250.0, tile.getBounds().getHeight(), DELTA);
    Assert.assertEquals(250.0, tile.getBounds().getWidth(), DELTA);
  }
View Full Code Here

Examples of org.geomajas.layer.tile.RasterTile

        Bbox screenBox = new Bbox(Math.round(scale * worldBox.getX()), -Math.round(scale * worldBox.getMaxY()),
            Math.round(scale * worldBox.getMaxX()) - Math.round(scale * worldBox.getX()), Math.round(scale
            * worldBox.getMaxY())
            - Math.round(scale * worldBox.getY()));

        RasterTile image = new RasterTile(screenBox, getId() + "." + bestResolution.getLevel() + "." + i
            + "," + j);

        image.setCode(new TileCode(bestResolution.getLevel(), i, j));
        String url = formatUrl(bestResolution.getTileWidthPx(), bestResolution.getTileHeightPx(), layerBox);
        image.setUrl(url);
        result.add(image);
      }
    }

    return result;
View Full Code Here

Examples of org.geomajas.layer.tile.RasterTile

  @Test
  public void testTerrain() throws Exception {
    List<RasterTile> tiles = physical.paint(geoService.getCrs("EPSG:900913"),
        new Envelope(10000, 10010, 4000, 4010), ZOOMED_IN_SCALE);
    Assert.assertEquals(1, tiles.size());
    RasterTile tile = tiles.get(0);
    Assert.assertEquals("http://mt0.google.com/vt?lyrs=t@127,r@156000000&x=8&y=7&z=4", tile.getUrl());
    Assert.assertEquals(4, tile.getCode().getTileLevel());
    Assert.assertEquals(8, tile.getCode().getX());
    Assert.assertEquals(7, tile.getCode().getY());
    Assert.assertEquals(0.0, tile.getBounds().getX(), DELTA);
    Assert.assertEquals(-250.0, tile.getBounds().getY(), DELTA);
    Assert.assertEquals(250.0, tile.getBounds().getHeight(), DELTA);
    Assert.assertEquals(250.0, tile.getBounds().getWidth(), DELTA);
  }
View Full Code Here

Examples of org.geomajas.layer.tile.RasterTile

  @Test
  public void testNormalDs() throws Exception {
    List<RasterTile> tiles = googleDs.paint(googleDs.getCrs(),
        new Envelope(10000, 10010, 4000, 4010), ZOOMED_IN_SCALE);
    Assert.assertEquals(1, tiles.size());
    RasterTile tile = tiles.get(0);
    Assert.assertEquals("http://mt0.google.com/vt?v=w2.95&x=8&y=7&z=4", tile.getUrl());
    Assert.assertEquals(4, tile.getCode().getTileLevel());
    Assert.assertEquals(8, tile.getCode().getX());
    Assert.assertEquals(7, tile.getCode().getY());
    Assert.assertEquals(0.0, tile.getBounds().getX(), DELTA);
    Assert.assertEquals(-250.0, tile.getBounds().getY(), DELTA);
    Assert.assertEquals(250.0, tile.getBounds().getHeight(), DELTA);
    Assert.assertEquals(250.0, tile.getBounds().getWidth(), DELTA);
  }
View Full Code Here

Examples of org.geomajas.layer.tile.RasterTile

  @Test
  public void testSatelliteDs() throws Exception {
    List<RasterTile> tiles = satelliteDs.paint(satelliteDs.getCrs(),
        new Envelope(10000, 10010, 4000, 4010), ZOOMED_IN_SCALE);
    Assert.assertEquals(1, tiles.size());
    RasterTile tile = tiles.get(0);
    Assert.assertEquals("http://khm0.google.com/kh?v=87&x=8&y=7&z=4", tile.getUrl());
    Assert.assertEquals(4, tile.getCode().getTileLevel());
    Assert.assertEquals(8, tile.getCode().getX());
    Assert.assertEquals(7, tile.getCode().getY());
    Assert.assertEquals(0.0, tile.getBounds().getX(), DELTA);
    Assert.assertEquals(-250.0, tile.getBounds().getY(), DELTA);
    Assert.assertEquals(250.0, tile.getBounds().getHeight(), DELTA);
    Assert.assertEquals(250.0, tile.getBounds().getWidth(), DELTA);
  }
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.