diff --git a/OsmAnd-java/src/net/osmand/binary/BinaryInspector.java b/OsmAnd-java/src/net/osmand/binary/BinaryInspector.java index caaedd891b..2e6b96989f 100644 --- a/OsmAnd-java/src/net/osmand/binary/BinaryInspector.java +++ b/OsmAnd-java/src/net/osmand/binary/BinaryInspector.java @@ -60,13 +60,13 @@ public class BinaryInspector { // test cases show info if(args.length == 1 && "test".equals(args[0])) { in.inspector(new String[]{ - //"-vpoi", + "-vpoi", // "-vmap", "-vmapobjects", // "-vrouting", // "-vaddress", "-vcities", "-vstreets", "-vstreetgroups","-vbuildings", //"-zoom=16", //"-bbox=4,55,7,50", -// "/home/victor/projects/osmand/osm-gen/Map.obf" + "/home/victor/projects/osmand/osm-gen/Map.obf" }); } else { in.inspector(args); diff --git a/OsmAnd-java/src/net/osmand/osm/MapRenderingTypes.java b/OsmAnd-java/src/net/osmand/osm/MapRenderingTypes.java index 94323bd3e5..4d4e03134a 100644 --- a/OsmAnd-java/src/net/osmand/osm/MapRenderingTypes.java +++ b/OsmAnd-java/src/net/osmand/osm/MapRenderingTypes.java @@ -305,6 +305,7 @@ public class MapRenderingTypes { rType.poiSpecified = parent.poiSpecified; rType.poiCategory = parent.poiCategory; rType.poiPrefix = parent.poiPrefix; + rType.poiWithNameOnly = parent.poiWithNameOnly; rType.namePrefix = parent.namePrefix; rType = registerRuleType(rType); } @@ -375,15 +376,15 @@ public class MapRenderingTypes { return null; } - public AmenityType getAmenityType(String tag, String val){ - return getAmenityType(tag, val, false); + public AmenityType getAmenityType(String tag, String val, boolean hasName){ + return getAmenityType(tag, val, false, hasName); } - public AmenityType getAmenityTypeForRelation(String tag, String val){ - return getAmenityType(tag, val, true); + public AmenityType getAmenityTypeForRelation(String tag, String val, boolean hasName){ + return getAmenityType(tag, val, true, hasName); } - private AmenityType getAmenityType(String tag, String val, boolean relation){ + private AmenityType getAmenityType(String tag, String val, boolean relation, boolean hasName){ // register amenity types Map rules = getEncodingRuleTypes(); MapRulType rt = rules.get(constructRuleKey(tag, val)); @@ -391,6 +392,9 @@ public class MapRenderingTypes { if((relation && !rt.relation) || rt.isAdditionalOrText()) { return null; } + if(rt.poiWithNameOnly && !hasName) { + return null; + } return rt.poiCategory; } rt = rules.get(constructRuleKey(tag, null)); @@ -398,6 +402,9 @@ public class MapRenderingTypes { if((relation && !rt.relation) || rt.isAdditionalOrText()) { return null; } + if(rt.poiWithNameOnly && !hasName) { + return null; + } return rt.poiCategory; } return null; @@ -526,6 +533,7 @@ public class MapRenderingTypes { rtype.poiCategory = AmenityType.getAndRegisterType(poiCategory); } } + rtype.poiWithNameOnly = Boolean.parseBoolean(parser.getAttributeValue("", "poi_with_name")); String poiPrefix = parser.getAttributeValue("", "poi_prefix"); if (poiPrefix != null) { rtype.poiPrefix = poiPrefix; @@ -704,6 +712,7 @@ public class MapRenderingTypes { protected String category = null; protected String poiPrefix; + protected boolean poiWithNameOnly; protected AmenityType poiCategory; // poi_category was specially removed for one tag/value, to skip unnecessary objects protected boolean poiSpecified; diff --git a/OsmAnd-java/src/net/osmand/osm/edit/EntityParser.java b/OsmAnd-java/src/net/osmand/osm/edit/EntityParser.java index f99a4b22c0..8d60c2e333 100644 --- a/OsmAnd-java/src/net/osmand/osm/edit/EntityParser.java +++ b/OsmAnd-java/src/net/osmand/osm/edit/EntityParser.java @@ -114,9 +114,10 @@ public class EntityParser { for(Map tags : it) { if (!tags.isEmpty()) { boolean purerelation = relation && !"multipolygon".equals(tags.get("type")); + boolean hasName = !Algorithms.isEmpty(tags.get("name")); for (Map.Entry e : tags.entrySet()) { - AmenityType type = purerelation ? renderingTypes.getAmenityTypeForRelation(e.getKey(), e.getValue()) - : renderingTypes.getAmenityType(e.getKey(), e.getValue()); + AmenityType type = purerelation ? renderingTypes.getAmenityTypeForRelation(e.getKey(), e.getValue(), hasName) + : renderingTypes.getAmenityType(e.getKey(), e.getValue(), hasName ); if (type != null) { String subtype = renderingTypes.getAmenitySubtype(e.getKey(), e.getValue()); Amenity a = parseAmenity(entity, type, subtype, tags, renderingTypes);