diff --git a/utils/mapnik-index/mapnik-index.cpp b/utils/mapnik-index/mapnik-index.cpp index 069d48777..bceaa64bb 100644 --- a/utils/mapnik-index/mapnik-index.cpp +++ b/utils/mapnik-index/mapnik-index.cpp @@ -133,19 +133,34 @@ int main (int argc, char** argv) return EXIT_FAILURE; } - std::clog << "max tree depth:" << depth << std::endl; - std::clog << "split ratio:" << ratio << std::endl; + std::vector files_to_process; - if (files.size() == 0) + for (auto const& filename : files) + { + if (!mapnik::util::exists(filename)) + { + continue; + } + + if (mapnik::detail::is_csv(filename) || mapnik::detail::is_geojson(filename)) + { + files_to_process.push_back(filename); + } + } + + if (files_to_process.size() == 0) { std::clog << "no files to index" << std::endl; return EXIT_FAILURE; } + std::clog << "max tree depth:" << depth << std::endl; + std::clog << "split ratio:" << ratio << std::endl; + using box_type = mapnik::box2d; using item_type = std::pair>; - for (auto const& filename : files) + for (auto const& filename : files_to_process) { if (!mapnik::util::exists(filename)) {