fix issue 251

git-svn-id: https://osmand.googlecode.com/svn/trunk@801 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
Victor Shcherb 2010-12-11 14:32:38 +00:00
parent 2824e4e408
commit 1a18058ea7
4 changed files with 47 additions and 8 deletions

View file

@ -5,7 +5,7 @@ public class Version {
public static final String APP_NAME = "OsmAnd"; //$NON-NLS-1$
public static final String APP_MAP_CREATOR_NAME = "OsmAndMapCreator"; //$NON-NLS-1$
public static final String APP_VERSION = "0.5.1"; //$NON-NLS-1$
public static final String APP_DESCRIPTION = "beta (b1)"; //$NON-NLS-1$
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$

View file

@ -21,6 +21,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
@ -43,7 +44,6 @@ import net.osmand.data.City.CityType;
import net.osmand.data.index.DataIndexReader;
import net.osmand.data.index.DataIndexWriter;
import net.osmand.data.index.IndexConstants;
import net.osmand.impl.ConsoleProgressImplementation;
import net.osmand.osm.Entity;
import net.osmand.osm.LatLon;
import net.osmand.osm.MapRenderingTypes;
@ -1096,6 +1096,29 @@ public class IndexCreator {
private List<Amenity> tempAmenityList = new ArrayList<Amenity>();
public void checkEntity(Entity e){
String name = e.getTag(OSMTagKey.NAME);
if (name == null){
String msg = "";
Collection<String> keys = e.getTagKeySet();
int cnt = 0;
for (Iterator iter = keys.iterator(); iter.hasNext();) {
String key = (String) iter.next();
if (key.startsWith("name:") && key.length() <= 8) {
// ignore specialties like name:botanical
if (cnt == 0)
msg += "Entity misses default name tag, but it has localized name tag(s):\n";
msg += key + "=" + e.getTag(key) + "\n";
cnt++;
}
}
if (cnt > 0) {
msg += "Consider adding the name tag at " + e.getOsmUrl();
log.warn(msg);
}
}
}
private void iterateEntity(Entity e, int step) throws SQLException {
if (step == STEP_MAIN) {
if (indexPOI) {
@ -1105,6 +1128,7 @@ public class IndexCreator {
// load data for way (location etc...)
loadEntityData(e, false);
for (Amenity a : tempAmenityList) {
checkEntity(e);
a.setEntity(e);
if (a.getLocation() != null) {
// do not convert english name
@ -2803,11 +2827,13 @@ public class IndexCreator {
creator.recreateOnlyBinaryFile = false;
creator.deleteDatabaseIndexes = 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, MapZooms.getDefault(), null);
// creator.generateIndexes(new File("e:/Information/OSM maps/belarus osm/ukraine.osm"),
// new ConsoleProgressImplementation(3), null, MapZooms.getDefault(), 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, MapZooms.getDefault(), null);
// creator.setNodesDBFile(new File("e:/Information/OSM maps/osmand/belarus_nodes.tmp.odb")); //$NON-NLS-1$
// creator.generateIndexes(new File("e:/Information/OSM maps/belarus osm/belarus.osm.pbf"), new ConsoleProgressImplementation(3), null); //$NON-NLS-1$

View file

@ -62,6 +62,15 @@ public abstract class Entity {
return id;
}
public String getOsmUrl() {
final String browseUrl = "http://www.openstreetmap.org/browse/";
if (type == EntityType.NODE)
return browseUrl + "node/" + id;
if (type == EntityType.WAY)
return browseUrl + "way/" + id;
return null;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
@ -149,6 +158,10 @@ public abstract class Entity {
}
public String getOsmUrl() {
return EntityId.valueOf(this).getOsmUrl();
}
@Override
public String toString() {
return EntityId.valueOf(this).toString();

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.osmand" android:versionName="0.5.1" android:versionCode="22" android:installLocation="auto">
package="net.osmand" android:versionName="0.5.1" android:versionCode="23" android:installLocation="auto">
<application android:icon="@drawable/icon" android:label="@string/app_name"
android:debuggable="true" android:name=".activities.OsmandApplication" android:description="@string/app_description">
android:debuggable="false" android:name=".activities.OsmandApplication" android:description="@string/app_description">
<activity android:name=".activities.MainMenuActivity"
android:label="@string/app_name">
<intent-filter>