Update index creator

This commit is contained in:
Victor Shcherb 2011-10-06 00:24:34 +02:00
parent d5078718a0
commit 26e67eeedd
4 changed files with 10 additions and 1 deletions

View file

@ -169,6 +169,7 @@ public class IndexBatchCreator {
generateIndexes = Boolean.parseBoolean(process.getAttribute("generateIndexes"));
uploadIndexes = Boolean.parseBoolean(process.getAttribute("uploadIndexes"));
deleteFilesAfterUploading = Boolean.parseBoolean(process.getAttribute("deleteFilesAfterUploading"));
IndexCreator.REMOVE_POI_DB = !Boolean.parseBoolean(process.getAttribute("keepPoiOdb"));
wget = process.getAttribute("wget");
indexPOI = Boolean.parseBoolean(process.getAttribute("indexPOI"));

View file

@ -27,7 +27,7 @@
-->
<!-- zoomWaySmoothness - 1-4, typical mapZooms - 8-10;11-12;13-14;15 -->
<process directory_for_osm_files="/home/..." directory_for_index_files="/home/..."
directory_for_uploaded_files="" list_download_regions_file="regions.xml"
directory_for_uploaded_files="" list_download_regions_file="regions.xml" keepPoiOdb="false"
downloadOsmFiles="true" generateIndexes="true" uploadIndexes="true"
upload_osmand_googlecode="true" deleteFilesAfterUploading="true" indexPOI="true" indexMap="true"
indexTransport="true" indexAddress="true">

View file

@ -52,6 +52,7 @@ public class IndexCreator {
// Sqlite better to use only for 32-bit machines
public static DBDialect dialect = DBDialect.SQLITE;
public static DBDialect mapDBDialect = DBDialect.SQLITE;
public static boolean REMOVE_POI_DB = false;
public static final int BATCH_SIZE = 5000;
public static final int BATCH_SIZE_OSM = 10000;
@ -583,6 +584,9 @@ public class IndexCreator {
accessor.closeReadingConnection();
indexPoiCreator.commitAndClosePoiFile(lastModifiedDate);
if(REMOVE_POI_DB) {
indexPoiCreator.removePoiFile();
}
indexAddressCreator.closeAllPreparedStatements();
indexTransportCreator.commitAndCloseFiles(getRTreeTransportStopsFileName(), getRTreeTransportStopsPackFileName(),
deleteDatabaseIndexes);

View file

@ -91,6 +91,10 @@ public class IndexPoiCreator extends AbstractIndexPartCreator {
}
}
public void removePoiFile(){
Algoritms.removeAllFiles(poiIndexFile);
}
private void checkEntity(Entity e) {
String name = e.getTag(OSMTagKey.NAME);
if (name == null) {