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

Function main

shptreevis.c:76–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74
75
76int main( int argc, char ** argv )
77
78{
79 SHPHandle hSHP;
80 DBFHandle hDBF;
81 SHPTreeHandle qix;
82
83 int i;
84 char *myfile = NULL;
85
86 treeNodeObj *node;
87
88#ifdef MAPSERVER
89 shapeObj shape;
90 lineObj line[3];
91 pointObj pts[6];
92#else
93 SHPObject *shape;
94 double X[6], Y[6];
95#endif
96 int result;
97 char mBigEndian;
98
99 int this_rec, factor;
100
101/* -------------------------------------------------------------------- */
102/* Display a usage message. */
103/* -------------------------------------------------------------------- */
104 if( argc <= 2 )
105 {
106 printf( "shptreevis shapefile new_shapefile \n" );
107 exit( 1 );
108 }
109
110 i = 1;
111 if( *((unsigned char *) &i) == 1 )
112 mBigEndian = 0;
113 else
114 mBigEndian = 1;
115
116
117 qix = msSHPDiskTreeOpen (AddFileSuffix(argv[1],".qix"), 0 /* no debug*/);
118 if( qix == NULL )
119 {
120 printf("unable to open index file %s \n", argv[1]);
121 exit(-1);
122 }
123
124/* -------------------------------------------------------------------- */
125/* Open the passed shapefile. */
126/* -------------------------------------------------------------------- */
127 myfile = AddFileSuffix(argv[2],".shp");
128
129#ifdef MAPSERVER
130 hSHP = msSHPCreate ( myfile, SHPT_POLYGON );
131 hDBF = msDBFCreate ( AddFileSuffix(argv[2],".dbf") );
132#else
133 hSHP = SHPCreate ( myfile, SHPT_POLYGON );

Callers

nothing calls this directly

Calls 11

msSHPDiskTreeOpenFunction · 0.85
msSHPCreateFunction · 0.85
msDBFCreateFunction · 0.85
msDBFAddFieldFunction · 0.85
readTreeNodeFunction · 0.85
msSHPWriteShapeFunction · 0.85
msSHPCloseFunction · 0.85
msDBFCloseFunction · 0.85
msSHPDiskTreeCloseFunction · 0.85
AddFileSuffixFunction · 0.70

Tested by

no test coverage detected