本文整理汇总了Java中org.mapsforge.map.writer.model.TDNode.getTags方法的典型用法代码示例。如果您正苦于以下问题:Java TDNode.getTags方法的具体用法?Java TDNode.getTags怎么用?Java TDNode.getTags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.mapsforge.map.writer.model.TDNode
的用法示例。
在下文中一共展示了TDNode.getTags方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: countPoiTags
import org.mapsforge.map.writer.model.TDNode; //导入方法依赖的package包/类
protected void countPoiTags(TDNode poi) {
if (poi == null || poi.getTags() == null) {
return;
}
for (short tag : poi.getTags()) {
this.histogramPoiTags.adjustOrPutValue(tag, 1, 1);
}
}
示例2: infoBytePoiLayerAndTagAmount
import org.mapsforge.map.writer.model.TDNode; //导入方法依赖的package包/类
static byte infoBytePoiLayerAndTagAmount(TDNode node) {
byte layer = node.getLayer();
// make sure layer is in [0,10]
layer = layer < 0 ? 0 : layer > 10 ? 10 : layer;
short tagAmount = node.getTags() == null ? 0 : (short) node.getTags().length;
return (byte) (layer << BYTES_INT | tagAmount);
}
示例3: processPOI
import org.mapsforge.map.writer.model.TDNode; //导入方法依赖的package包/类
static void processPOI(TDNode poi, int currentTileLat, int currentTileLon, boolean debugStrings,
ByteBuffer poiBuffer) {
if (debugStrings) {
StringBuilder sb = new StringBuilder();
sb.append(DEBUG_STRING_POI_HEAD).append(poi.getId()).append(DEBUG_STRING_POI_TAIL);
poiBuffer.put(sb.toString().getBytes(UTF8_CHARSET));
// append whitespaces so that block has 32 bytes
appendWhitespace(DEBUG_BLOCK_SIZE - sb.toString().getBytes(UTF8_CHARSET).length, poiBuffer);
}
// write poi features to the file
poiBuffer.put(Serializer.getVariableByteSigned(poi.getLatitude() - currentTileLat));
poiBuffer.put(Serializer.getVariableByteSigned(poi.getLongitude() - currentTileLon));
// write byte with layer and tag amount info
poiBuffer.put(infoBytePoiLayerAndTagAmount(poi));
// write tag ids to the file
if (poi.getTags() != null) {
for (short tagID : poi.getTags()) {
poiBuffer.put(Serializer.getVariableByteUnsigned(OSMTagMapping.getInstance().getOptimizedPoiIds()
.get(Short.valueOf(tagID)).intValue()));
}
}
// write byte with bits set to 1 if the poi has a
// name, an elevation
// or a housenumber
poiBuffer.put(infoBytePOIFeatures(poi.getName(), poi.getElevation(), poi.getHouseNumber()));
if (poi.getName() != null && !poi.getName().isEmpty()) {
writeUTF8(poi.getName(), poiBuffer);
}
if (poi.getHouseNumber() != null && !poi.getHouseNumber().isEmpty()) {
writeUTF8(poi.getHouseNumber(), poiBuffer);
}
if (poi.getElevation() != 0) {
poiBuffer.put(Serializer.getVariableByteSigned(poi.getElevation()));
}
}