From 8f71604fe674cf2df479d98eab3e5f568bffa351 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Tue, 7 Oct 2014 12:02:12 -0700 Subject: [PATCH] If reading from standard input, use the .mbtiles as default layer name --- geojson.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/geojson.c b/geojson.c index bbb60538..8cb5f167 100644 --- a/geojson.c +++ b/geojson.c @@ -491,6 +491,10 @@ next_feature: if (cp != NULL) { *cp = '\0'; } + cp = strstr(trunc, ".mbtiles"); + if (cp != NULL) { + *cp = '\0'; + } layername = trunc; char *out = trunc; @@ -615,7 +619,7 @@ int main(int argc, char **argv) { fprintf(stderr, "%s: Only accepts one input file\n", argv[0]); exit(EXIT_FAILURE); } else { - read_json(stdin, name ? name : "standard input", layer, maxzoom, minzoom, outdb, &exclude); + read_json(stdin, name ? name : outdir, layer, maxzoom, minzoom, outdb, &exclude); } mbtiles_close(outdb, argv);