Improve batch creator
This commit is contained in:
parent
003e5e9ecc
commit
6555c8fc3e
3 changed files with 31 additions and 19 deletions
|
@ -80,6 +80,7 @@ public class IndexBatchCreator {
|
||||||
boolean generateIndexes = false;
|
boolean generateIndexes = false;
|
||||||
boolean uploadIndexes = false;
|
boolean uploadIndexes = false;
|
||||||
MapZooms mapZooms = null;
|
MapZooms mapZooms = null;
|
||||||
|
Integer zoomWaySmoothness = null;
|
||||||
MapRenderingTypes types = MapRenderingTypes.getDefault();
|
MapRenderingTypes types = MapRenderingTypes.getDefault();
|
||||||
boolean deleteFilesAfterUploading = true;
|
boolean deleteFilesAfterUploading = true;
|
||||||
|
|
||||||
|
@ -166,6 +167,11 @@ public class IndexBatchCreator {
|
||||||
mapZooms = MapZooms.parseZooms(zooms);
|
mapZooms = MapZooms.parseZooms(zooms);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String szoomWaySmoothness = process.getAttribute("zoomWaySmoothness");
|
||||||
|
if(szoomWaySmoothness != null){
|
||||||
|
zoomWaySmoothness = Integer.parseInt(szoomWaySmoothness);
|
||||||
|
}
|
||||||
|
|
||||||
String f = process.getAttribute("renderingTypesFile");
|
String f = process.getAttribute("renderingTypesFile");
|
||||||
if(f == null || f.length() == 0){
|
if(f == null || f.length() == 0){
|
||||||
types = MapRenderingTypes.getDefault();
|
types = MapRenderingTypes.getDefault();
|
||||||
|
@ -433,6 +439,9 @@ public class IndexBatchCreator {
|
||||||
try {
|
try {
|
||||||
alreadyGeneratedFiles.add(f.getName());
|
alreadyGeneratedFiles.add(f.getName());
|
||||||
indexCreator.generateIndexes(f, new ConsoleProgressImplementation(3), null, mapZooms, types);
|
indexCreator.generateIndexes(f, new ConsoleProgressImplementation(3), null, mapZooms, types);
|
||||||
|
if(zoomWaySmoothness != null){
|
||||||
|
indexCreator.setZoomWaySmothness(zoomWaySmoothness);
|
||||||
|
}
|
||||||
if (indexPOI) {
|
if (indexPOI) {
|
||||||
uploadIndex(new File(indexDirFiles, poiFileName), alreadyUploadedFiles);
|
uploadIndex(new File(indexDirFiles, poiFileName), alreadyUploadedFiles);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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,
|
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')
|
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"
|
<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"
|
downloadOsmFiles="true" generateIndexes="true" uploadIndexes="true" upload_osmand_googlecode="true"
|
||||||
deleteFilesAfterUploading="true" indexPOI="true" indexMap="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.
|
<!-- 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:
|
On linux systems if wget is in your path it can be wget="wget" or you can make own script with wget command:
|
||||||
|
|
|
@ -65,7 +65,7 @@ public class IndexCreator {
|
||||||
|
|
||||||
private boolean normalizeStreets = true; // true by default
|
private boolean normalizeStreets = true; // true by default
|
||||||
private boolean saveAddressWays = true; // true by default
|
private boolean saveAddressWays = true; // true by default
|
||||||
private int zoomWaySmothness = 0;
|
private int zoomWaySmothness = 2;
|
||||||
|
|
||||||
private String regionName;
|
private String regionName;
|
||||||
private String poiFileName = null;
|
private String poiFileName = null;
|
||||||
|
@ -596,9 +596,9 @@ public class IndexCreator {
|
||||||
long time = System.currentTimeMillis();
|
long time = System.currentTimeMillis();
|
||||||
IndexCreator creator = new IndexCreator(new File("/home/victor/projects/OsmAnd/data/osm-gen/")); //$NON-NLS-1$
|
IndexCreator creator = new IndexCreator(new File("/home/victor/projects/OsmAnd/data/osm-gen/")); //$NON-NLS-1$
|
||||||
creator.setIndexMap(true);
|
creator.setIndexMap(true);
|
||||||
// creator.setIndexAddress(true);
|
creator.setIndexAddress(true);
|
||||||
// creator.setIndexPOI(true);
|
creator.setIndexPOI(true);
|
||||||
// creator.setIndexTransport(true);
|
creator.setIndexTransport(true);
|
||||||
// for NL
|
// for NL
|
||||||
// creator.setCityAdminLevel("10");
|
// creator.setCityAdminLevel("10");
|
||||||
|
|
||||||
|
@ -606,23 +606,25 @@ public class IndexCreator {
|
||||||
creator.deleteDatabaseIndexes = true;
|
creator.deleteDatabaseIndexes = true;
|
||||||
creator.deleteOsmDB = true;
|
creator.deleteOsmDB = true;
|
||||||
|
|
||||||
// creator.generateIndexes(new File("/home/victor/projects/OsmAnd/download/410/map.osm"),
|
// creator.setZoomWaySmothness(2);
|
||||||
// new ConsoleProgressImplementation(1), null, MapZooms.getDefault(), null);
|
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"),
|
// creator.generateIndexes(new File("/home/victor/projects/OsmAnd/data/osm-maps/minsk_around.osm"),
|
||||||
// new ConsoleProgressImplementation(1), null, MapZooms.getDefault(), null);
|
// new ConsoleProgressImplementation(1), null, MapZooms.getDefault(), null);
|
||||||
|
|
||||||
MapZooms mapZooms = new MapZooms();
|
// world generation
|
||||||
MapZoomPair pair1 = new MapZooms.MapZoomPair(1, 3);
|
// MapZooms mapZooms = new MapZooms();
|
||||||
MapZoomPair pair2 = new MapZooms.MapZoomPair(4, 5);
|
// MapZoomPair pair1 = new MapZooms.MapZoomPair(1, 3);
|
||||||
MapZoomPair pair3 = new MapZooms.MapZoomPair(6, 7);
|
// MapZoomPair pair2 = new MapZooms.MapZoomPair(4, 5);
|
||||||
|
// MapZoomPair pair3 = new MapZooms.MapZoomPair(6, 7);
|
||||||
mapZooms.setLevels(Arrays.asList(pair1, pair2, pair3));
|
//
|
||||||
// for coastline
|
// mapZooms.setLevels(Arrays.asList(pair1, pair2, pair3));
|
||||||
creator.setZoomWaySmothness(2);
|
// // for coastline
|
||||||
creator.generateIndexes(new File(
|
// creator.setZoomWaySmothness(2);
|
||||||
"/home/victor/projects/OsmAnd/download/basemap/basemap_1.osm"
|
// creator.generateIndexes(new File(
|
||||||
),
|
// "/home/victor/projects/OsmAnd/download/basemap/basemap_1.osm"
|
||||||
new ConsoleProgressImplementation(1), null, mapZooms, null);
|
// ),
|
||||||
|
// new ConsoleProgressImplementation(1), null, mapZooms, null);
|
||||||
|
|
||||||
|
|
||||||
// creator.setNodesDBFile(new File("e:/Information/OSM maps/osmand/minsk.tmp.odb"));
|
// creator.setNodesDBFile(new File("e:/Information/OSM maps/osmand/minsk.tmp.odb"));
|
||||||
|
|
Loading…
Reference in a new issue