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

Function process_shapefiles

tile4ms.c:49–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47
48/***********************************************************************/
49int process_shapefiles(char *metaFileNameP, char *tileFileNameP,
50 int tile_path_only)
51{
52SHPHandle hSHP, tileSHP;
53rectObj extentRect;
54lineObj line;
55shapeObj shapeRect;
56DBFHandle tileDBF;
57DBFHandle shpDBF;
58
59typedef struct DBFFieldDef_struct {
60 DBFFieldType type;
61 char name[12];
62 int width;
63 int decimals;
64} DBFFieldDef;
65
66DBFFieldDef *theFields = NULL;
67char fldname[256];
68int width;
69int decimals;
70int fieldCnt;
71int i;
72
73FILE *metaFP = NULL;
74char *p;
75char tileshapeName[256];
76char tiledbfName[256];
77char shapeFileName[256];
78int entityNum;
79
80int tilesFound = 0;
81int tilesProcessed = 0;
82
83 msInitShape(&shapeRect);
84 line.point = (pointObj *)msSmallMalloc(sizeof(pointObj)*5);
85 line.numpoints = 5;
86
87 /* open metafile */
88 /* ------------- */
89 if (NULL==(metaFP=fopen(metaFileNameP, "r"))) {
90 printf( "Unable to open:%s\n", metaFileNameP);
91 return(1);
92 }
93
94
95 /* create new tileindex shapefiles and create a header */
96 /* -------------------------------------------------- */
97 snprintf(tileshapeName, sizeof(tileshapeName), "%s.shp", tileFileNameP);
98
99 if(NULL==(tileSHP=msSHPCreate(tileFileNameP, SHP_POLYGON))) {
100 fclose(metaFP);
101 printf("Unable to create %s.shp (.shx)\n", tileFileNameP);
102 return(1);
103 }
104
105
106 /* create new tileindex dbf-file */

Callers 1

mainFunction · 0.85

Calls 15

msInitShapeFunction · 0.85
msSmallMallocFunction · 0.85
msSHPCreateFunction · 0.85
msDBFCreateFunction · 0.85
msSHPCloseFunction · 0.85
msDBFAddFieldFunction · 0.85
msDBFCloseFunction · 0.85
msDBFOpenFunction · 0.85
msDBFGetFieldCountFunction · 0.85
msSmallCallocFunction · 0.85
msDBFGetFieldInfoFunction · 0.85
strcasecmpFunction · 0.85

Tested by

no test coverage detected