org.openstreetmap.osmosis.core.domain.v0_6.Tag.getKey()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(139)

本文整理了Java中org.openstreetmap.osmosis.core.domain.v0_6.Tag.getKey()方法的一些代码示例,展示了Tag.getKey()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tag.getKey()方法的具体详情如下:
包路径:org.openstreetmap.osmosis.core.domain.v0_6.Tag
类名称:Tag
方法名:getKey

Tag.getKey介绍

暂无

代码示例

代码示例来源:origin: mapsforge/mapsforge

/**
 * Returns value of given tag in a set of tags.
 *
 * @param tags collection of tags
 * @param key  tag key
 * @return Tag value or null if not exists
 */
String getTagValue(Collection<Tag> tags, String key) {
  for (Tag tag : tags) {
    if (tag.getKey().toLowerCase(Locale.ENGLISH).equals(key.toLowerCase(Locale.ENGLISH))) {
      return tag.getValue();
    }
  }
  return null;
}

代码示例来源:origin: mapsforge/mapsforge

if (way.getTags() != null) {
  for (Tag tag : way.getTags()) {
    String key = tag.getKey().toLowerCase(Locale.ENGLISH);
    String value = tag.getValue().toLowerCase(Locale.ENGLISH);
    if ("area".equals(key)) {

代码示例来源:origin: mapsforge/mapsforge

switch (tag.getKey()) {
  case "building":
  case "highway":

代码示例来源:origin: mapsforge/mapsforge

List<String> restPreferredLanguages = new ArrayList<String>(preferredLanguages);
for (Tag tag : tags) {
  String key = tag.getKey().toLowerCase(Locale.ENGLISH);
  if ("name".equals(key)) { // Default 'name'
    defaultName = tag.getValue();
  for (String preferredLanguage : restPreferredLanguages) {
    for (Tag tag : tags) {
      String key = tag.getKey().toLowerCase(Locale.ENGLISH);
      Matcher matcher = NAME_LANGUAGE_PATTERN.matcher(key);
      if (!matcher.matches()) {
boolean foundPreferredLanguageName = false;
for (Tag tag : entity.getTags()) {
  String key = tag.getKey().toLowerCase(Locale.ENGLISH);
  if ("name".equals(key) && !foundPreferredLanguageName) {
    name = tag.getValue();
String key = tag.getKey().toLowerCase(Locale.ENGLISH);
if ("piste:name".equals(key) && name == null) {
  name = tag.getValue();

代码示例来源:origin: mapsforge/mapsforge

Set<PoiCategory> categories = new HashSet<>();
for (Tag tag : entity.getTags()) {
  String key = tag.getKey().toLowerCase(Locale.ENGLISH);
  if (this.tagMappingResolver.getMappingTags().contains(key)) {
                tagMap.put(t.getKey().toLowerCase(Locale.ENGLISH), t.getValue());

代码示例来源:origin: mapsforge/mapsforge

/**
 * Extracts known way tags and returns their ids.
 *
 * @param entity the way
 * @return the ids of the identified tags
 */
public static Map<Short, Object> extractKnownWayTags(Entity entity) {
  Map<Short, Object> tagMap = new HashMap<>();
  OSMTagMapping mapping = OSMTagMapping.getInstance();
  if (entity.getTags() != null) {
    for (Tag tag : entity.getTags()) {
      OSMTag wayTag = mapping.getWayTag(tag.getKey(), tag.getValue());
      if (wayTag != null) {
        String wildcard = wayTag.getValue();
        tagMap.put(wayTag.getId(), getObjectFromWildcardAndValue(wildcard, tag.getValue()));
      }
    }
  }
  return tagMap;
}

代码示例来源:origin: mapsforge/mapsforge

/**
 * Extracts known POI tags and returns their ids.
 *
 * @param entity the node
 * @return the ids of the identified tags
 */
public static Map<Short, Object> extractKnownPOITags(Entity entity) {
  Map<Short, Object> tagMap = new HashMap<>();
  OSMTagMapping mapping = OSMTagMapping.getInstance();
  if (entity.getTags() != null) {
    for (Tag tag : entity.getTags()) {
      OSMTag poiTag = mapping.getPoiTag(tag.getKey(), tag.getValue());
      if (poiTag != null) {
        String wildcard = poiTag.getValue();
        tagMap.put(poiTag.getId(), getObjectFromWildcardAndValue(wildcard, tag.getValue()));
      }
    }
  }
  return tagMap;
}

代码示例来源:origin: org.locationtech.geogig/geogig-osm

@Override
  public int compare(Tag left, Tag right) {
    return Ordering.natural().compare(left.getKey(), right.getKey());
  }
};

代码示例来源:origin: openstreetmap/osmosis

/** 
 * ${@inheritDoc}.
 */
@Override
public String toString() {
  return "Tag('" + getKey() + "'='" + getValue() + "')";
}

代码示例来源:origin: org.openstreetmap.osmosis/osmosis-core

/** 
 * ${@inheritDoc}.
 */
@Override
public String toString() {
  return "Tag('" + getKey() + "'='" + getValue() + "')";
}

代码示例来源:origin: osmlab/atlas

public TagMap(final Collection<Tag> tagCollection)
{
  this.tags = new HashMap<>();
  tagCollection.forEach(tag -> this.tags.put(tag.getKey(), tag.getValue()));
}

代码示例来源:origin: locationtech/geowave

public static String formatTags(Collection<Tag> tags) {
  StringBuilder sb = new StringBuilder(tags.size() * 20);
  for (Tag tag : tags) {
   sb.append(", ");
   sb.append(tag.getKey());
   sb.append('=');
   sb.append(tag.getValue());
  }
  if (sb.length() > 2) {
   sb.delete(0, 2);
  }
  return sb.toString();
 }
}

代码示例来源:origin: osmlab/atlas

static Taggable with(final Collection<Tag> tagCollection)
{
  final Map<String, String> tags = new HashMap<>();
  tagCollection.forEach(tag -> tags.put(tag.getKey(), tag.getValue()));
  return with(tags);
}

代码示例来源:origin: openstreetmap/osmosis

/**
   * {@inheritDoc}
   */
  public Map<String, String> buildMap() {
    Map<String, String> tagMap;
    
    tagMap = new HashMap<String, String>(size());
    for (Tag tag : this) {
      tagMap.put(tag.getKey(), tag.getValue());
    }
    
    return tagMap;
  }
}

代码示例来源:origin: org.openstreetmap.osmosis/osmosis-core

/**
   * {@inheritDoc}
   */
  public Map<String, String> buildMap() {
    Map<String, String> tagMap;
    
    tagMap = new HashMap<String, String>(size());
    for (Tag tag : this) {
      tagMap.put(tag.getKey(), tag.getValue());
    }
    
    return tagMap;
  }
}

代码示例来源:origin: mojodna/osm2orc

@Override
  public void processTag(Tag tag) {
    changeset.getTags().put(tag.getKey(), tag.getValue());
  }
}

代码示例来源:origin: ncolomer/elasticsearch-osmosis-plugin

protected ESEntity(Entity entity) {
  this.id = entity.getId();
  this.tags = new HashMap<String, String>();
  for (Tag tag : entity.getTags()) {
    this.tags.put(tag.getKey(), tag.getValue());
  }
}

代码示例来源:origin: openstreetmap/osmosis

private PGHStore buildTags(Entity entity) {
  PGHStore tags;
  
  tags = new PGHStore();
  for (Tag tag : entity.getTags()) {
    tags.put(tag.getKey(), tag.getValue());
  }
  
  return tags;
}

代码示例来源:origin: openstreetmap/osmosis

/**
   * Writes the tag.
   * 
   * @param tag
   *            The tag to be processed.
   */
  public void process(Tag tag) {
    beginOpenElement();
    addAttribute("k", tag.getKey());
    addAttribute("v", tag.getValue());
    endOpenElement(true);
  }
}

代码示例来源:origin: org.openstreetmap.osmosis/osmosis-xml

/**
   * Writes the tag.
   * 
   * @param tag
   *            The tag to be processed.
   */
  public void process(Tag tag) {
    beginOpenElement();
    addAttribute("k", tag.getKey());
    addAttribute("v", tag.getValue());
    endOpenElement(true);
  }
}

相关文章