Improve batch creator

This commit is contained in:
Victor Shcherb 2011-06-24 16:47:09 +02:00
parent 003e5e9ecc
commit 6555c8fc3e
3 changed files with 31 additions and 19 deletions

View file

@ -80,6 +80,7 @@ public class IndexBatchCreator {
boolean generateIndexes = false;
boolean uploadIndexes = false;
MapZooms mapZooms = null;
Integer zoomWaySmoothness = null;
MapRenderingTypes types = MapRenderingTypes.getDefault();
boolean deleteFilesAfterUploading = true;
@ -166,6 +167,11 @@ public class IndexBatchCreator {
mapZooms = MapZooms.parseZooms(zooms);
}
String szoomWaySmoothness = process.getAttribute("zoomWaySmoothness");
if(szoomWaySmoothness != null){
zoomWaySmoothness = Integer.parseInt(szoomWaySmoothness);
}
String f = process.getAttribute("renderingTypesFile");
if(f == null || f.length() == 0){
types = MapRenderingTypes.getDefault();
@ -433,6 +439,9 @@ public class IndexBatchCreator {
try {
alreadyGeneratedFiles.add(f.getName());
indexCreator.generateIndexes(f, new ConsoleProgressImplementation(3), null, mapZooms, types);
if(zoomWaySmoothness != null){
indexCreator.setZoomWaySmothness(zoomWaySmoothness);
}
if (indexPOI) {
uploadIndex(new File(indexDirFiles, poiFileName), alreadyUploadedFiles);
}

View file

@ -20,10 +20,11 @@
All these subprocess could be ran independently ! So you can create some files check them and after that try to upload on googlecode,
or you can upload any file you have to googlecode (just put into 'directory_for_index_files')
-->
<!-- zoomWaySmoothness - 1-4, typical mapZooms - 8-10;11-12;13-14;15 -->
<process directory_for_osm_files="D:/android/batch_gen_osm" directory_for_index_files="D:/android/batch_gen_index"
downloadOsmFiles="true" generateIndexes="true" uploadIndexes="true" upload_osmand_googlecode="true"
deleteFilesAfterUploading="true" indexPOI="true" indexMap="true"
indexTransport="true" indexAddress="true" mapZooms="" renderingTypesFile=""
indexTransport="true" indexAddress="true" mapZooms="" renderingTypesFile="" zoomWaySmoothness=""
>
<!-- Add wget="C:/Program Files/GNUWin32/bin/wget.exe" to process, to use wget for download.
On linux systems if wget is in your path it can be wget="wget" or you can make own script with wget command:

View file

@ -65,7 +65,7 @@ public class IndexCreator {
private boolean normalizeStreets = true; // true by default
private boolean saveAddressWays = true; // true by default
private int zoomWaySmothness = 0;
private int zoomWaySmothness = 2;
private String regionName;
private String poiFileName = null;
@ -596,9 +596,9 @@ public class IndexCreator {
long time = System.currentTimeMillis();
IndexCreator creator = new IndexCreator(new File("/home/victor/projects/OsmAnd/data/osm-gen/")); //$NON-NLS-1$
creator.setIndexMap(true);
// creator.setIndexAddress(true);
// creator.setIndexPOI(true);
// creator.setIndexTransport(true);
creator.setIndexAddress(true);
creator.setIndexPOI(true);
creator.setIndexTransport(true);
// for NL
// creator.setCityAdminLevel("10");
@ -606,23 +606,25 @@ public class IndexCreator {
creator.deleteDatabaseIndexes = true;
creator.deleteOsmDB = true;
// creator.generateIndexes(new File("/home/victor/projects/OsmAnd/download/410/map.osm"),
// new ConsoleProgressImplementation(1), null, MapZooms.getDefault(), null);
// creator.setZoomWaySmothness(2);
creator.generateIndexes(new File("/home/victor/projects/OsmAnd/data/osm-maps/germany_bayern_part.osm"),
new ConsoleProgressImplementation(1), null, MapZooms.getDefault(), null);
// creator.generateIndexes(new File("/home/victor/projects/OsmAnd/data/osm-maps/minsk_around.osm"),
// new ConsoleProgressImplementation(1), null, MapZooms.getDefault(), null);
MapZooms mapZooms = new MapZooms();
MapZoomPair pair1 = new MapZooms.MapZoomPair(1, 3);
MapZoomPair pair2 = new MapZooms.MapZoomPair(4, 5);
MapZoomPair pair3 = new MapZooms.MapZoomPair(6, 7);
mapZooms.setLevels(Arrays.asList(pair1, pair2, pair3));
// for coastline
creator.setZoomWaySmothness(2);
creator.generateIndexes(new File(
"/home/victor/projects/OsmAnd/download/basemap/basemap_1.osm"
),
new ConsoleProgressImplementation(1), null, mapZooms, null);
// world generation
// MapZooms mapZooms = new MapZooms();
// MapZoomPair pair1 = new MapZooms.MapZoomPair(1, 3);
// MapZoomPair pair2 = new MapZooms.MapZoomPair(4, 5);
// MapZoomPair pair3 = new MapZooms.MapZoomPair(6, 7);
//
// mapZooms.setLevels(Arrays.asList(pair1, pair2, pair3));
// // for coastline
// creator.setZoomWaySmothness(2);
// creator.generateIndexes(new File(
// "/home/victor/projects/OsmAnd/download/basemap/basemap_1.osm"
// ),
// new ConsoleProgressImplementation(1), null, mapZooms, null);
// creator.setNodesDBFile(new File("e:/Information/OSM maps/osmand/minsk.tmp.odb"));