From 200e9096e9a4432961df310d8c14f9d476d82dfa Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 16 Jul 2010 23:28:53 +0000 Subject: [PATCH] strip the file extention of '.shp', if provided, as the shapefile driver does not expect the ext. This allows a directory of shapefiles to be indexed like: --- utils/shapeindex/shapeindex.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/shapeindex/shapeindex.cpp b/utils/shapeindex/shapeindex.cpp index 5a6f0e37c..0f717e2b9 100644 --- a/utils/shapeindex/shapeindex.cpp +++ b/utils/shapeindex/shapeindex.cpp @@ -114,14 +114,14 @@ int main (int argc,char** argv) } while (itr != shape_files.end()) { - clog << "processing " << *itr << endl; - //shape_file shp; std::string shapename (*itr++); + boost::algorithm::ireplace_last(shapename,".shp",""); + clog << "processing " << *itr << endl; std::string shapename_full (shapename+".shp"); if (! boost::filesystem::exists (shapename_full)) { - clog << "error : file " << shapename_full << " doesn't exists" << endl; + clog << "error : file " << shapename_full << " does not exist" << endl; continue; }