Fix issue 313, basemap

This commit is contained in:
Victor Shcherb 2011-06-20 23:14:01 +02:00
parent 932e0dc96b
commit dda3196f69
4 changed files with 77 additions and 13 deletions

View file

@ -618,14 +618,9 @@ public class IndexCreator {
mapZooms.setLevels(Arrays.asList(pair1, pair2, pair3)); mapZooms.setLevels(Arrays.asList(pair1, pair2, pair3));
// for coastline // for coastline
// creator.setZoomWaySmothness(2);
// creator.generateIndexes(new File("/home/victor/projects/OsmAnd/download/basemap/10m_coastline_out.osm");
creator.setZoomWaySmothness(2); creator.setZoomWaySmothness(2);
creator.generateIndexes(new File( creator.generateIndexes(new File(
// "/home/victor/projects/OsmAnd/download/basemap/10m_admin_level_out.osm" "/home/victor/projects/OsmAnd/download/basemap/basemap_1.osm"
// "/home/victor/projects/OsmAnd/download/basemap/10m_populated_places_out.osm"
// "/home/victor/projects/OsmAnd/download/basemap/10m_lakes_out.osm"
"/home/victor/projects/OsmAnd/download/basemap/10m_rivers.osm"
), ),
new ConsoleProgressImplementation(1), null, mapZooms, null); new ConsoleProgressImplementation(1), null, mapZooms, null);

View file

@ -3,7 +3,7 @@
package="net.osmand.plus" android:installLocation="auto" android:versionName="0.6.5" android:versionCode="34"> package="net.osmand.plus" android:installLocation="auto" android:versionName="0.6.5" android:versionCode="34">
<application android:icon="@drawable/icon" android:label="@string/app_name" <application android:icon="@drawable/icon" android:label="@string/app_name"
android:debuggable="true" android:name=".activities.OsmandApplication" android:description="@string/app_description"> android:debuggable="true" android:name=".activities.OsmandApplication" android:description="@string/app_description">
<activity android:name=".activities.MainMenuActivity" android:screenOrientation="nosensor" <activity android:name=".activities.MainMenuActivity"
android:label="@string/app_name"> android:label="@string/app_name">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />

View file

@ -279,7 +279,17 @@ public class OsmandApplication extends Application {
synchronized (OsmandApplication.this) { synchronized (OsmandApplication.this) {
startDialog = null; startDialog = null;
if (progressDlg != null) { if (progressDlg != null) {
progressDlg.dismiss(); final ProgressDialog toDismiss = progressDlg;
// toDismiss.dismiss();
uiHandler.post(new Runnable() {
@Override
public void run() {
if(toDismiss.getOwnerActivity() != null){
toDismiss.dismiss();
}
}
});
showWarnings(warnings, progressDlg.getContext()); showWarnings(warnings, progressDlg.getContext());
progressDlg = null; progressDlg = null;
} else { } else {

View file

@ -4,6 +4,12 @@
make make
make test make test
USE smothness = 2 USE smothness = 2
I. Make all 5 files
II. Merge them
III. Run Index Creator
I
------------- -------------
Coastlines Coastlines
1. Locate and run shp2osm.pl. 1. Locate and run shp2osm.pl.
@ -14,7 +20,7 @@ Example (replacing tags): perl ./shp2osm.pl 10m-coastline/10m_coastline.shp | se
4. !Fix manually Caspey Sea ! 4. !Fix manually Caspey Sea !
5. ! Check 2 ShriLanka islands (2 coastlines on one place) 5. ! Check 2 ShriLanka islands (2 coastlines on one place)
6. ! Check North America for bug! 6. ! Check North America for bug!
7. Run Index Creator. // 7. Run Index Creator.
------------------------- -------------------------
admin level admin level
@ -24,7 +30,7 @@ Example (replacing tags):
3. Run net.osmand.osm.util.FixAdminLevel0 from DataExtractionosm.jar with arg0=filename. 3. Run net.osmand.osm.util.FixAdminLevel0 from DataExtractionosm.jar with arg0=filename.
To create country tag="place" value="country" To create country tag="place" value="country"
4. Open in Josm and simply save 4. Open in Josm and simply save
5. Run Index Creator // 5. Run Index Creator
------------------------- -------------------------
cities/towns cities/towns
@ -32,7 +38,7 @@ Example (replacing tags):
1. python ogr2osm/ogr2osm.py 10m-populated-places/10m_populated_places.shp 1. python ogr2osm/ogr2osm.py 10m-populated-places/10m_populated_places.shp
Creates 10m_populated_places.osm Creates 10m_populated_places.osm
2. less 10m_populated_places.osm | sed 's/MEGACITY/place/g;s/v="1"/v="city"/g;s/v="0"/v="town"/g;s/NAME/name/g' > 10m_populated_places_out.osm 2. less 10m_populated_places.osm | sed 's/MEGACITY/place/g;s/v="1"/v="city"/g;s/v="0"/v="town"/g;s/NAME/name/g' > 10m_populated_places_out.osm
3. Run IndexCreator // 3. Run IndexCreator
------------------------- -------------------------
lakes lakes
@ -41,7 +47,7 @@ Example (replacing tags):
Creates 10m_lakes.osm Creates 10m_lakes.osm
2. Run net.osmand.osm.util.FixLinkedCoastline from DataExtractionosm.jar with arg0=filename. 2. Run net.osmand.osm.util.FixLinkedCoastline from DataExtractionosm.jar with arg0=filename.
3. Open in Josm and simply save 3. Open in Josm and simply save
4. Run IndexCreator // 4. Run IndexCreator
------------------------- -------------------------
rivers rivers
@ -50,4 +56,57 @@ Example (replacing tags):
Creates 10m_lakes.osm Creates 10m_lakes.osm
2. Run net.osmand.osm.util.FixLinkedCoastline from DataExtractionosm.jar with arg0=filename. 2. Run net.osmand.osm.util.FixLinkedCoastline from DataExtractionosm.jar with arg0=filename.
3. Open in Josm and simply save 3. Open in Josm and simply save
4. Run IndexCreator // 4. Run IndexCreator
--------------------------------------------------------------------------------
II Merging
BASH :
echo "<?xml version='1.0' encoding='UTF-8'?>" > basemap_1.osm;
echo "<osm version='0.6' generator='JOSM'>" >> basemap_1.osm;
cat 10m_coastline_out.osm | sed -r "s/'-([0-9]*)'/'-\11'/" | tail -n+3 | sed 's/<\/osm>//' >> basemap_1.osm;
cat 10m_admin_level_out.osm | sed -r "s/'-([0-9]*)'/'-\12'/" | tail -n+3 | sed 's/<\/osm>//' >> basemap_1.osm;
cat 10m_populated_places_out.osm | xmllint --format - | sed -r 's/"-([0-9]*)"/"-\13"/' | tail -n+3 | sed 's/<\/osm>//' >> basemap_1.osm;
cat 10m_rivers.osm | sed -r "s/'-([0-9]*)'/'-\14'/" | tail -n+3 | sed 's/<\/osm>//' >> basemap_1.osm;
cat 10m_lakes_out.osm | sed -r "s/'-([0-9]*)'/'-\15'/" | tail -n+3 | sed 's/<\/osm>//' >> basemap_1.osm;
echo '</osm>' >> basemap_1.osm;
TEST :
echo "<?xml version='1.0' encoding='UTF-8'?>" > basemap_1.osm;
echo "<osm version='0.6' generator='JOSM'>" >> basemap_1.osm;
echo '</osm>' >> basemap_1.osm;
cat 10m_rivers.osm | sed -r "s/'-([0-9]*)'/'-\14'/" | tail -n+3 | sed 's/<\/osm>//' >> basemap_1.osm;
READY : basemap_1.osm [1-3, 4-5,6-7].