101
clog << "Exception of unknown type!"<<std::endl;
102
clog << "Exception of unknown type!" << endl;
105
std::clog<<"max tree depth:"<<depth<<std::endl;
106
std::clog<<"split ratio:"<<ratio<<std::endl;
106
clog << "max tree depth:" << depth << endl;
107
clog << "split ratio:" << ratio << endl;
108
vector<string>::const_iterator itr=shape_files.begin();
109
if (itr==shape_files.end())
109
vector<string>::const_iterator itr = shape_files.begin();
110
if (itr == shape_files.end())
111
std::clog << "no shape files to index"<<std::endl;
112
clog << "no shape files to index" << endl;
114
115
while (itr != shape_files.end())
116
std::clog<<"processing "<<*itr << std::endl;
117
clog << "processing " << *itr << endl;
117
118
//shape_file shp;
118
std::string shapename(*itr++);
119
shape_file shp(shapename+".shp");
121
if (!shp.is_open()) {
122
std::clog<<"error : cannot open "<< (shapename+".shp") <<"\n";
119
std::string shapename (*itr++);
120
std::string shapename_full (shapename+".shp");
122
if (! boost::filesystem::exists (shapename_full))
124
clog << "error : file " << shapename_full << " doesn't exists" << endl;
128
shape_file shp (shapename_full);
130
if (! shp.is_open()) {
131
clog << "error : cannot open " << shapename_full << endl;
126
135
int code = shp.read_xdr_integer(); //file_code == 9994
127
std::clog << code << "\n";
136
clog << code << endl;
130
139
int file_length=shp.read_xdr_integer();
134
143
shp.read_envelope(extent);
137
std::clog<<"length="<<file_length<<std::endl;
138
std::clog<<"version="<<version<<std::endl;
139
std::clog<<"type="<<shape_type<<std::endl;
140
std::clog<<"extent:"<<extent<<std::endl;
146
clog << "length=" << file_length << endl;
147
clog << "version=" << version << endl;
148
clog << "type=" << shape_type << endl;
149
clog << "extent:" << extent << endl;
203
std::clog<<" number shapes="<<count<<std::endl;
212
clog << " number shapes=" << count << endl;
205
214
std::fstream file((shapename+".index").c_str(),
206
215
std::ios::in | std::ios::out | std::ios::trunc | std::ios::binary);
208
std::clog << "cannot open index file for writing file \""
209
<<(shapename+".index")<<"\""<<std::endl;
217
clog << "cannot open index file for writing file \""
218
<< (shapename+".index") << "\"" << endl;
212
221
std::clog<<" number nodes="<<tree.count()<<std::endl;