本文整理了Java中org.openstreetmap.osmosis.core.domain.v0_6.Tag.getValue()
方法的一些代码示例,展示了Tag.getValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tag.getValue()
方法的具体详情如下:
包路径:org.openstreetmap.osmosis.core.domain.v0_6.Tag
类名称:Tag
方法名:getValue
暂无
代码示例来源: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
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
String key = tag.getKey().toLowerCase(Locale.ENGLISH);
if ("name".equals(key)) { // Default 'name'
defaultName = tag.getValue();
name = defaultName;
} else { // Localized name
if (tag.getValue().equals(defaultName)) { // Same with default 'name'?
continue;
if (preferredLanguages.contains(language)) {
restPreferredLanguages.remove(language);
name = (name != null ? name + '\r' : "") + language + '\b' + tag.getValue();
if (tag.getValue().equals(defaultName)) { // Same with default 'name'?
continue;
if (!fallbacks.containsKey(language) && !language.contains("-") && (preferredLanguage.contains("-") || preferredLanguage.contains("_"))
&& preferredLanguage.toLowerCase(Locale.ENGLISH).startsWith(language)) {
fallbacks.put(language, tag.getValue());
String key = tag.getKey().toLowerCase(Locale.ENGLISH);
if ("name".equals(key) && !foundPreferredLanguageName) {
name = tag.getValue();
} else if (preferredLanguages != null && !foundPreferredLanguageName) {
Matcher matcher = NAME_LANGUAGE_PATTERN.matcher(key);
String language = matcher.group(3);
if (language.equalsIgnoreCase(preferredLanguages.get(0))) {
name = tag.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: mapsforge/mapsforge
if (this.tagMappingResolver.getMappingTags().contains(key)) {
String tagStr = key + "=" + tag.getValue();
try {
tagMap.put(t.getKey().toLowerCase(Locale.ENGLISH), t.getValue());
代码示例来源:origin: org.openstreetmap.osmosis/osmosis-core
/**
* ${@inheritDoc}.
*/
@Override
public String toString() {
return "Tag('" + getKey() + "'='" + getValue() + "')";
}
代码示例来源:origin: openstreetmap/osmosis
/**
* ${@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: org.locationtech.geogig/geogig-osm
@Nullable
public static Map<String, String> buildTagsMap(Iterable<Tag> collection) {
Map<String, String> tags = Maps.newHashMap();
String key;
String value;
for (Tag e : collection) {
key = e.getKey();
if (key == null || key.isEmpty()) {
continue;
}
value = e.getValue();
tags.put(key, value);
}
return tags.isEmpty() ? null : tags;
}
代码示例来源: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);
}
}
代码示例来源:origin: openstreetmap/osmosis
/** Add all of the tags of all entities in the queue to the stringtable. */
public void addStringsToStringtable() {
StringTable stable = getStringTable();
for (T i : contents) {
Collection<Tag> tags = i.getTags();
for (Tag tag : tags) {
stable.incr(tag.getKey());
stable.incr(tag.getValue());
}
if (!omit_metadata) {
stable.incr(i.getUser().getName());
}
}
}
private static final int MAXWARN = 100;
内容来源于网络,如有侵权,请联系作者删除!