Skip to content

Commit 4cdbfbe

Browse files
committed
update importer script
1 parent f8af84c commit 4cdbfbe

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

importer/import_pbf.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@ elif [ "$#" -eq 2 ]; then
1616
D=${2}
1717
elif [ "$#" -eq 3 ]; then
1818
D=${2}
19-
POSTAL=${3}
19+
EXTRA_POST=${3}
20+
elif [ "$#" -eq 4 ]; then
21+
D=${2}
22+
EXTRA_POST=${3}
23+
POSTAL=${4}
2024
else
21-
echo "Usage: ./import_pbf.sh openstreetmapfilename [imported-dir-name]"
25+
echo "Usage: ./import_pbf.sh openstreetmapfilename [imported-dir-name] [extra_postcodes] [libpostal_country]"
2226
exit 0
2327
fi
2428

@@ -39,8 +43,10 @@ for module in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 17 22; do
3943
done
4044
#"$PROGPATH"/libosmscout/install/bin/Import --altLangOrder en --typefile "$PROGPATH"/stylesheet/map.ost --destinationDirectory "$D"/tmp "$1"
4145

42-
if [ "$#" -eq 3 ]; then
43-
"$PROGPATH"/importer "$D"/tmp "$D" "$PROGPATH"/stylesheet/whitelist "$POSTAL"
46+
if [ "$#" -eq 4 ]; then
47+
"$PROGPATH"/importer "$D"/tmp "$D" "$PROGPATH"/stylesheet/whitelist "$EXTRA_POST" "$POSTAL"
48+
elif [ "$#" -eq 3 ]; then
49+
"$PROGPATH"/importer "$D"/tmp "$D" "$PROGPATH"/stylesheet/whitelist "$EXTRA_POST"
4450
else
4551
"$PROGPATH"/importer "$D"/tmp "$D" "$PROGPATH"/stylesheet/whitelist
4652
fi

importer/src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ int main(int argc, char* argv[])
900900

901901
if (argc<4)
902902
{
903-
std::cerr << "importer <libosmscout map directory> <geocoder-nlp database directory> <whitelist file> [postal_codes.csv] [<postal_country_parser_code>] [address_parser_directory] [verbose]\n";
903+
std::cerr << "importer <libosmscout map directory> <geocoder-nlp database directory> <whitelist file> [postal_codes.csv] [postal_country_parser_code] [address_parser_directory] [verbose]\n";
904904
std::cerr << "When using optional parameters, you have to specify all of the perceiving ones\n";
905905
return 1;
906906
}

0 commit comments

Comments
 (0)