diff options
| author | Søren Holm <sgh@sgh.dk> | 2018-09-05 22:17:10 +0200 |
|---|---|---|
| committer | Kristian Evers <kristianevers@gmail.com> | 2018-09-05 22:17:10 +0200 |
| commit | c11b98b058d883df6a0ef0a052ffd7565b00f921 (patch) | |
| tree | f15a8c57306ab2a5bb7db062b6a793e0ed66b751 /src/proj.c | |
| parent | 76488c5133207045f4bf9ccd3a9b4d0daf2372f5 (diff) | |
| download | PROJ-c11b98b058d883df6a0ef0a052ffd7565b00f921.tar.gz PROJ-c11b98b058d883df6a0ef0a052ffd7565b00f921.zip | |
Add -d option to proj, cs2cs and cct (#1109)
Specify number of decimals to display when transforming coordinates with either proj, cs2cs or cct.
Diffstat (limited to 'src/proj.c')
| -rw-r--r-- | src/proj.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -45,11 +45,12 @@ static int static char *cheby_str, /* string controlling Chebychev evaluation */ - *oform = (char *)0; /* output format for x-y or decimal degrees */ + *oform = (char *)0, /* output format for x-y or decimal degrees */ + oform_buffer[16]; /* Buffer for oform when using -d */ static const char *oterr = "*\t*", /* output line for unprojectable input */ - *usage = "%s\nusage: %s [ -beEfiIlmorsStTvVwW [args] ] [ +opts[=arg] ] [ files ]\n"; + *usage = "%s\nusage: %s [ -bdeEfiIlmorsStTvVwW [args] ] [ +opts[=arg] ] [ files ]\n"; static struct FACTORS facs; @@ -452,6 +453,11 @@ int main(int argc, char **argv) { if (--argc <= 0) goto noargument; oform = *++argv; continue; + case 'd': + if (--argc <= 0) goto noargument; + sprintf(oform_buffer, "%%.%df", atoi(*++argv)); + oform = oform_buffer; + break; case 'r': /* reverse input */ reversein = 1; continue; |
