MCPcopy Index your code
hub / github.com/MapServer/MapServer / main

Function main

shp2img.c:35–327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33MS_CVSID("$Id$")
34
35int main(int argc, char *argv[])
36{
37 int i,j,k;
38
39 mapObj *map=NULL;
40 imageObj *image = NULL;
41
42 char **layers=NULL;
43 int num_layers=0;
44
45 int layer_found=0;
46
47 char *outfile=NULL; /* no -o sends image to STDOUT */
48
49 int iterations = 1;
50 int draws = 0;
51
52 for(i=1;i<argc;i++) {
53 if (strcmp(argv[i],"-c") == 0) { /* user specified number of draws */
54 iterations = atoi(argv[i+1]);
55 printf("We will draw %d times...\n", iterations);
56 continue;
57 }
58
59 if(strcmp(argv[i], "-all_debug") == 0 && i < argc-1 ) /* global debug */
60 {
61 int debug_level = atoi(argv[++i]);
62
63 msSetGlobalDebugLevel(debug_level);
64
65 /* Send output to stderr by default */
66 if (msGetErrorFile() == NULL)
67 msSetErrorFile("stderr", NULL);
68
69 continue;
70 }
71
72 }
73
74 for(draws=0; draws<iterations; draws++) {
75
76 struct mstimeval requeststarttime, requestendtime;
77
78 if(msGetGlobalDebugLevel() >= MS_DEBUGLEVEL_TUNING)
79 msGettimeofday(&requeststarttime, NULL);
80
81 if(argc > 1 && strcmp(argv[1], "-v") == 0) {
82 printf("%s\n", msGetVersion());
83 exit(0);
84 }
85
86 /* ---- check the number of arguments, return syntax if not correct ---- */
87 if( argc < 3 ) {
88 fprintf(stdout, "\nPurpose: convert a mapfile to an image\n\n");
89 fprintf(stdout,
90 "Syntax: shp2img -m mapfile [-o image] [-e minx miny maxx maxy] [-s sizex sizey]\n"
91 " [-l \"layer1 [layers2...]\"] [-i format]\n"
92 " [-all_debug n] [-map_debug n] [-layer_debug n] [-p n] [-c n] [-d layername datavalue]\n");

Callers

nothing calls this directly

Calls 15

msSetGlobalDebugLevelFunction · 0.85
msGetErrorFileFunction · 0.85
msSetErrorFileFunction · 0.85
msGetGlobalDebugLevelFunction · 0.85
msGettimeofdayFunction · 0.85
msGetVersionFunction · 0.85
msSetupFunction · 0.85
msWriteErrorFunction · 0.85
msDebugInitFromEnvFunction · 0.85
msCleanupFunction · 0.85
msSelectOutputFormatFunction · 0.85

Tested by

no test coverage detected