2 * This file is part of mapper
4 * Copyright (C) 2007 Kaj-Michael Lang
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 * A simple CLI interface to the mapper planet2sqlite import code.
30 #include <glib/gstdio.h>
35 #include "osm-db-import.h"
37 #define OSM_DB_FILE "osm-planet.db"
40 print_fail(const gchar *msg, gint ret)
42 g_printerr("ERROR: %s\n", msg);
46 int main (int argc, char **argv)
52 return print_fail("Give bzip2 compressed planet XML file as argument", 1);
56 g_printf("Using file: %s\n", in_file);
59 osm_import_set_bbox(TRUE, atof(argv[2]), atof(argv[3]), atof(argv[4]), atof(argv[5]));
61 osm_import_set_bbox(FALSE, 0, 0, 0, 0);
64 if (osm_import(in_file, out_file)==FALSE) {
65 return print_fail("Import failed", 4);