Examples of BBOX


Examples of org.geomajas.geometry.Bbox

        UserMaximumExtentRequest.COMMAND, request, null, "en");
    if (response.isError()) {
      response.getErrors().get(0).printStackTrace();
    }
    Assert.assertFalse(response.isError());
    Bbox bounds = response.getBounds();
    Assert.assertNotNull(bounds);
    Assert.assertEquals(-1.0, bounds.getX(), DOUBLE_TOLERANCE);
    Assert.assertEquals(-1.0, bounds.getY(), DOUBLE_TOLERANCE);
    Assert.assertEquals(1.0, bounds.getMaxX(), DOUBLE_TOLERANCE);
    Assert.assertEquals(1.0, bounds.getMaxY(), DOUBLE_TOLERANCE);
  }
View Full Code Here

Examples of org.geomajas.geometry.Bbox

  @Test
  public void testSearchByPoint() throws Exception {
    String layer = "layerWmsCountries";
    SearchByPointRequest request = new SearchByPointRequest();
    request.setBbox(new Bbox(-3211986.0066263545, 98246.25012821658, 1.065471024672729E7, 3365675.229452881));
    request.setCrs("EPSG:900913");
    request.setLayerIds(new String[] {layer});
    request.setLocation(new Coordinate(672238.022713162, 2554015.0948743597));
    request.setScale(1.022083167709322E-4);
    CommandResponse response = dispatcher.execute(SearchByPointRequest.COMMAND, request, null, "en");
View Full Code Here

Examples of org.geomajas.geometry.Bbox

    int x = (int) (((layerCoordinate.x - grid.getLowerLeft().x) * bestResolution.getTileWidthPx())
        / grid.getTileWidth());
    int y = (int) (bestResolution.getTileHeightPx() - (((layerCoordinate.y - grid.getLowerLeft().y) *
        bestResolution .getTileHeightPx()) / grid.getTileHeight()));

    Bbox layerBox = new Bbox(grid.getLowerLeft().x, grid.getLowerLeft().y,
        grid.getTileWidth(), grid.getTileHeight());

    InputStream stream = null;
    try {
      String url = formatGetFeatureInfoUrl(bestResolution.getTileWidthPx(), bestResolution.getTileHeightPx(),
View Full Code Here

Examples of org.geomajas.geometry.Bbox

    for (int i = grid.getXmin(); i < grid.getXmax(); i++) {
      for (int j = grid.getYmin(); j < grid.getYmax(); j++) {
        double x = grid.getLowerLeft().x + (i - grid.getXmin()) * grid.getTileWidth();
        double y = grid.getLowerLeft().y + (j - grid.getYmin()) * grid.getTileHeight();
        // layer coordinates
        Bbox worldBox;
        Bbox layerBox;
        if (needTransform) {
          layerBox = new Bbox(x, y, grid.getTileWidth(), grid.getTileHeight());
          // Transforming back to map coordinates will only result in a proper grid if the transformation
          // is nearly affine
          worldBox = geoService.transform(layerBox, layerToMap);
        } else {
          worldBox = new Bbox(x, y, grid.getTileWidth(), grid.getTileHeight());
          layerBox = worldBox;
        }
        // Rounding to avoid white space between raster tiles lower-left becomes upper-left in inverted y-space
        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
View Full Code Here

Examples of org.geomajas.geometry.Bbox

  }

  private Resolution calculateBestQuadTreeResolution(double scale) {
    double screenResolution = 1.0 / scale;
    // based on quad tree created by subdividing the maximum extent
    Bbox bbox = layerInfo.getMaxExtent();
    double maxWidth = bbox.getWidth();
    double maxHeight = bbox.getHeight();

    int tileWidth = layerInfo.getTileWidth();
    int tileHeight = layerInfo.getTileHeight();

    Resolution upper = new Resolution(Math.max(maxWidth / tileWidth, maxHeight / tileHeight), 0, tileWidth,
View Full Code Here

Examples of org.geomajas.geometry.Bbox

    // slightly adjust the width and height so it becomes integer for the
    // current scale
    double realWidth = Math.round(width * scale) / scale;
    double realHeight =  Math.round(height * scale) / scale;

    Bbox bbox = getLayerInfo().getMaxExtent();
    int ymin = (int) Math.floor((bounds.getMinY() - bbox.getY()) / realHeight);
    int ymax = (int) Math.ceil((bounds.getMaxY() - bbox.getY()) / realHeight);
    int xmin = (int) Math.floor((bounds.getMinX() - bbox.getX()) / realWidth);
    int xmax = (int) Math.ceil((bounds.getMaxX() - bbox.getX()) / realWidth);
    // same adjustment for corner
    double realXmin = ((int) (bbox.getX() * scale)) / scale;
    double realYmin = ((int) (bbox.getY() * scale)) / scale;
    Coordinate lowerLeft = new Coordinate(realXmin + xmin * realWidth, realYmin + ymin * realHeight);
    return new RasterGrid(lowerLeft, xmin, ymin, xmax, ymax, realWidth, realHeight);
  }
View Full Code Here

Examples of org.geomajas.geometry.Bbox

  public CrsTransformImpl(String id, Crs source, Crs target, MathTransform mathTransform,
      Envelope transformableEnvelope) {
    this(id, source, target, mathTransform);
    if (null != transformableEnvelope) {
      this.transformableEnvelope = transformableEnvelope;
      this.transformableBbox = new Bbox(transformableEnvelope.getMinX(), transformableEnvelope.getMinY(),
          transformableEnvelope.getMaxX(), transformableEnvelope.getMaxY());
      this.transformableGeometry = JTS.toGeometry(transformableEnvelope);
    }
  }
View Full Code Here

Examples of org.geomajas.geometry.Bbox

    }
    layerInfo.setCrs(TiledRasterLayerService.MERCATOR);
    crs = geoService.getCrs2(TiledRasterLayerService.MERCATOR);
    layerInfo.setTileWidth(tileSize);
    layerInfo.setTileHeight(tileSize);
    Bbox bbox = new Bbox(-20026376.393709917, -20026376.393709917, 40052752.787419834, 40052752.787419834);
    layerInfo.setMaxExtent(bbox);
    maxBounds = converterService.toInternal(bbox);

    resolutions = new double[maxZoomLevel + 1];
    double powerOfTwo = 1;
View Full Code Here

Examples of org.geomajas.geometry.Bbox

        for (int j = jMin; j < jMax; j++) {
          // Using screen coordinates:
          int x = xScreenUpperLeft + (i - iMin) * screenWidth;
          int y = yScreenUpperLeft - (j - jMin) * screenHeight;

          RasterTile image = new RasterTile(new Bbox(x, -y, screenWidth, screenHeight),
              tileServiceState.getId() + "." + zoomLevel + "." + i + "," + j);
          image.setCode(new TileCode(zoomLevel, i, j));
          String url = tileServiceState.getUrlSelectionStrategy().next();
          url = url.replace("${level}", Integer.toString(zoomLevel));
          url = url.replace("${x}", Integer.toString(i));
View Full Code Here

Examples of org.geomajas.geometry.Bbox

    // weight
    getPointLabelStyle().getFontStyle().setWeight("bold");
    checkPoint("point_black_1_labeled_font_bold.png", true, true);
    getPointLabelStyle().getFontStyle().setWeight("normal");
    // point just outside tile border
    checkPoint("point_black_1_border.png", true, true, new Bbox(0.001, 0.001, 100, 100));
  }
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.