Examples of RasterTile


Examples of org.geomajas.gwt.client.map.cache.tile.RasterTile

   *            The group where the object resides in (optional).
   * @param context
   *            A MapContext object, responsible for actual drawing.
   */
  public void paint(Paintable paintable, Object group, MapContext context) {
    RasterTile tile = (RasterTile) paintable;
    context.getRasterContext().drawImage(tile.getStore().getLayer(),
        tile.getCode().toString(), tile.getUrl(), tile.getBounds(), tile.getStyle());
  }
View Full Code Here

Examples of org.geomajas.gwt.client.map.cache.tile.RasterTile

   *            The group where the object resides in (optional).
   * @param graphics
   *            The context to paint on.
   */
  public void deleteShape(Paintable paintable, Object group, MapContext context) {
    RasterTile tile = (RasterTile) paintable;
    context.getRasterContext().deleteElement(tile.getStore().getLayer(), tile.getCode().toString());
  }
View Full Code Here

Examples of org.geomajas.gwt.client.map.cache.tile.RasterTile

        if (cacheBounds == null) {
          cacheBounds = panBounds;
        } else {
          cacheBounds = cacheBounds.union(panBounds);
        }
        RasterTile tile = new RasterTile(code, panBounds, image.getUrl(), this);
        tiles.put(code, tile);
      }
    }
    deferred = null;
  }
View Full Code Here

Examples of org.geomajas.layer.tile.RasterTile

          try {
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            log.debug("rendering to buffer...");
            ImageIO.write(mosaic, "png", baos);
            log.debug("rendering done, size = " + baos.toByteArray().length);
            RasterTile mosaicTile = new RasterTile();
            mosaicTile.setBounds(getWorldBounds(tiles));
            ImageResult mosaicResult = new ImageResult(mosaicTile);
            mosaicResult.setImage(baos.toByteArray());
            addImage(graphics, mosaicResult, viewport);
          } catch (IOException e) {
            log.warn("could not write mosaic image " + e.getMessage());
View Full Code Here

Examples of org.geomajas.layer.tile.RasterTile

  public ReferencedEnvelope getBounds() {
    return null;
  }

  private boolean isYIndexUp(List<RasterTile> tiles) {
    RasterTile first = tiles.iterator().next();
    for (RasterTile tile : tiles) {
      if (tile.getCode().getY() > first.getCode().getY()) {
        return tile.getBounds().getY() > first.getBounds().getY();
      } else if (tile.getCode().getY() < first.getCode().getY()) {
        return tile.getBounds().getY() < first.getBounds().getY();
      }
    }
    return false;
  }
View Full Code Here

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 = wms.paint(latlon, latlonEnvelope, latlonScale);
    Assert.assertEquals(1, tiles.size());
    RasterTile tile = tiles.get(0);
    // ZOOMED_IN_SCALE 1E-4 corresponds to level 4 with current algorithm !!!!
    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/jpeg&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

        .get(2).getUrl());
    Assert.assertEquals("http://apps.geomajas.org/geoserver/wms?SERVICE=WMS&layers=bluemarble&"
        + "WIDTH=512&HEIGHT=512&bbox=0.09677101398176689,47.38586174271936,0.10458635695360671,"
        + "47.393677085691195&format=image/jpeg&version=1.1.1&srs=EPSG:4326&styles=&request=GetMap",
        tiles.get(3).getUrl());
    RasterTile tile = tiles.get(3);
    // MAX_LEVEL_SCALE 0.4 corresponds to level 16 with current algorithm  !!!!
    Assert.assertEquals(16, tile.getCode().getTileLevel());
    Assert.assertEquals(23044, tile.getCode().getX());
    Assert.assertEquals(58780, tile.getCode().getY());
    Assert.assertEquals(4309.0, tile.getBounds().getX(), DELTA);
    Assert.assertEquals(-2110336.0, tile.getBounds().getY(), DELTA);
    Assert.assertEquals(348.0, tile.getBounds().getHeight(), DELTA);
    Assert.assertEquals(348.0, tile.getBounds().getWidth(), DELTA);
  }
View Full Code Here

Examples of org.geomajas.layer.tile.RasterTile

    // back-transform envelope to latlon
    Crs google = geoService.getCrs2(MERCATOR);
    // paint with reprojection (affine is fine for now...:-)
    List<RasterTile> tiles = wms.paint(google, googleEnvelope, ZOOMED_IN_SCALE);
    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/jpeg&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(370.0, tile.getBounds().getHeight(), DELTA);
    Assert.assertEquals(356.0, tile.getBounds().getWidth(), DELTA);
  }
View Full Code Here

Examples of org.geomajas.layer.tile.RasterTile

        .get(2).getUrl());
    Assert.assertEquals("http://apps.geomajas.org/geoserver/wms?SERVICE=WMS&layers=bluemarble&"
        + "WIDTH=512&HEIGHT=512&bbox=0.09677101398176689,47.38586174271936,0.10458635695360671,"
        + "47.393677085691195&format=image/jpeg&version=1.1.1&srs=EPSG:4326&styles=&request=GetMap",
        tiles.get(3).getUrl());
    RasterTile tile = tiles.get(3);
    // MAX_LEVEL_SCALE 0.4 corresponds to level 16 !!!!
    Assert.assertEquals(16, tile.getCode().getTileLevel());
    Assert.assertEquals(23044, tile.getCode().getX());
    Assert.assertEquals(58780, tile.getCode().getY());
    Assert.assertEquals(4309.0, tile.getBounds().getX(), DELTA);
    Assert.assertEquals(-2402628.0, tile.getBounds().getY(), DELTA);
    Assert.assertEquals(514.0, tile.getBounds().getHeight(), DELTA);
    Assert.assertEquals(348.0, tile.getBounds().getWidth(), DELTA);
    // test alignment on grid
    double x = tiles.get(0).getBounds().getX();
    double y = tiles.get(0).getBounds().getY();
    double width = tiles.get(0).getBounds().getWidth();
    double height = tiles.get(0).getBounds().getHeight();
View Full Code Here

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 = proxyWms.paint(latlon, latlonEnvelope, latlonScale);
    Assert.assertEquals(1, tiles.size());
    RasterTile tile = tiles.get(0);
    Assert.assertEquals("./d/wms/proxyBlue/?SERVICE=WMS&layers=bluemarble&WIDTH=512&HEIGHT=512&"
        + "bbox=-20.032430835865227,-28.207099921352835,11.947593278789554,3.7729241933019466&"
        + "format=image/jpeg&version=1.3.0&crs=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
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.