[osm-tile-server] 43/117: Take pbf file as argument

Ruben Undheim rubund-guest at moszumanska.debian.org
Tue Nov 3 23:18:18 UTC 2015


This is an automated email from the git hooks/post-receive script.

rubund-guest pushed a commit to branch master
in repository osm-tile-server.

commit 32363fd4ad2f4326bf5825e1fe0a67528021e7ea
Author: Ruben Undheim <ruben.undheim at gmail.com>
Date:   Thu Sep 3 21:34:09 2015 +0200

    Take pbf file as argument
---
 src/osm-tile-server-import.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/osm-tile-server-import.c b/src/osm-tile-server-import.c
index d29be13..5168c57 100644
--- a/src/osm-tile-server-import.c
+++ b/src/osm-tile-server-import.c
@@ -34,10 +34,17 @@ void parse_settings()
 int main(int argc, char **argv)
 {
 	char command[256];
+	char *pbffile;
+
+	if(argc != 2){
+		fprintf(stderr,"Usage: %s <pbf-file>\n",argv[0]);
+		return -1;
+	}
+	pbffile = argv[1];
 
 	parse_settings();
 
-	snprintf(command,255,"osm2pgsql --slim -d %s --cache-strategy sparse -C 100 --hstore -S /usr/share/osm2pgsql/default.style /usr/share/osm-tile-server-base/samples/liechtenstein-latest.osm.pbf",dbname);
+	snprintf(command,255,"osm2pgsql --slim -d %s --cache-strategy sparse -C 100 --hstore -S /usr/share/osm2pgsql/default.style %s",dbname,pbffile);
 	printf("Importing to database with this command:\n\n");
 	printf(" %s\n\n",command);
 	system(command);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/osm-tile-server.git



More information about the Pkg-grass-devel mailing list