Skip to content

Commit

Permalink
Add public getPoiTypeByTagValue()
Browse files Browse the repository at this point in the history
  • Loading branch information
RZR-UA committed Dec 11, 2024
1 parent ffd7b5d commit 79c338c
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions OsmAnd-java/src/main/java/net/osmand/osm/MapPoiTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@


public class MapPoiTypes {
private static final String OTHER_MAP_CATEGORY = "Other";
public static final String OTHER_MAP_CATEGORY = "Other";
private static MapPoiTypes DEFAULT_INSTANCE = null;
private static final Log log = PlatformUtil.getLog(MapRenderingTypes.class);
private String resourceName;
Expand Down Expand Up @@ -971,11 +971,7 @@ public String replaceDeprecatedSubtype(PoiCategory type, String subtype) {
}

public Amenity parseAmenity(String tag, String val, boolean relation, Map<String, String> otherTags) {
initPoiTypesByTag();
PoiType pt = poiTypesByTag.get(tag + "/" + val);
if (pt == null) {
pt = poiTypesByTag.get(tag);
}
PoiType pt = getPoiTypeByTagValue(tag, val);
if (pt == null || pt.isAdditional()) {
return null;
}
Expand Down Expand Up @@ -1033,6 +1029,16 @@ public Amenity parseAmenity(String tag, String val, boolean relation, Map<String
return a;
}


public PoiType getPoiTypeByTagValue(String tag, String val) {
initPoiTypesByTag();
PoiType pt = poiTypesByTag.get(tag + "/" + val);
if (pt == null) {
pt = poiTypesByTag.get(tag);
}
return pt;
}

public boolean isTextAdditionalInfo(String key, String value) {
if (key.startsWith("name:") || key.equals("name")) {
return true;
Expand Down

0 comments on commit 79c338c

Please sign in to comment.