fix bugs
git-svn-id: https://osmand.googlecode.com/svn/trunk@529 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
parent
66c6aceb80
commit
59f16364cd
6 changed files with 28 additions and 23 deletions
|
@ -12,15 +12,16 @@ public class ToDoConstants {
|
|||
|
||||
// FOR 0.4 beta RELEASE
|
||||
// ! 89. Transport redesign UI (enable run from context menu, switch go to goal/not) !
|
||||
// ! 95. Show progress while map rendered and loaded
|
||||
// ! 90. Use Junidecode library on the client for english translation (for map rendering and other save disk space)
|
||||
//
|
||||
// ! 95. Show progress while map rendered and loaded (Issue)
|
||||
|
||||
// !_25. Add all attributes needed for routing (highway attributes, turn_restrictions)
|
||||
// !_22. Verify all POI has a point_type (in order to search them)
|
||||
// !_1 . VELCOM
|
||||
// !_26. Download voice data (Issue)
|
||||
// !_18. Fix loading map data in rotated mode (check properly boundaries) +/-
|
||||
// !_28. Rotate crash (progress dialog)
|
||||
// _29. Fix memory for netherlands map creator
|
||||
// _18. Fix loading map data in rotated mode (check properly boundaries) +/-
|
||||
// _30. About screen
|
||||
|
||||
// not required
|
||||
// ! 81. Add some objects to POI category (1) to add them into OSM 2) to help navigation)
|
||||
|
@ -37,7 +38,7 @@ public class ToDoConstants {
|
|||
// 91. Invent binary format (minimize disk space, maximize speed)
|
||||
// 92. Replace poi index with standard map index and unify POI categories
|
||||
// 94. Revise index to decrease their size (especially address) - replace to float lat/lon and remove for POI
|
||||
// eng_name, possibly remove en part for adress
|
||||
// remove en_names from POI (possibly from address)
|
||||
|
||||
|
||||
///////////////////////////// UNKNOWN STATE ////////////////////
|
||||
|
@ -53,6 +54,7 @@ public class ToDoConstants {
|
|||
|
||||
// DONE ANDROID :
|
||||
// 93. Implement multitype vector objects - building with fence, road & tram ...
|
||||
// 90. Use Junidecode library on the client for english translation for map rendering
|
||||
|
||||
// DONE SWING
|
||||
// 12. Reinvent UI of swing app (remove Region object and clear other MapObject)
|
||||
|
|
|
@ -139,12 +139,13 @@ public class IndexCreator {
|
|||
private PreparedStatement mapLocsStatLevel2;
|
||||
// private RTree mapTree;
|
||||
|
||||
// save it in memory while that is allowed
|
||||
// MEMORY map : save it in memory while that is allowed
|
||||
private Map<Long, Set<Integer>> multiPolygonsWays = new LinkedHashMap<Long, Set<Integer>>();
|
||||
private Map<Long, List<Way>> lowLevelWaysSt = new LinkedHashMap<Long, List<Way>>();
|
||||
private Map<Long, List<Way>> lowLevelWaysEnd = new LinkedHashMap<Long, List<Way>>();
|
||||
|
||||
// choose what to use ?
|
||||
|
||||
|
||||
// MEMORY address : choose what to use ?
|
||||
private boolean loadInMemory = true;
|
||||
private PreparedStatement addressSearchStreetStat;
|
||||
private PreparedStatement addressSearchBuildingStat;
|
||||
|
@ -155,7 +156,7 @@ public class IndexCreator {
|
|||
private Set<Long> addressStreetNodeLocalSet = new LinkedHashSet<Long>();
|
||||
|
||||
|
||||
// address structure
|
||||
// MEMORY address : address structure
|
||||
// load it in memory
|
||||
private Map<EntityId, City> cities = new LinkedHashMap<EntityId, City>();
|
||||
private DataTileManager<City> cityVillageManager = new DataTileManager<City>(13);
|
||||
|
@ -1144,7 +1145,6 @@ public class IndexCreator {
|
|||
}
|
||||
boolean writeIntoDB = true;
|
||||
boolean ring = true;
|
||||
// TODO check this simplification for multipolygons and other
|
||||
if(e instanceof Way && level > 0){
|
||||
List<Node> nodes = ((Way) e).getNodes();
|
||||
Node n = nodes.get(0);
|
||||
|
@ -1710,17 +1710,14 @@ public class IndexCreator {
|
|||
// 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);
|
||||
// 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);
|
||||
|
||||
// creator.setNodesDBFile(new File("e:/Information/OSM maps/osmand/den_haag.tmp.odb"));
|
||||
// creator.generateIndexes(new File("e:/Information/OSM maps/osm_map/den_haag.osm"), new ConsoleProgressImplementation(3), null);
|
||||
|
||||
// creator.setNodesDBFile(new File("e:/Information/OSM maps/osmand/one.tmp.odb"));
|
||||
// creator.generateIndexes(new File("e:/Information/OSM maps/osm_map/one_multipolygon.osm"), new ConsoleProgressImplementation(3), null);
|
||||
|
||||
// creator.setNodesDBFile(new File("e:/Information/OSM maps/osmand/netherlands.tmp.odb"));
|
||||
// creator.generateIndexes(new File("e:/Information/OSM maps/osm_map/netherlands.osm.bz2"), new ConsoleProgressImplementation(1), null);
|
||||
creator.setNodesDBFile(new File("e:/Information/OSM maps/osmand/netherlands.tmp.odb"));
|
||||
creator.generateIndexes(new File("e:/Information/OSM maps/osm_map/netherlands.osm.bz2"), new ConsoleProgressImplementation(1), null);
|
||||
|
||||
/*try {
|
||||
// RTree rtree = new RTree("e:/Information/OSM maps/osmand/Belarus_2010_09_03.map.odb_ind");
|
||||
|
|
|
@ -6,5 +6,6 @@
|
|||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
|
||||
<classpathentry kind="lib" path="lib/bzip2-20090327.jar"/>
|
||||
<classpathentry kind="lib" path="lib/tuprolog.jar"/>
|
||||
<classpathentry kind="lib" path="lib/junidecode-0.1.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
|
BIN
OsmAnd/lib/junidecode-0.1.jar
Normal file
BIN
OsmAnd/lib/junidecode-0.1.jar
Normal file
Binary file not shown.
|
@ -19,6 +19,7 @@ import java.util.Set;
|
|||
|
||||
import net.osmand.IProgress;
|
||||
import net.osmand.LogUtil;
|
||||
import net.osmand.OsmandSettings;
|
||||
import net.osmand.data.index.IndexConstants;
|
||||
import net.osmand.osm.MapRenderObject;
|
||||
import net.osmand.osm.MapRenderingTypes;
|
||||
|
@ -359,7 +360,7 @@ public class MapRenderRepositories {
|
|||
|
||||
int width = (int) calcDiffPixelX(cRotate, tileRect.right - tileRect.left, tileRect.bottom - tileRect.top);
|
||||
int height = (int) calcDiffPixelY(cRotate, tileRect.right - tileRect.left, tileRect.bottom - tileRect.top);
|
||||
Bitmap bmp = renderer.generateNewBitmap(width, height, tileRect.left, tileRect.top, cObjects, cZoom, cRotate);
|
||||
Bitmap bmp = renderer.generateNewBitmap(width, height, tileRect.left, tileRect.top, cObjects, cZoom, cRotate, OsmandSettings.usingEnglishNames(context));
|
||||
Bitmap oldBmp = this.bmp;
|
||||
this.bmp = bmp;
|
||||
cachedWaysLoc = newLoc;
|
||||
|
@ -450,7 +451,8 @@ public class MapRenderRepositories {
|
|||
List<List<Long>> completedRings, List<List<Long>> incompletedRings, Integer type, List<MapRenderObject> directList,
|
||||
List<MapRenderObject> inverselist) {
|
||||
MultyPolygon pl = new MultyPolygon();
|
||||
pl.setType(type << 1);
|
||||
// delete direction last bit (to not show point)
|
||||
pl.setType((type & 0x7fff) << 1);
|
||||
for (int km = 0; km < 2; km++) {
|
||||
List<MapRenderObject> list = km == 0 ? directList : inverselist;
|
||||
for (MapRenderObject o : list) {
|
||||
|
|
|
@ -14,6 +14,7 @@ import net.osmand.R;
|
|||
import net.osmand.osm.MapRenderObject;
|
||||
import net.osmand.osm.MapRenderingTypes;
|
||||
import net.osmand.osm.MultyPolygon;
|
||||
import net.sf.junidecode.Junidecode;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
|
@ -254,7 +255,7 @@ public class OsmandRenderer {
|
|||
|
||||
|
||||
public Bitmap generateNewBitmap(int width, int height, float leftTileX, float topTileY,
|
||||
List<MapRenderObject> objects, int zoom, float rotate) {
|
||||
List<MapRenderObject> objects, int zoom, float rotate, boolean useEnglishNames) {
|
||||
long now = System.currentTimeMillis();
|
||||
// put in order map
|
||||
int sz = objects.size();
|
||||
|
@ -318,7 +319,7 @@ public class OsmandRenderer {
|
|||
}
|
||||
}
|
||||
}
|
||||
drawTextOverCanvas(rc, cv);
|
||||
drawTextOverCanvas(rc, cv, useEnglishNames);
|
||||
log.info(String.format("Rendering has been done in %s ms. (%s points, %s points inside)", System.currentTimeMillis() - now, //$NON-NLS-1$
|
||||
rc.pointCount,rc.pointInsideCount));
|
||||
}
|
||||
|
@ -327,7 +328,7 @@ public class OsmandRenderer {
|
|||
}
|
||||
private final static boolean findAllTextIntersections = true;
|
||||
|
||||
public void drawTextOverCanvas(RenderingContext rc, Canvas cv) {
|
||||
public void drawTextOverCanvas(RenderingContext rc, Canvas cv, boolean useEnglishNames) {
|
||||
List<RectF> boundsNotPathIntersect = new ArrayList<RectF>();
|
||||
List<RectF> boundsPathIntersect = new ArrayList<RectF>();
|
||||
int size = rc.textToDraw.size();
|
||||
|
@ -341,7 +342,9 @@ public class OsmandRenderer {
|
|||
next: for (int i = 0; i < size; i++) {
|
||||
TextDrawInfo text = rc.textToDraw.get(i);
|
||||
if(text.text != null){
|
||||
|
||||
if(useEnglishNames){
|
||||
text.text = Junidecode.unidecode(text.text);
|
||||
}
|
||||
RectF bounds = new RectF();
|
||||
paintText.setTextSize(text.textSize);
|
||||
paintText.setFakeBoldText(text.bold);
|
||||
|
|
Loading…
Reference in a new issue