git-svn-id: https://osmand.googlecode.com/svn/trunk@546 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
Victor Shcherb 2010-10-09 12:38:12 +00:00
parent e9a8a899e3
commit e0f7f09a10
10 changed files with 954 additions and 928 deletions

View file

@ -1,6 +1,12 @@
amenity_type_administrative = Administrative
amenity_type_barrier = Barrier
amenity_type_education = Education
amenity_type_emergency = Emergency
amenity_type_entertainment = Entertainment
amenity_type_finance = Finance
@ -9,10 +15,18 @@ amenity_type_healthcare = Healthcare
amenity_type_historic = Historic
amenity_type_landuse = Landuse
amenity_type_leisure = Leisure
amenity_type_manmade = Man made
amenity_type_military = Military
amenity_type_natural = Natural
amenity_type_office = Office
amenity_type_other = Other
amenity_type_shop = Shop

View file

@ -1,6 +1,12 @@
amenity_type_administrative = \u0410\u0434\u043C\u0438\u043D\u0438\u0441\u0442\u0440\u0430\u0442\u0438\u0432\u043D\u043E\u0435
amenity_type_barrier = \u041F\u0440\u0435\u043F\u044F\u0442\u0441\u0442\u0432\u0438\u0435
amenity_type_education = \u041E\u0431\u0440\u0430\u0437\u043E\u0432\u0430\u043D\u0438\u0435
amenity_type_emergency = \u042D\u043A\u0441\u0442\u0440\u0435\u043D\u043D\u044B\u0435 \u0441\u043B\u0443\u0436\u0431\u044B
amenity_type_entertainment = \u0420\u0430\u0437\u0432\u043B\u0435\u0447\u0435\u043D\u0438\u044F
amenity_type_finance = \u0424\u0438\u043D\u0430\u043D\u0441\u044B
@ -9,10 +15,18 @@ amenity_type_healthcare = \u0417\u0434\u043E\u0440\u043E\u0432\u044C\u0435
amenity_type_historic = \u0418\u0441\u0442\u043E\u0440\u0438\u0447\u0435\u0441\u043A\u043E\u0435
amenity_type_landuse = \u0417\u0435\u043C\u043B\u0435\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435
amenity_type_leisure = \u0414\u043E\u0441\u0443\u0433
amenity_type_manmade = \u0421\u043E\u043E\u0440\u0443\u0436\u0435\u043D\u0438\u044F
amenity_type_military = \u0412\u043E\u0435\u043D\u043D\u043E\u0435
amenity_type_natural = \u041F\u0440\u0438\u0440\u043E\u0434\u0430
amenity_type_office = \u041E\u0444\u0438\u0441
amenity_type_other = \u0414\u0440\u0443\u0433\u043E\u0435
amenity_type_shop = \u041C\u0430\u0433\u0430\u0437\u0438\u043D\u044B

View file

@ -11,15 +11,15 @@ public class ToDoConstants {
// FOR 0.4 beta RELEASE
// POI
// ! 69. Add phone and site information to POI (enable call to POI and open site)
// ! 81. Add some objects to POI category (1) to add them into OSM 2) to help navigation)
// highway (?), traffic_calming (?), barrier(?), military(?-), landuse (?), office(?), man_made(?), power(?),
// railway( station, subway?) - issue 17
// !_22. Verify all POI has a point_type (in order to search them) - !
// !_22. Verify all POI has a point_type (in order to search them) - ! +
// Outside base 0.4 release
// 97. For voice navigation consider current speed of vehicle. Especially when speed > 50 pronounce more than 200 m
// 98. Implement rendering of different app mode. For Car render streets name with large font.
// 69. Add phone and site information to POI (enable call to POI and open site)
// 86. Allow to add/edit custom tags to POI objects (Issue)
// 91. Invent binary format (minimize disk space, maximize speed)
// 92. Replace poi index with standard map index and unify POI categories

View file

@ -4,8 +4,8 @@ public class Version {
public static final String APP_VERSION = "0.4.1"; //$NON-NLS-1$
public static final String APP_NAME = "OsmAnd"; //$NON-NLS-1$
public static final String APP_DESCRIPTION = "beta (b1)"; //$NON-NLS-1$
public static final boolean VELCOM_EDITION = true;
public static final String APP_DESCRIPTION = "beta (b2)"; //$NON-NLS-1$
public static final boolean VELCOM_EDITION = false;
public static final String APP_NAME_VERSION = APP_NAME + " " + APP_VERSION; //$NON-NLS-1$
public static final String APP_FULL_NAME = APP_NAME + " " + APP_VERSION + " " +APP_DESCRIPTION; //$NON-NLS-1$ //$NON-NLS-2$

View file

@ -1,6 +1,9 @@
package net.osmand.data;
import java.util.Collection;
import net.osmand.osm.Entity;
import net.osmand.osm.MapRenderingTypes;
import net.osmand.osm.Relation;
import net.osmand.osm.OSMSettings.OSMTagKey;
@ -13,73 +16,39 @@ public class Amenity extends MapObject {
public Amenity(Entity entity){
super(entity);
this.type = getType(entity);
this.subType = getSubType(entity);
initTypeSubtype(entity, this);
this.openingHours = entity.getTag(OSMTagKey.OPENING_HOURS);
}
public Amenity(){
}
public String convertToAmenityTag(){
switch (getType()) {
case SHOP:
return OSMTagKey.SHOP.getValue();
case LEISURE:
return OSMTagKey.LEISURE.getValue();
case HISTORIC:
return OSMTagKey.HISTORIC.getValue();
case NATURAL:
return OSMTagKey.NATURAL.getValue();
case TOURISM:
return OSMTagKey.TOURISM.getValue();
case SPORT:
return OSMTagKey.SPORT.getValue();
default:
return OSMTagKey.AMENITY.getValue();
private static AmenityType initTypeSubtype(Entity entity, Amenity init) {
Collection<String> keySet = entity.getTagKeySet();
if (!keySet.isEmpty()) {
for (String t : keySet) {
AmenityType type = MapRenderingTypes.getAmenityType(t, entity.getTag(t));
if (type != null) {
if (init != null) {
init.type = type;
init.subType = MapRenderingTypes.getAmenitySubtype(t, entity.getTag(t));
}
return type;
}
}
for (String t : keySet) {
AmenityType type = MapRenderingTypes.getAmenityType(t, null);
if (type != null) {
if (init != null) {
init.type = type;
init.subType = MapRenderingTypes.getAmenitySubtype(t, entity.getTag(t));
}
return type;
}
}
}
return null;
}
protected String getSubType(Entity node) {
if (node.getTag(OSMTagKey.SHOP) != null) {
return node.getTag(OSMTagKey.SHOP);
} else if (node.getTag(OSMTagKey.NATURAL) != null) {
return node.getTag(OSMTagKey.NATURAL);
} else if (node.getTag(OSMTagKey.TOURISM) != null) {
return node.getTag(OSMTagKey.TOURISM);
} else if (node.getTag(OSMTagKey.SPORT) != null) {
return node.getTag(OSMTagKey.SPORT);
} else if (node.getTag(OSMTagKey.LEISURE) != null) {
return node.getTag(OSMTagKey.LEISURE);
} else if (node.getTag(OSMTagKey.HISTORIC) != null) {
return node.getTag(OSMTagKey.HISTORIC);
} else if (node.getTag(OSMTagKey.INTERNET_ACCESS) != null) {
return "internet_access"; //$NON-NLS-1$
} else if (node.getTag(OSMTagKey.AMENITY) != null) {
return node.getTag(OSMTagKey.AMENITY);
}
return ""; //$NON-NLS-1$
}
protected AmenityType getType(Entity node){
if(node.getTag(OSMTagKey.SHOP) != null){
return AmenityType.SHOP;
} else if(node.getTag(OSMTagKey.NATURAL) != null){
return AmenityType.NATURAL;
} else if(node.getTag(OSMTagKey.TOURISM) != null){
return AmenityType.TOURISM;
} else if(node.getTag(OSMTagKey.LEISURE) != null){
return AmenityType.LEISURE;
} else if(node.getTag(OSMTagKey.SPORT) != null){
return AmenityType.SPORT;
} else if(node.getTag(OSMTagKey.HISTORIC) != null){
return AmenityType.HISTORIC;
} else if(AmenityType.amenityMap.containsKey(node.getTag(OSMTagKey.AMENITY))){
return AmenityType.amenityMap.get(node.getTag(OSMTagKey.AMENITY));
}
return AmenityType.OTHER;
}
public AmenityType getType(){
return type;
}
@ -101,24 +70,7 @@ public class Amenity extends MapObject {
// it could be collection of amenities
return false;
}
if(n.getTag(OSMTagKey.AMENITY) != null){
return true;
} else if(n.getTag(OSMTagKey.SHOP) != null){
return true;
} else if(n.getTag(OSMTagKey.NATURAL) != null){
return true;
} else if(n.getTag(OSMTagKey.LEISURE) != null){
return true;
} else if(n.getTag(OSMTagKey.SPORT) != null){
return true;
} else if(n.getTag(OSMTagKey.TOURISM) != null){
return true;
} else if(n.getTag(OSMTagKey.HISTORIC) != null){
return true;
} else if(n.getTag(OSMTagKey.INTERNET_ACCESS) != null){
return true;
}
return false;
return initTypeSubtype(n, null) != null;
}
public String getOpeningHours() {

View file

@ -1,37 +1,45 @@
package net.osmand.data;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Collection;
import java.util.Collections;
import java.util.Map;
import net.osmand.Messages;
import net.osmand.osm.MapRenderingTypes;
// http://wiki.openstreetmap.org/wiki/Amenity
// POI tags : amenity, leisure, shop, sport, tourism, historic; accessories (internet-access), natural ?
public enum AmenityType {
// Some of those types are subtypes of Amenity tag
SUSTENANCE("amenity_type_sustenance"), // restaurant, cafe ... //$NON-NLS-1$
EDUCATION("amenity_type_education"), // school, ... //$NON-NLS-1$
TRANSPORTATION("amenity_type_transportation"), // car_wash, parking, ... //$NON-NLS-1$
FINANCE("amenity_type_finance"), // bank, atm, ... //$NON-NLS-1$
HEALTHCARE("amenity_type_healthcare"), // hospital ... //$NON-NLS-1$
ENTERTAINMENT("amenity_type_entertainment"), // cinema, ... (+! sauna, brothel) //$NON-NLS-1$
TOURISM("amenity_type_tourism"), // [TAG] hotel, sights, museum .. //$NON-NLS-1$
HISTORIC("amenity_type_historic"), // [TAG] historic places, monuments (should we unify tourism/historic) //$NON-NLS-1$
NATURAL("amenity_type_natural"), // [TAG] natural places, monuments (should we unify tourism/historic) //$NON-NLS-1$
SHOP("amenity_type_shop"), // [TAG] convenience (product), clothes... //$NON-NLS-1$
LEISURE("amenity_type_leisure"), // [TAG] leisure //$NON-NLS-1$
SPORT("amenity_type_sport"), // [TAG] sport //$NON-NLS-1$
OTHER("amenity_type_other"), // grave-yard, police, post-office [+Internet_access] //$NON-NLS-1$
SUSTENANCE("amenity_type_sustenance", "amenity"), // restaurant, cafe ... //$NON-NLS-1$ //$NON-NLS-2$
EDUCATION("amenity_type_education", "amenity"), // school, ... //$NON-NLS-1$ //$NON-NLS-2$
TRANSPORTATION("amenity_type_transportation", "amenity"), // car_wash, parking, ... //$NON-NLS-1$ //$NON-NLS-2$
FINANCE("amenity_type_finance", "amenity"), // bank, atm, ... //$NON-NLS-1$ //$NON-NLS-2$
HEALTHCARE("amenity_type_healthcare", "amenity"), // hospital ... //$NON-NLS-1$ //$NON-NLS-2$
ENTERTAINMENT("amenity_type_entertainment", "amenity"), // cinema, ... (+! sauna, brothel) //$NON-NLS-1$ //$NON-NLS-2$
TOURISM("amenity_type_tourism", "tourism"), // [TAG] tourism hotel, sights, museum .. //$NON-NLS-1$ //$NON-NLS-2$
HISTORIC("amenity_type_historic", "historic"), // [TAG] historic places, monuments (should we unify tourism/historic) //$NON-NLS-1$ //$NON-NLS-2$
NATURAL("amenity_type_natural", "natural"), // [TAG] natural places, monuments (should we unify tourism/historic) //$NON-NLS-1$ //$NON-NLS-2$
SHOP("amenity_type_shop", "shop"), // [TAG] amenity convenience (product), clothes... //$NON-NLS-1$ //$NON-NLS-2$
LEISURE("amenity_type_leisure", "leisure"), // [TAG] leisure //$NON-NLS-1$ //$NON-NLS-2$
SPORT("amenity_type_sport", "sport"), // [TAG] sport //$NON-NLS-1$ //$NON-NLS-2$
BARRIER("amenity_type_barrier", "barrier"), // [TAG] barrier + traffic_calming //$NON-NLS-1$ //$NON-NLS-2$
LANDUSE("amenity_type_landuse", "landuse"), // [TAG] landuse //$NON-NLS-1$ //$NON-NLS-2$
MAN_MADE("amenity_type_manmade", "man_made"), // [TAG] man_made and others //$NON-NLS-1$ //$NON-NLS-2$
OFFICE("amenity_type_office", "office"), // [TAG] office //$NON-NLS-1$ //$NON-NLS-2$
EMERGENCY("amenity_type_emergency", "emergency"), // [TAG] emergency //$NON-NLS-1$ //$NON-NLS-2$
MILITARY("amenity_type_military", "military"), // [TAG] military //$NON-NLS-1$ //$NON-NLS-2$
ADMINISTRATIVE("amenity_type_administrative", "administrative"), // [TAG] administrative //$NON-NLS-1$ //$NON-NLS-2$
OTHER("amenity_type_other", "amenity"), // grave-yard, police, post-office [+Internet_access] //$NON-NLS-1$ //$NON-NLS-2$
;
private String name;
private final String name;
private final String defaultTag;
private AmenityType(String name)
{
this.name = name;
private AmenityType(String name, String defaultTag) {
this.name = name;
this.defaultTag = defaultTag;
}
public static AmenityType fromString(String s){
@ -42,6 +50,10 @@ public enum AmenityType {
}
}
public String getDefaultTag() {
return defaultTag;
}
public static String valueToString(AmenityType t){
return t.toString().toLowerCase();
}
@ -50,19 +62,14 @@ public enum AmenityType {
return AmenityType.values();
}
public static List<String> getSubCategories(AmenityType t){
List<String> list = new ArrayList<String>();
for(String s : amenityMap.keySet()){
if(amenityMap.get(s) == t){
list.add(s);
}
public static Collection<String> getSubCategories(AmenityType t){
Map<AmenityType, Map<String, String>> amenityTypeNameToTagVal = MapRenderingTypes.getAmenityTypeNameToTagVal();
if(!amenityTypeNameToTagVal.containsKey(t)){
return Collections.emptyList();
}
return list;
return amenityTypeNameToTagVal.get(t).keySet();
}
public static Map<String, AmenityType> getAmenityMap(){
return amenityMap;
}
public static String toPublicString(AmenityType t){
// return Algoritms.capitalizeFirstLetterAndLowercase(t.toString().replace('_', ' '));
@ -70,276 +77,5 @@ public enum AmenityType {
}
protected static Map<String, AmenityType> amenityMap = new LinkedHashMap<String, AmenityType>();
static {
amenityMap.put("alpine_hut", AmenityType.TOURISM); //$NON-NLS-1$
amenityMap.put("attraction", AmenityType.TOURISM); //$NON-NLS-1$
amenityMap.put("artwork", AmenityType.TOURISM); //$NON-NLS-1$
amenityMap.put("camp_site", AmenityType.TOURISM); //$NON-NLS-1$
amenityMap.put("caravan_site", AmenityType.TOURISM); //$NON-NLS-1$
amenityMap.put("chalet", AmenityType.TOURISM); //$NON-NLS-1$
amenityMap.put("guest_house", AmenityType.TOURISM); //$NON-NLS-1$
amenityMap.put("hostel", AmenityType.TOURISM); //$NON-NLS-1$
amenityMap.put("hotel", AmenityType.TOURISM); //$NON-NLS-1$
amenityMap.put("information", AmenityType.TOURISM); //$NON-NLS-1$
amenityMap.put("motel", AmenityType.TOURISM); //$NON-NLS-1$
amenityMap.put("museum", AmenityType.TOURISM); //$NON-NLS-1$
amenityMap.put("picnic_site", AmenityType.TOURISM); //$NON-NLS-1$
amenityMap.put("theme_park", AmenityType.TOURISM); //$NON-NLS-1$
amenityMap.put("viewpoint", AmenityType.TOURISM); //$NON-NLS-1$
amenityMap.put("zoo", AmenityType.TOURISM); //$NON-NLS-1$
amenityMap.put("archaeological_site", AmenityType.HISTORIC); //$NON-NLS-1$
amenityMap.put("battlefield", AmenityType.HISTORIC); //$NON-NLS-1$
amenityMap.put("boundary_stone", AmenityType.HISTORIC); //$NON-NLS-1$
amenityMap.put("castle", AmenityType.HISTORIC); //$NON-NLS-1$
amenityMap.put("fort", AmenityType.HISTORIC); //$NON-NLS-1$
amenityMap.put("memorial", AmenityType.HISTORIC); //$NON-NLS-1$
amenityMap.put("pa", AmenityType.HISTORIC); //$NON-NLS-1$
amenityMap.put("monument", AmenityType.HISTORIC); //$NON-NLS-1$
amenityMap.put("ruins", AmenityType.HISTORIC); //$NON-NLS-1$
amenityMap.put("wayside_cross", AmenityType.HISTORIC); //$NON-NLS-1$
amenityMap.put("wayside_shrine", AmenityType.HISTORIC); //$NON-NLS-1$
amenityMap.put("wreck", AmenityType.HISTORIC); //$NON-NLS-1$
amenityMap.put("alcohol", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("bakery", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("beauty", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("beverages", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("bicycle", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("books", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("boutique", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("butcher", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("car", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("car_repair", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("charity", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("chemist", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("clothes", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("computer", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("confectionery", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("convenience", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("department_store", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("dry_cleaning", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("doityourself", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("electronics", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("fabrics", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("farm", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("florist", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("funeral_directors", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("furniture", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("garden_centre", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("general", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("gift", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("glaziery", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("greengrocer", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("hairdresser", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("hardware", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("hearing_aids", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("hifi", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("ice_cream", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("hardware", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("hearing_aids", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("hifi", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("ice_cream", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("jewelry", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("kiosk", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("laundry", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("mall", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("massage", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("money_lender", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("motorcycle", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("newsagent", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("optician", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("organic", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("outdoor", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("pawnbroker", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("second_hand", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("sports", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("stationery", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("supermarket", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("shoes", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("tattoo", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("toys", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("travel_agency", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("variety_store", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("video", AmenityType.SHOP); //$NON-NLS-1$
amenityMap.put("dog_park", AmenityType.LEISURE); //$NON-NLS-1$
amenityMap.put("sports_centre", AmenityType.LEISURE); //$NON-NLS-1$
amenityMap.put("golf_course", AmenityType.LEISURE); //$NON-NLS-1$
amenityMap.put("stadium", AmenityType.LEISURE); //$NON-NLS-1$
amenityMap.put("track", AmenityType.LEISURE); //$NON-NLS-1$
amenityMap.put("pitch", AmenityType.LEISURE); //$NON-NLS-1$
amenityMap.put("water_park", AmenityType.LEISURE); //$NON-NLS-1$
amenityMap.put("marina", AmenityType.LEISURE); //$NON-NLS-1$
amenityMap.put("slipway", AmenityType.LEISURE); //$NON-NLS-1$
amenityMap.put("fishing", AmenityType.LEISURE); //$NON-NLS-1$
amenityMap.put("nature_reserve", AmenityType.LEISURE); //$NON-NLS-1$
amenityMap.put("park", AmenityType.LEISURE); //$NON-NLS-1$
amenityMap.put("playground", AmenityType.LEISURE); //$NON-NLS-1$
amenityMap.put("garden", AmenityType.LEISURE); //$NON-NLS-1$
amenityMap.put("common", AmenityType.LEISURE); //$NON-NLS-1$
amenityMap.put("ice_rink", AmenityType.LEISURE); //$NON-NLS-1$
amenityMap.put("miniature_golf", AmenityType.LEISURE); //$NON-NLS-1$
amenityMap.put("dance", AmenityType.LEISURE); //$NON-NLS-1$
amenityMap.put("9pin", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("10pin", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("archery", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("athletics", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("australian_football", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("baseball", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("basketball", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("beachvolleyball", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("boules", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("bowls", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("canoe", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("chess", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("climbing", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("cricket", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("cricket_nets", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("croquet", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("cycling", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("diving", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("dog_racing", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("equestrian", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("football", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("golf", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("gymnastics", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("hockey", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("horse_racing", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("ice_stock", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("korfball", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("motor", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("multi", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("orienteering", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("paddle_tennis", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("paragliding", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("pelota", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("racquet", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("rowing", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("rugby", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("shooting", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("skating", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("skateboard", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("skiing", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("soccer", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("swimming", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("table_tennis", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("team_handball", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("tennis", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("toboggan", AmenityType.SPORT); //$NON-NLS-1$
amenityMap.put("volleyball", AmenityType.SPORT); //$NON-NLS-1$
// amenity sub type
amenityMap.put("place_of_worship", AmenityType.OTHER); //$NON-NLS-1$
amenityMap.put("restaurant", AmenityType.SUSTENANCE); //$NON-NLS-1$
amenityMap.put("food_court", AmenityType.SUSTENANCE); //$NON-NLS-1$
amenityMap.put("fast_food", AmenityType.SUSTENANCE); //$NON-NLS-1$
amenityMap.put("drinking_water", AmenityType.SUSTENANCE); //$NON-NLS-1$
amenityMap.put("bbq", AmenityType.SUSTENANCE); //$NON-NLS-1$
amenityMap.put("pub", AmenityType.SUSTENANCE); //$NON-NLS-1$
amenityMap.put("bar", AmenityType.SUSTENANCE); //$NON-NLS-1$
amenityMap.put("cafe", AmenityType.SUSTENANCE); //$NON-NLS-1$
amenityMap.put("biergarten", AmenityType.SUSTENANCE); //$NON-NLS-1$
amenityMap.put("kindergarten", AmenityType.EDUCATION); //$NON-NLS-1$
amenityMap.put("school", AmenityType.EDUCATION); //$NON-NLS-1$
amenityMap.put("college", AmenityType.EDUCATION); //$NON-NLS-1$
amenityMap.put("library", AmenityType.EDUCATION); //$NON-NLS-1$
amenityMap.put("university", AmenityType.EDUCATION); //$NON-NLS-1$
amenityMap.put("ferry_terminal", AmenityType.TRANSPORTATION); //$NON-NLS-1$
amenityMap.put("bicycle_parking", AmenityType.TRANSPORTATION); //$NON-NLS-1$
amenityMap.put("bicycle_rental", AmenityType.TRANSPORTATION); //$NON-NLS-1$
amenityMap.put("bus_station", AmenityType.TRANSPORTATION); //$NON-NLS-1$
amenityMap.put("car_rental", AmenityType.TRANSPORTATION); //$NON-NLS-1$
amenityMap.put("car_sharing", AmenityType.TRANSPORTATION); //$NON-NLS-1$
amenityMap.put("fuel", AmenityType.TRANSPORTATION); //$NON-NLS-1$
amenityMap.put("car_wash", AmenityType.TRANSPORTATION); //$NON-NLS-1$
amenityMap.put("grit_bin", AmenityType.TRANSPORTATION); //$NON-NLS-1$
amenityMap.put("parking", AmenityType.TRANSPORTATION); //$NON-NLS-1$
amenityMap.put("taxi", AmenityType.TRANSPORTATION); //$NON-NLS-1$
amenityMap.put("atm", AmenityType.FINANCE); //$NON-NLS-1$
amenityMap.put("bank", AmenityType.FINANCE); //$NON-NLS-1$
amenityMap.put("bureau_de_change", AmenityType.FINANCE); //$NON-NLS-1$
amenityMap.put("pharmacy", AmenityType.HEALTHCARE); //$NON-NLS-1$
amenityMap.put("hospital", AmenityType.HEALTHCARE); //$NON-NLS-1$
amenityMap.put("baby_hatch", AmenityType.HEALTHCARE); //$NON-NLS-1$
amenityMap.put("dentist", AmenityType.HEALTHCARE); //$NON-NLS-1$
amenityMap.put("doctors", AmenityType.HEALTHCARE); //$NON-NLS-1$
amenityMap.put("veterinary", AmenityType.HEALTHCARE); //$NON-NLS-1$
amenityMap.put("first_aid", AmenityType.HEALTHCARE); //$NON-NLS-1$
amenityMap.put("architect_office", AmenityType.ENTERTAINMENT); //$NON-NLS-1$
amenityMap.put("arts_centre", AmenityType.ENTERTAINMENT); //$NON-NLS-1$
amenityMap.put("cinema", AmenityType.ENTERTAINMENT); //$NON-NLS-1$
amenityMap.put("community_centre", AmenityType.ENTERTAINMENT); //$NON-NLS-1$
amenityMap.put("fountain", AmenityType.ENTERTAINMENT); //$NON-NLS-1$
amenityMap.put("nightclub", AmenityType.ENTERTAINMENT); //$NON-NLS-1$
amenityMap.put("stripclub", AmenityType.ENTERTAINMENT); //$NON-NLS-1$
amenityMap.put("studio", AmenityType.ENTERTAINMENT); //$NON-NLS-1$
amenityMap.put("theatre", AmenityType.ENTERTAINMENT); //$NON-NLS-1$
amenityMap.put("sauna", AmenityType.ENTERTAINMENT); //$NON-NLS-1$
amenityMap.put("brothel", AmenityType.ENTERTAINMENT); //$NON-NLS-1$
amenityMap.put("bay", AmenityType.NATURAL); //$NON-NLS-1$
amenityMap.put("beach", AmenityType.NATURAL); //$NON-NLS-1$
amenityMap.put("cave_entrance", AmenityType.NATURAL); //$NON-NLS-1$
amenityMap.put("cliff", AmenityType.NATURAL); //$NON-NLS-1$
amenityMap.put("coastline", AmenityType.NATURAL); //$NON-NLS-1$
amenityMap.put("fell", AmenityType.NATURAL); //$NON-NLS-1$
amenityMap.put("glacier", AmenityType.NATURAL); //$NON-NLS-1$
amenityMap.put("heath", AmenityType.NATURAL); //$NON-NLS-1$
amenityMap.put("land", AmenityType.NATURAL); //$NON-NLS-1$
amenityMap.put("heath", AmenityType.NATURAL); //$NON-NLS-1$
amenityMap.put("marsh", AmenityType.NATURAL); //$NON-NLS-1$
amenityMap.put("mud", AmenityType.NATURAL); //$NON-NLS-1$
amenityMap.put("peak", AmenityType.NATURAL); //$NON-NLS-1$
amenityMap.put("sand", AmenityType.NATURAL); //$NON-NLS-1$
amenityMap.put("scree", AmenityType.NATURAL); //$NON-NLS-1$
amenityMap.put("scrub", AmenityType.NATURAL); //$NON-NLS-1$
amenityMap.put("spring", AmenityType.NATURAL); //$NON-NLS-1$
amenityMap.put("stone", AmenityType.NATURAL); //$NON-NLS-1$
amenityMap.put("tree", AmenityType.NATURAL); //$NON-NLS-1$
amenityMap.put("volcano", AmenityType.NATURAL); //$NON-NLS-1$
amenityMap.put("water", AmenityType.NATURAL); //$NON-NLS-1$
amenityMap.put("wetland", AmenityType.NATURAL); //$NON-NLS-1$
amenityMap.put("internet_access", AmenityType.OTHER); //$NON-NLS-1$
amenityMap.put("bench", AmenityType.OTHER); //$NON-NLS-1$
amenityMap.put("clock", AmenityType.OTHER); //$NON-NLS-1$
amenityMap.put("courthouse", AmenityType.OTHER); //$NON-NLS-1$
amenityMap.put("crematorium", AmenityType.OTHER); //$NON-NLS-1$
amenityMap.put("embassy", AmenityType.OTHER); //$NON-NLS-1$
amenityMap.put("emergency_phone", AmenityType.OTHER); //$NON-NLS-1$
amenityMap.put("fire_hydrant", AmenityType.OTHER); //$NON-NLS-1$
amenityMap.put("fire_station", AmenityType.OTHER); //$NON-NLS-1$
amenityMap.put("grave_yard", AmenityType.OTHER); //$NON-NLS-1$
amenityMap.put("hunting_stand", AmenityType.OTHER); //$NON-NLS-1$
amenityMap.put("marketplace", AmenityType.OTHER); //$NON-NLS-1$
amenityMap.put("police", AmenityType.OTHER); //$NON-NLS-1$
amenityMap.put("post_box", AmenityType.OTHER); //$NON-NLS-1$
amenityMap.put("post_office", AmenityType.OTHER); //$NON-NLS-1$
amenityMap.put("prison", AmenityType.OTHER); //$NON-NLS-1$
amenityMap.put("public_building", AmenityType.OTHER); //$NON-NLS-1$
amenityMap.put("recycling", AmenityType.OTHER); //$NON-NLS-1$
amenityMap.put("shelter", AmenityType.OTHER); //$NON-NLS-1$
amenityMap.put("telephone", AmenityType.OTHER); //$NON-NLS-1$
amenityMap.put("toilets", AmenityType.OTHER); //$NON-NLS-1$
amenityMap.put("townhall", AmenityType.OTHER); //$NON-NLS-1$
amenityMap.put("vending_machine", AmenityType.OTHER); //$NON-NLS-1$
amenityMap.put("waste_basket", AmenityType.OTHER); //$NON-NLS-1$
amenityMap.put("waste_disposal", AmenityType.OTHER); //$NON-NLS-1$
}
}

View file

@ -1943,13 +1943,14 @@ public class IndexCreator {
public static void main(String[] args) throws IOException, SAXException, SQLException {
IndexCreator creator = new IndexCreator(new File("e:/Information/OSM maps/osmand/"));
creator.setIndexMap(true);
// creator.setIndexMap(true);
creator.setIndexPOI(true);
// creator.setNodesDBFile(new File("e:/Information/OSM maps/osmand/minsk.tmp.odb"));
// creator.generateIndexes(new File("e:/Information/OSM maps/belarus osm/minsk.osm"), new ConsoleProgressImplementation(3), null);
creator.setNodesDBFile(new File("e:/Information/OSM maps/osmand/minsk.tmp.odb"));
creator.generateIndexes(new File("e:/Information/OSM maps/belarus osm/minsk.osm"), new ConsoleProgressImplementation(3), null);
creator.setNodesDBFile(new File("e:/Information/OSM maps/osmand/belarus_nodes.tmp.odb"));
creator.generateIndexes(new File("e:/Information/OSM maps/belarus osm/belarus_2010_09_03.osm.bz2"), new ConsoleProgressImplementation(3), null);
// creator.setNodesDBFile(new File("e:/Information/OSM maps/osmand/belarus_nodes.tmp.odb"));
// creator.generateIndexes(new File("e:/Information/OSM maps/belarus osm/belarus_2010_09_03.osm.bz2"), new ConsoleProgressImplementation(3), null);
// creator.setNodesDBFile(new File("e:/Information/OSM maps/osmand/ams.tmp.odb"));
// creator.generateIndexes(new File("e:/Information/OSM maps/osm_map/ams_part_map.osm"), new ConsoleProgressImplementation(3), null);

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.osmand" android:versionName="0.4.1" android:versionCode="15">
package="net.osmand" android:versionName="0.4.1" android:versionCode="16">
<application android:icon="@drawable/icon" android:label="@string/app_name"
android:debuggable="true" android:name=".activities.OsmandApplication" android:description="@string/app_description">
<activity android:name=".activities.MainMenuActivity"

View file

@ -16,6 +16,7 @@ import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import net.osmand.AmenityIndexRepository;
@ -28,6 +29,7 @@ import net.osmand.data.Amenity;
import net.osmand.data.AmenityType;
import net.osmand.osm.Entity;
import net.osmand.osm.EntityInfo;
import net.osmand.osm.MapRenderingTypes;
import net.osmand.osm.MapUtils;
import net.osmand.osm.Node;
import net.osmand.osm.OpeningHoursParser;
@ -184,7 +186,7 @@ public class EditingPOIActivity {
@Override
public void afterTextChanged(Editable s) {
String str = s.toString();
AmenityType t = AmenityType.getAmenityMap().get(str);
AmenityType t = MapRenderingTypes.getAmenityNameToType().get(str);
if(t != null && a.getType() != t){
a.setType(t);
typeButton.setText(AmenityType.toPublicString(t));
@ -240,7 +242,27 @@ public class EditingPOIActivity {
final String msg = n.getId() == -1 ? resources.getString(R.string.poi_action_add) : resources
.getString(R.string.poi_action_change);
String action = n.getId() == -1 ? CREATE_ACTION : MODIFY_ACTION;
n.putTag(a.convertToAmenityTag(), typeText.getText().toString());
Map<AmenityType, Map<String, String>> typeNameToTagVal = MapRenderingTypes.getAmenityTypeNameToTagVal();
AmenityType type = a.getType();
String tag = type.getDefaultTag();
String subType = typeText.getText().toString();
String val = subType;
if (typeNameToTagVal.containsKey(type)) {
Map<String, String> map = typeNameToTagVal.get(type);
if (map.containsKey(subType)) {
String res = map.get(subType);
if (res != null) {
int i = res.indexOf(' ');
if (i != -1) {
tag = res.substring(0, i);
val = res.substring(i + 1);
} else {
tag = res;
}
}
}
}
n.putTag(tag, val);
n.putTag(OSMTagKey.NAME.getValue(), nameText.getText().toString());
if (openingHours.getText().toString().length() == 0) {
n.removeTag(OSMTagKey.OPENING_HOURS.getValue());
@ -267,8 +289,9 @@ public class EditingPOIActivity {
}
private void updateSubTypesAdapter(AmenityType t){
Set<String> subCategories = new LinkedHashSet<String>(AmenityType.getSubCategories(t));
for(String s : AmenityType.getAmenityMap().keySet()){
for(String s : MapRenderingTypes.getAmenityNameToType().keySet()){
if(!subCategories.contains(s)){
subCategories.add(s);
}