slightly change generator

git-svn-id: https://osmand.googlecode.com/svn/trunk@837 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
vics001 2010-12-17 23:42:41 +00:00
parent 12e69de000
commit d867e73a46
2 changed files with 184 additions and 167 deletions

View file

@ -11,6 +11,7 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.RandomAccessFile;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.text.MessageFormat;
@ -613,9 +614,15 @@ public class IndexBatchCreator {
url += "&size="+URLEncoder.encode(size);
url += "&action=update";
log.info("Updating index " + url); //$NON-NLS-1$//$NON-NLS-2$
URL ourl = new URL(url);
InputStream is = ourl.openStream();
safeClose(is, "close file"); //$NON-NLS-1$
HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
connection.setRequestMethod("POST");
connection.connect();
if(connection.getResponseCode() != HttpURLConnection.HTTP_OK){
log.error("Error updating indexes " + connection.getResponseMessage());
}
InputStream is = connection.getInputStream();
while(is.read() != -1);
connection.disconnect();
log.info("Finish updating index");
}

View file

@ -23,7 +23,8 @@
<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_download="true"
deleteFilesAfterUploading="true" indexPOI="true" indexMap="true"
indexTransport="true" indexAddress="true" mapZooms="" renderingTypesFile="">
indexTransport="true" indexAddress="true" mapZooms="" renderingTypesFile=""
>
<!-- 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:
wget="/path/to/script/wget.sh"
@ -134,118 +135,6 @@
<region name="schleswig-holstein" esize="" />
<region name="thueringen" esize="" />
</regions>
<!-- CENTRAL AMERICA -->
<regions siteToDownload="http://downloads.cloudmade.com/north_america/{0}/{0}.osm.bz2" region_prefix="" region_suffix="_CentralAmerica" skip="true">
<region name="bahamas" esize="1" />
<region name="costa_rica" esize="3" />
<region name="cuba" esize="3" />
<region name="dominica" esize="1" />
<region name="dominican_republic" esize="6" />
<region name="guatemala" esize="4" />
<region name="haiti" esize="21" />
<region name="honduras" esize="3" />
<region name="jamaica" esize="1" />
<region name="mexico" esize="58" />
<region name="anguilla" esize=""/>
<region name="antigua_and_barbuda" esize=""/>
<region name="aruba" esize=""/>
<region name="barbados" esize=""/>
<region name="belize" esize=""/>
<region name="bermuda" esize=""/>
<region name="british_virgin_islands" esize=""/>
<region name="el_salvador" esize=""/>
<region name="federation_of_saint_kitts_and_nevis" esize=""/>
<region name="greenland" esize=""/>
<region name="grenada" esize=""/>
<region name="guadeloupe" esize=""/>
<region name="martinique" esize=""/>
<region name="netherlands_antilles" esize=""/>
<region name="nicaragua" esize=""/>
<region name="panama" esize=""/>
<region name="puerto_rico" esize=""/>
<region name="st_lucia" esize=""/>
<region name="st_pierre_and_miquelon" esize=""/>
<region name="st_vincent_and_the_grenadines" esize=""/>
<region name="trinidad_and_tobago" esize=""/>
<region name="virgin_islands" esize=""/>
</regions>
<!-- SOUTH AMERICA -->
<regions siteToDownload="http://downloads.cloudmade.com/south_america/{0}/{0}.osm.bz2" region_prefix="" skip="true"
region_suffix="_SA">
<region name="argentina" esize="22"/>
<region name="bolivia" esize="5"/>
<region name="brazil" esize="68"/>
<region name="chile" esize="30"/>
<region name="colombia" esize="30"/>
<region name="ecuador" esize="15"/>
<region name="falkland_islands" esize="1"/>
<region name="french_guiana" esize="3"/>
<region name="guyana" esize="2"/>
<region name="paraguay" esize="3"/>
<region name="peru" esize="10"/>
<region name="suriname" esize="1"/>
<region name="uruguay" esize="9"/>
<region name="venezuela" esize="11"/>
</regions>
<!-- ASIA -->
<regions siteToDownload="http://downloads.cloudmade.com/asia/{0}/{0}.osm.bz2" region_prefix="" skip="true" region_suffix="_Asia">
<region name="afghanistan" esize="6"/>
<region name="bahrain" esize="1"/>
<region name="bangladesh" esize="3"/>
<region name="bhutan" esize="1"/>
<region name="british_indian_ocean_territory" esize="1"/>
<region name="brunei" esize="1"/>
<region name="cambodia" esize="2"/>
<region name="china" esize="67"/>
<region name="christmas_island" esize="1"/>
<region name="democratic_republic_of_timor-leste" esize="1"/>
<region name="gaza_strip" esize="3"/>
<region name="india" esize="47"/>
<region name="indonesia" esize="21"/>
<region name="iran" esize="11"/>
<region name="iraq" esize="3"/>
<region name="israel" esize="18"/>
<region name="jordan" esize="1"/>
<region name="kazakhstan" esize="15"/>
<region name="kuwait" esize="1"/>
<region name="kyrgyzstan" esize="4"/>
<region name="laos" esize="3"/>
<region name="lebanon" esize="3"/>
<region name="macau" esize="1"/>
<region name="malaysia" esize="7"/>
<region name="maldives" esize="1"/>
<region name="mongolia" esize="3"/>
<region name="nepal" esize="2"/>
<region name="north_korea" esize="5"/>
<region name="oman" esize="2"/>
<region name="pakistan" esize="14"/>
<region name="paracel_islands" esize="1"/>
<region name="philippines" esize="25"/>
<region name="qatar" esize="1"/>
<region name="saudi_arabia" esize="9"/>
<region name="singapore" esize="2"/>
<region name="south_korea" esize="25"/>
<region name="spratly_islands" esize="1"/>
<region name="sri_lanka" esize="2"/>
<region name="syria" esize="4"/>
<region name="taiwan" esize="4"/>
<region name="tajikistan" esize="3"/>
<region name="thailand" esize="12"/>
<region name="turkmenistan" esize="1"/>
<region name="union_of_myanmar" esize="7"/>
<region name="united_arab_emirates" esize="2"/>
<region name="uzbekistan" esize="3"/>
<region name="vietnam" esize=""/>
<region name="yemen" esize=""/>
<!-- <region name="japan" esize="500"/>
<region name="russian_federation" esize="360"/> -->
</regions>
<!-- USA -->
<regions siteToDownload="http://downloads.cloudmade.com/north_america/united_states/{0}/{0}.osm.bz2" skip="true" region_prefix="US_" region_suffix="_NorthAmerica">
@ -297,13 +186,10 @@
<region name="west_virginia" esize=""/>
<region name="wisconsin" esize=""/>
<region name="wyoming" esize=""/>
<!--
<region name="virginia" esize=""/>
<region name="texas" esize=""/>
<region name="california" esize=""/>
<region name="north_carolina" esize=""/>
-->
</regions>
<!-- Canada -->
@ -324,7 +210,7 @@
</regions>
<!-- Russia -->
<regions siteToDownload="http://gis-lab.info/data/osm/{0}/{0}.osm.bz2" region_prefix="Russia_" skip="true" region_suffix="_Asia">
<regions siteToDownload="http://gis-lab.info/data/osm/{0}/{0}.osm.bz2" region_prefix="Russia_" skip="true" region_suffix="_Asia">
<region name="adygeya" esize=""/>
<region name="altay" esize=""/>
<region name="altayskiy" esize=""/>
@ -333,7 +219,7 @@
<region name="astrakhan" esize=""/>
<region name="bashkir" esize=""/>
<region name="belgorod" esize=""/>
<region name="bryansk" esize=""/>
<region name="bryansk" esize=""/>
<region name="buryat" esize=""/>
<region name="chechen" esize=""/>
<region name="chel" esize=""/>
@ -410,13 +296,181 @@
<region name="zabaikal" esize=""/>
</regions>
<!-- ASIA -->
<regions siteToDownload="http://downloads.cloudmade.com/asia/{0}/{0}.osm.bz2" region_prefix="" region_suffix="_Asia" skip="true">
<region name="afghanistan" esize="6"/>
<region name="bahrain" esize="1"/>
<region name="bangladesh" esize="3"/>
<region name="bhutan" esize="1"/>
<region name="british_indian_ocean_territory" esize="1"/>
<region name="brunei" esize="1"/>
<region name="cambodia" esize="2"/>
<region name="china" esize="67"/>
<region name="christmas_island" esize="1"/>
<region name="democratic_republic_of_timor-leste" esize="1"/>
<region name="gaza_strip" esize="3"/>
<region name="india" esize="47"/>
<region name="indonesia" esize="21"/>
<region name="iran" esize="11"/>
<region name="iraq" esize="3"/>
<region name="israel" esize="18"/>
<region name="jordan" esize="1"/>
<region name="kazakhstan" esize="15"/>
<region name="kuwait" esize="1"/>
<region name="kyrgyzstan" esize="4"/>
<region name="laos" esize="3"/>
<region name="lebanon" esize="3"/>
<region name="macau" esize="1"/>
<region name="malaysia" esize="7"/>
<region name="maldives" esize="1"/>
<region name="mongolia" esize="3"/>
<region name="nepal" esize="2"/>
<region name="north_korea" esize="5"/>
<region name="oman" esize="2"/>
<region name="pakistan" esize="14"/>
<region name="paracel_islands" esize="1"/>
<region name="philippines" esize="25"/>
<region name="qatar" esize="1"/>
<region name="saudi_arabia" esize="9"/>
<region name="singapore" esize="2"/>
<region name="south_korea" esize="25"/>
<region name="spratly_islands" esize="1"/>
<region name="sri_lanka" esize="2"/>
<region name="syria" esize="4"/>
<region name="taiwan" esize="4"/>
<region name="tajikistan" esize="3"/>
<region name="thailand" esize="12"/>
<region name="turkmenistan" esize="1"/>
<region name="union_of_myanmar" esize="7"/>
<region name="united_arab_emirates" esize="2"/>
<region name="uzbekistan" esize="3"/>
<region name="vietnam" esize=""/>
<region name="yemen" esize=""/>
</regions>
<!-- CENTRAL AMERICA -->
<regions siteToDownload="http://downloads.cloudmade.com/north_america/{0}/{0}.osm.bz2" region_prefix="" skip="true" region_suffix="_CentralAmerica">
<region name="bahamas" esize="1" />
<region name="costa_rica" esize="3" />
<region name="cuba" esize="3" />
<region name="dominica" esize="1" />
<region name="dominican_republic" esize="6" />
<region name="guatemala" esize="4" />
<region name="haiti" esize="21" />
<region name="honduras" esize="3" />
<region name="jamaica" esize="1" />
<region name="mexico" esize="58" />
<region name="anguilla" esize=""/>
<region name="antigua_and_barbuda" esize=""/>
<region name="aruba" esize=""/>
<region name="barbados" esize=""/>
<region name="belize" esize=""/>
<region name="bermuda" esize=""/>
<region name="british_virgin_islands" esize=""/>
<region name="el_salvador" esize=""/>
<region name="federation_of_saint_kitts_and_nevis" esize=""/>
<region name="greenland" esize=""/>
<region name="grenada" esize=""/>
<region name="guadeloupe" esize=""/>
<region name="martinique" esize=""/>
<region name="netherlands_antilles" esize=""/>
<region name="nicaragua" esize=""/>
<region name="panama" esize=""/>
<region name="puerto_rico" esize=""/>
<region name="st_lucia" esize=""/>
<region name="st_pierre_and_miquelon" esize=""/>
<region name="st_vincent_and_the_grenadines" esize=""/>
<region name="trinidad_and_tobago" esize=""/>
<region name="virgin_islands" esize=""/>
</regions>
<!-- SOUTH AMERICA -->
<regions siteToDownload="http://downloads.cloudmade.com/south_america/{0}/{0}.osm.bz2" region_prefix="" skip="true"
region_suffix="_SouthAmerica">
<region name="argentina" esize="22"/>
<region name="bolivia" esize="5"/>
<region name="brazil" esize="68"/>
<region name="chile" esize="30"/>
<region name="colombia" esize="30"/>
<region name="ecuador" esize="15"/>
<region name="falkland_islands" esize="1"/>
<region name="french_guiana" esize="3"/>
<region name="guyana" esize="2"/>
<region name="paraguay" esize="3"/>
<region name="peru" esize="10"/>
<region name="suriname" esize="1"/>
<region name="uruguay" esize="9"/>
<region name="venezuela" esize="11"/>
</regions>
<!-- AFRICA -->
<regions siteToDownload="http://downloads.cloudmade.com/africa/{0}/{0}.osm.bz2" region_prefix="" region_suffix="_Africa" skip="true">
<regions siteToDownload="http://downloads.cloudmade.com/africa/{0}/{0}.osm.bz2" region_prefix="" region_suffix="_Africa" skip="true">
<region name="algeria" esize=""/>
<region name="egypt" esize=""/>
<region name="madagascar" esize=""/>
<region name="morocco" esize=""/>
<region name="morocco" esize=""/>
<region name="angola" esize=""/>
</regions>
<!-- South Africa -->
<regions siteToDownload="http://download.geofabrik.de/osm/africa/{0}.osm.pbf" region_prefix="" region_suffix="_Africa" skip="true">
<region name="south_africa_and_lesotho" esize="21"/>
</regions>
<!-- OCEANIA -->
<regions siteToDownload="http://downloads.cloudmade.com/oceania/{0}/{0}.osm.bz2" region_prefix="" region_suffix="_Oceania" skip="true">
<region name="new_zealand" esize="23"/>
</regions>
<!-- BIG countries -->
<regions siteToDownload="http://downloads.cloudmade.com/oceania/{0}/{0}.osm.bz2" region_prefix="" region_suffix="_Oceania" skip="true">
<region name="australia" esize="150"/>
</regions>
<regions siteToDownload="http://downloads.cloudmade.com/asia/{0}/{0}.osm.bz2" region_prefix="" region_suffix="_Asia" skip="true">
<region name="japan" esize="500"/>
<region name="russian_federation" esize="360"/>
</regions>
<!-- VERY SMALL COUNTRIES TO MAKE (not worth) -->
<!-- Oceania -->
<regions siteToDownload="http://downloads.cloudmade.com/oceania/{0}/{0}.osm.bz2" region_prefix="" skip="true" region_suffix="_Oceania">
<region name="american_samoa" esize=""/>
<region name="baker_island" esize=""/>
<region name="cocos_keeling_islands" esize=""/>
<region name="cook_islands" esize=""/>
<region name="federated_states_of_micronesia" esize=""/>
<region name="fiji" esize=""/>
<region name="french_polynesia" esize=""/>
<region name="guam" esize=""/>
<region name="howland_island" esize=""/>
<region name="independent_state_of_samoa" esize=""/>
<region name="jarvis_island" esize=""/>
<region name="johnston_atoll" esize=""/>
<region name="kiribati" esize=""/>
<region name="marshall_islands" esize=""/>
<region name="midway_islands" esize=""/>
<region name="nauru" esize=""/>
<region name="new_caledonia" esize=""/>
<region name="niue" esize=""/>
<region name="norfolk_island" esize=""/>
<region name="northern_mariana_islands" esize=""/>
<region name="papua_new_guinea" esize=""/>
<region name="pitcairn_islands" esize=""/>
<region name="republic_of_palau" esize=""/>
<region name="solomon_islands" esize=""/>
<region name="tokelau" esize=""/>
<region name="tonga" esize=""/>
<region name="tuvalu" esize=""/>
<region name="vanuatu" esize=""/>
<region name="wake_island" esize=""/>
<region name="wallis_and_futuna" esize=""/>
</regions>
<!-- Africa -->
<regions siteToDownload="http://downloads.cloudmade.com/africa/{0}/{0}.osm.bz2" region_prefix="" region_suffix="_Africa" skip="true">
<region name="benin" esize=""/>
<region name="botswana" esize=""/>
<region name="burkina_faso" esize=""/>
@ -470,50 +524,6 @@
<region name="western_sahara" esize=""/>
<region name="zambia" esize=""/>
<region name="zimbabwe" esize=""/>
</regions>
<!-- South Africa -->
<regions siteToDownload="http://download.geofabrik.de/osm/africa/{0}.osm.pbf" region_prefix="" region_suffix="_Africa" skip="true">
<region name="south_africa_and_lesotho" esize="21"/>
</regions>
<!-- OCEANIA -->
<regions siteToDownload="http://downloads.cloudmade.com/oceania/{0}/{0}.osm.bz2" region_prefix="" skip="true" region_suffix="_Australia">
<!-- <region name="australia" esize=""/> -->
<region name="new_zealand" esize="23"/>
<region name="american_samoa" esize=""/>
<region name="baker_island" esize=""/>
<region name="cocos_keeling_islands" esize=""/>
<region name="cook_islands" esize=""/>
<region name="federated_states_of_micronesia" esize=""/>
<region name="fiji" esize=""/>
<region name="french_polynesia" esize=""/>
<region name="guam" esize=""/>
<region name="howland_island" esize=""/>
<region name="independent_state_of_samoa" esize=""/>
<region name="jarvis_island" esize=""/>
<region name="johnston_atoll" esize=""/>
<region name="kiribati" esize=""/>
<region name="marshall_islands" esize=""/>
<region name="midway_islands" esize=""/>
<region name="nauru" esize=""/>
<region name="new_caledonia" esize=""/>
<region name="niue" esize=""/>
<region name="norfolk_island" esize=""/>
<region name="northern_mariana_islands" esize=""/>
<region name="papua_new_guinea" esize=""/>
<region name="pitcairn_islands" esize=""/>
<region name="republic_of_palau" esize=""/>
<region name="solomon_islands" esize=""/>
<region name="tokelau" esize=""/>
<region name="tonga" esize=""/>
<region name="tuvalu" esize=""/>
<region name="vanuatu" esize=""/>
<region name="wake_island" esize=""/>
<region name="wallis_and_futuna" esize=""/>
</regions>
</process>
</batch_process>