Reads only labels for tile.

@param tile tile for which data is requested.
@return label data for the tile.
181620
@Override
    public MapReadResult readLabels(Tile tile) {
        return readMapData(tile, tile, Selector.LABELS);
    }
387006
private void readTiles() {
    ImageTiles imageTiles = new ImageTiles();
    List<Tile> tiles = new ArrayList<Tile>();
    if (ifd.containsTagId(TiffTags.getTagId("TileOffsets"))
        && ifd.containsTagId(TiffTags.getTagId("TileBYTECounts"))
        && ifd.containsTagId(TiffTags.getTagId("TileLength"))
        && ifd.containsTagId(TiffTags.getTagId("TileWidth"))) {
      long totalWidth = ifd.getTag("ImageWidth").getFirstNumericValue();
      long totalLength = ifd.getTag("ImageLength").getFirstNumericValue();
      long tilesWidth = ifd.getTag("TileWidth").getFirstNumericValue();
      long tilesHeight = ifd.getTag("TileLength").getFirstNumericValue();
      int actualWidth = 0;
      long actualHeight = tilesHeight;
      for (int i = 0; i < ifd.getTag("TileOffsets").getValue().size(); i++) {
        try {
          int to = ifd.getTag("TileOffsets").getValue().get(i).toInt();
          Tile tile = new Tile();
          tile.setOffset(to);
          tile.setWidth((int) tilesWidth);
          tile.setHeight((int) tilesHeight);
          long padX = 0;
          long padY = 0;
          boolean newLine = false;
          actualWidth += tilesWidth;
          if (actualWidth > totalWidth) {
            padX = tilesWidth - actualWidth % totalWidth;
            newLine = true;
          }
          if (actualHeight > totalLength) {
            padY = tilesHeight - actualHeight % totalLength;
          }
          tile.setPadding((int) padX, (int) padY);
          if (newLine) {
            actualHeight += tilesHeight;
            actualWidth = 0;
          }
          tiles.add(tile);
        } catch (Exception ex) {

        }
      }
      imageTiles.setTiles(tiles);

      imageTiles.setTileHeight((int) tilesHeight);
      imageTiles.setTileWidth((int) tilesWidth);
    }
    ifd.setImageTiles(imageTiles);
  }
87441
public void checkTransitives(Tile tile)
    {
        final int tx = tile.getInTileX();
        final int ty = tile.getInTileY();
        for (int v = ty + 2; v >= ty - 2; v--)
        {
            checkTransitives(tile, tx - 2, v);
            checkTransitives(tile, tx + 2, v);
        }
        for (int h = tx - 2; h <= tx + 2; h++)
        {
            checkTransitives(tile, h, ty - 2);
            checkTransitives(tile, h, ty + 2);
        }
    }
959661
@SuppressWarnings("unchecked")
  public static Map<String, String> getLabels(ObjectMeta metadata) {
    if (metadata != null) {
      Map<String, String> labels = metadata.getLabels();
      if (labels != null) {
        return labels;
      }
    }
    return Collections.EMPTY_MAP;
  }
80071
private static Collection<TileRef> getTiles(Map<ColorRgba, Collection<TileRef>> colors, ColorRgba color)
    {
        if (!colors.containsKey(color))
        {
            colors.put(color, new HashSet<TileRef>());
        }
        return colors.get(color);
    }
183239
def parse_tile_name(name):
        
        tile_name = name.lstrip('T0')
        if len(tile_name) == 4:
            tile_name = '0' + tile_name
        if len(tile_name) != 5:
            raise ValueError('Invalid tile name {}'.format(name))
        return tile_name
1294784
@Override
    public Tile getTile(int x, int y, int zoom)
    {
        return new Tile(x, y, zoom)
        {
            @Override
            public synchronized boolean isLoaded()
            {
                return true;
            }

            @Override
            public BufferedImage getImage()
            {
                return emptyTile;
            }

        };
    }
287530
public static String getLabel(Class<?> clazz, String label) {
		Language language=getThreadLocalLanguage(null);
		
		if (language==null){
			return label;
		} else {
			return getLabel(language, clazz.getName(), label);
		}
	}
543240
public long addTile(MeshData data, int flags, long lastRef) {
        // Make sure the data is in right format.
        MeshHeader header = data.header;

        // Make sure the location is free.
        if (getTileAt(header.x, header.y, header.layer) != null) {
            throw new RuntimeException("Tile already exists");
        }

        // Allocate a tile.
        MeshTile tile = null;
        if (lastRef == 0) {
            if (m_nextFree != null) {
                tile = m_nextFree;
                m_nextFree = tile.next;
                tile.next = null;
                m_tileCount++;
            }
        } else {
            // Try to relocate the tile to specific index with same salt.
            int tileIndex = decodePolyIdTile(lastRef);
            if (tileIndex >= m_maxTiles) {
                throw new RuntimeException("Tile index too high");
            }
            // Try to find the specific tile id from the free list.
            MeshTile target = m_tiles[tileIndex];
            MeshTile prev = null;
            tile = m_nextFree;
            while (tile != null && tile != target) {
                prev = tile;
                tile = tile.next;
            }
            // Could not find the correct location.
            if (tile != target) {
                throw new RuntimeException("Could not find tile");
            }
            // Remove from freelist
            if (prev == null) {
                m_nextFree = tile.next;
            } else {
                prev.next = tile.next;
            }

            // Restore salt.
            tile.salt = decodePolyIdSalt(lastRef);
        }

        // Make sure we could allocate a tile.
        if (tile == null) {
            throw new RuntimeException("Could not allocate a tile");
        }

        tile.data = data;
        tile.flags = flags;
        tile.links.clear();

        // Insert tile into the position lut.
        int h = computeTileHash(header.x, header.y, m_tileLutMask);
        tile.next = m_posLookup[h];
        m_posLookup[h] = tile;

        // Patch header pointers.

        // If there are no items in the bvtree, reset the tree pointer.
        if (tile.data.bvTree != null && tile.data.bvTree.length == 0) {
            tile.data.bvTree = null;
        }

        // Init tile.

        connectIntLinks(tile);
        // Base off-mesh connections to their starting polygons and connect connections inside the tile.
        baseOffMeshLinks(tile);
        connectExtOffMeshLinks(tile, tile, -1);

        // Connect with layers in current tile.
        List<MeshTile> neis = getTilesAt(header.x, header.y);
        for (int j = 0; j < neis.size(); ++j) {
            if (neis.get(j) == tile) {
                continue;
            }
            connectExtLinks(tile, neis.get(j), -1);
            connectExtLinks(neis.get(j), tile, -1);
            connectExtOffMeshLinks(tile, neis.get(j), -1);
            connectExtOffMeshLinks(neis.get(j), tile, -1);
        }

        // Connect with neighbour tiles.
        for (int i = 0; i < 8; ++i) {
            neis = getNeighbourTilesAt(header.x, header.y, i);
            for (int j = 0; j < neis.size(); ++j) {
                connectExtLinks(tile, neis.get(j), i);
                connectExtLinks(neis.get(j), tile, oppositeTile(i));
                connectExtOffMeshLinks(tile, neis.get(j), i);
                connectExtOffMeshLinks(neis.get(j), tile, oppositeTile(i));
            }
        }

        return getTileRef(tile);
    }
591085
private ColorRgba getTileColor(Tile tile)
    {
        final ColorRgba color;
        if (tile == null)
        {
            color = NO_TILE;
        }
        else
        {
            final TileRef ref = new TileRef(tile.getSheet(), tile.getNumber());
            if (!pixels.containsKey(ref))
            {
                color = DEFAULT_COLOR;
            }
            else
            {
                color = pixels.get(ref);
            }
        }
        return color;
    }
990057
public Label getLabelByName(String name) {
        for (Label label : labels) {
            if (name.equals(label.getName())) {
                return label;
            }
        }
        return null;
    }
851065
public double getRecallForLabel(String label)
    {
        int fnAndTp = 0;
        double recall = 0;
        int tp = 0;

        if (map.containsKey(label) && map.get(label).containsKey(label)) {
            tp = this.map.get(label).get(label);
            fnAndTp = getRowSum(label);
        }

        if (fnAndTp > 0) {
            recall = (double) tp / (double) (fnAndTp);
        }

        return recall;
    }
612269
public List<String> getTileTablesForFeatureTable(String featureTable) {

		List<String> tileTables = new ArrayList<String>();

		List<FeatureTileLink> links = queryForFeatureTable(featureTable);
		for (FeatureTileLink link : links) {
			tileTables.add(link.getTileTableName());
		}

		return tileTables;
	}
1073357
public IWord findFirstWordByLabel(String label)
    {
        for (IWord word : this)
        {
            if (label.equals(word.getLabel()))
            {
                return word;
            }
        }
        return null;
    }
288240
public TileSet getTileSet (int tileSetId)
        throws NoSuchTileSetException, PersistenceException
    {
        waitForBundles();
        TileSet tset = _idmap.get(tileSetId);
        if (tset == null) {
            throw new NoSuchTileSetException(tileSetId);
        }
        return tset;
    }
893568
public Child labels(String... labelValues) {
    if (labelValues.length != labelNames.size()) {
      throw new IllegalArgumentException("Incorrect number of labels.");
    }
    for (String label: labelValues) {
      if (label == null) {
        throw new IllegalArgumentException("Label cannot be null.");
      }
    }
    List<String> key = Arrays.asList(labelValues);
    Child c = children.get(key);
    if (c != null) {
      return c;
    }
    Child c2 = newChild();
    Child tmp = children.putIfAbsent(key, c2);
    return tmp == null ? c2 : tmp;
  }
1349951
public int getTileSetID (String tileSetName)
        throws PersistenceException
    {
        Integer tsid = _map.get(tileSetName);
        if (tsid == null) {
            tsid = Integer.valueOf(++_nextTileSetID);
            _map.put(tileSetName, tsid);
        }
        return tsid.intValue();
    }