Tabnine Logo
TileCode.getX
Code IndexAdd Tabnine to your IDE (free)

How to use
getX
method
in
org.geomajas.layer.tile.TileCode

Best Java code snippets using org.geomajas.layer.tile.TileCode.getX (Showing top 7 results out of 315)

origin: org.geomajas.plugin/geomajas-layer-tms

@Override
public String buildUrl(TileCode tileCode, String baseTmsUrl) {
  StringBuilder builder = new StringBuilder(baseTmsUrl);
  if (!baseTmsUrl.endsWith("/")) {
    builder.append("/");
  }
  builder.append(tileCode.getTileLevel());
  builder.append("/");
  builder.append(tileCode.getX());
  builder.append("/");
  builder.append(tileCode.getY());
  builder.append(extension);
  return builder.toString();
}

origin: org.geomajas/geomajas-api

/**
 * Convert to readable string.
 *
 * @return readable string
 */
public String toString() {
  if (code == null) {
    return "[bounds=" + bounds + ",url=" + url + "]";
  }
  return "[z=" + code.getTileLevel() + ",x=" + code.getX() + ",y=" + code.getY() + ",bounds=" + bounds + ",url="
      + url + "]";
}
origin: org.geomajas.plugin/geomajas-layer-tms

private static String buildUrl(TileCode tileCode, TileMap tileMap, String baseTmsUrl) {
  if (tileCode == null || tileMap == null || baseTmsUrl == null) {
    throw new IllegalArgumentException("All parameters are required");
  }
  
  StringBuilder builder;
  // assuming they are ordered:
  TileSet tileSet = tileMap.getTileSets().getTileSets().get(tileCode.getTileLevel());
  String href = tileSet.getHref();
  if (href.startsWith("http://") || href.startsWith("https://")) {
    builder = new StringBuilder(href);
    if (!href.endsWith("/")) {
      builder.append("/");
    }
  } else {
    builder = new StringBuilder(baseTmsUrl);
    if (!baseTmsUrl.endsWith("/")) {
      builder.append("/");
    }
    builder.append(href);
    builder.append("/");
  }
  builder.append(tileCode.getX());
  builder.append("/");
  builder.append(tileCode.getY());
  builder.append(".");
  builder.append(tileMap.getTileFormat().getExtension());
  return builder.toString();
}

origin: org.geomajas/geomajas-gwt-client-impl

  private Coordinate getTilePosition() {
    org.geomajas.geometry.Bbox layerBounds = renderer.getLayer().getLayerInfo().getMaxExtent();

    // Calculate tile width and height for tileLevel=tileCode.getTileLevel(); This is in world space.
    double div = Math.pow(2, tileCode.getTileLevel());
    double tileWidth = Math.ceil((scale * layerBounds.getWidth()) / div) / scale;
    double tileHeight = Math.ceil((scale * layerBounds.getHeight()) / div) / scale;

    // Now get the top-left corner for the tile in world space:
    double x = layerBounds.getX() + tileCode.getX() * tileWidth;
    double y = layerBounds.getY() + tileCode.getY() * tileHeight;

    // Convert to screen space. Note that the Y-axis is inverted, and so the top corner from the tile BBOX (world)
    // becomes the bottom corner (screen). That is why the tileHeight is added before compensating with the scale.
    x *= scale;
    y = -Math.round(scale * (y + tileHeight));
    return new Coordinate(x, y);
  }
}
origin: org.geomajas.plugin/geomajas-plugin-printing

double xOffset = result.getRasterImage().getCode().getX() * imageWidth
    - pixelBounds.getX();
double yOffset = 0;
origin: org.geomajas.plugin/geomajas-plugin-printing

private Bbox getPixelBounds(List<RasterTile> tiles) {
  Bbox bounds = null;
  int imageWidth = configurationService.getRasterLayerInfo(getLayerId()).getTileWidth();
  int imageHeight = configurationService.getRasterLayerInfo(getLayerId()).getTileHeight();
  for (RasterTile tile : tiles) {
    Bbox tileBounds = new Bbox(tile.getCode().getX() * imageWidth, tile.getCode().getY() * imageHeight,
        imageWidth, imageHeight);
    if (bounds == null) {
      bounds = new Bbox(tileBounds.getX(), tileBounds.getY(), tileBounds.getWidth(), tileBounds.getHeight());
    } else {
      double minx = Math.min(tileBounds.getX(), bounds.getX());
      double maxx = Math.max(tileBounds.getMaxX(), bounds.getMaxX());
      double miny = Math.min(tileBounds.getY(), bounds.getY());
      double maxy = Math.max(tileBounds.getMaxY(), bounds.getMaxY());
      bounds = new Bbox(minx, miny, maxx - minx, maxy - miny);
    }
  }
  return bounds;
}
origin: org.geomajas.plugin/geomajas-plugin-wmsclient

@Override
public Bbox getWorldBoundsForTile(ViewPort viewPort, WmsTileConfiguration tileConfig, TileCode tileCode) {
  double resolution = 1 / viewPort.getZoomStrategy().getZoomStepScale(tileCode.getTileLevel());
  double worldTileWidth = tileConfig.getTileWidth() * resolution;
  double worldTileHeight = tileConfig.getTileHeight() * resolution;
  double x = tileConfig.getTileOrigin().getX() + tileCode.getX() * worldTileWidth;
  double y = tileConfig.getTileOrigin().getY() + tileCode.getY() * worldTileHeight;
  return new Bbox(x, y, worldTileWidth, worldTileHeight);
}
org.geomajas.layer.tileTileCodegetX

Javadoc

Get the X-ordinate at the given level: X=[0, (2^tileLevel) - 1].

Popular methods of TileCode

  • <init>
    The only constructor available. It requires you to immediately set all it's values.
  • getY
    Get the Y-ordinate at the given level: Y=[0, (2^tileLevel) - 1].
  • getTileLevel
    Get the tiling depth level. Where 0 means the top level. Make sure this is always a positive integer
  • toString
    Return the values as a readable text: TileLevel-X-Y.
  • clone
    Create a clone from this object.
  • setTileLevel
    set the tiling depth level. Where 0 means the top level. Make sure this is always a positive integer
  • setX
    The X-ordinate at the given level: X=[0, (2^tileLevel) - 1].
  • setY
    The Y-ordinate at the given level: Y=[0, (2^tileLevel) - 1].

Popular in Java

  • Start an intent from android
  • getApplicationContext (Context)
  • getContentResolver (Context)
  • getResourceAsStream (ClassLoader)
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now