+ ogr logging cosmetics

This commit is contained in:
Lucio Asnaghi 2010-11-18 22:59:21 +00:00
parent dccbe21d12
commit cda9089ddf
4 changed files with 19 additions and 30 deletions

View file

@ -32,9 +32,6 @@
// ogr
#include "ogr_converter.hpp"
using std::clog;
using std::endl;
using mapnik::feature_ptr;
using mapnik::geometry_utils;
using mapnik::geometry_type;
@ -84,7 +81,7 @@ void ogr_converter::convert_geometry (OGRGeometry* geom, feature_ptr feature, bo
case wkbUnknown:
default:
#ifdef MAPNIK_DEBUG
clog << "unknown <ogr> geometry_type=" << wkbFlatten (geom->getGeometryType()) << endl;
std::clog << "OGR Plugin: unknown <ogr> geometry_type=" << wkbFlatten (geom->getGeometryType()) << std::endl;
#endif
break;
}

View file

@ -36,9 +36,6 @@
// boost
#include <boost/algorithm/string.hpp>
using std::clog;
using std::endl;
using mapnik::datasource;
using mapnik::parameters;
@ -108,9 +105,9 @@ void ogr_datasource::bind() const
{
std::string err = CPLGetLastErrorMsg();
if( err.size() == 0 ) {
throw datasource_exception("Connection failed: " + dataset_name_ + " was not found or is not a supported format");
throw datasource_exception("OGR Plugin: connection failed: " + dataset_name_ + " was not found or is not a supported format");
} else {
throw datasource_exception(err);
throw datasource_exception("OGR Plugin: " + err);
}
}
@ -152,7 +149,7 @@ void ogr_datasource::bind() const
else
{
std::ostringstream s;
s << "missing <layer> or <layer_by_index> parameter, available layers are: ";
s << "OGR Plugin: missing <layer> or <layer_by_index> parameter, available layers are: ";
unsigned num_layers = dataset_->GetLayerCount();
bool found = false;
for (unsigned i = 0; i < num_layers; ++i )
@ -239,7 +236,7 @@ void ogr_datasource::bind() const
case OFTStringList:
case OFTWideStringList: // deprecated !
#ifdef MAPNIK_DEBUG
clog << "unhandled type_oid=" << type_oid << endl;
std::clog << "OGR Plugin: unhandled type_oid=" << type_oid << std::endl;
#endif
break;
@ -247,14 +244,14 @@ void ogr_datasource::bind() const
case OFTTime:
case OFTDateTime: // unhandled !
#ifdef MAPNIK_DEBUG
clog << "unhandled type_oid=" << type_oid << endl;
std::clog << "OGR Plugin: unhandled type_oid=" << type_oid << std::endl;
#endif
desc_.add_descriptor(attribute_descriptor(fld_name,mapnik::Object));
break;
default: // unknown
#ifdef MAPNIK_DEBUG
clog << "unknown type_oid=" << type_oid << endl;
std::clog << "OGR Plugin: unknown type_oid=" << type_oid << std::endl;
#endif
break;
}

View file

@ -35,9 +35,6 @@
#include "ogr_converter.hpp"
#include "ogr_feature_ptr.hpp"
using std::clog;
using std::endl;
using mapnik::query;
using mapnik::box2d;
using mapnik::CoordTransform;
@ -132,7 +129,7 @@ feature_ptr ogr_featureset::next()
case OFTWideStringList: // deprecated !
{
#ifdef MAPNIK_DEBUG
clog << "unhandled type_oid=" << type_oid << endl;
std::clog << "OGR Plugin: unhandled type_oid=" << type_oid << std::endl;
#endif
break;
}
@ -140,7 +137,7 @@ feature_ptr ogr_featureset::next()
case OFTBinary:
{
#ifdef MAPNIK_DEBUG
clog << "unhandled type_oid=" << type_oid << endl;
std::clog << "OGR Plugin: unhandled type_oid=" << type_oid << std::endl;
#endif
//boost::put(*feature,name,feat->GetFieldAsBinary (i, size));
break;
@ -151,7 +148,7 @@ feature_ptr ogr_featureset::next()
case OFTDateTime: // unhandled !
{
#ifdef MAPNIK_DEBUG
clog << "unhandled type_oid=" << type_oid << endl;
std::clog << "OGR Plugin: unhandled type_oid=" << type_oid << std::endl;
#endif
break;
}
@ -159,7 +156,7 @@ feature_ptr ogr_featureset::next()
default: // unknown
{
#ifdef MAPNIK_DEBUG
clog << "unknown type_oid=" << type_oid << endl;
std::clog << "OGR Plugin: unknown type_oid=" << type_oid << std::endl;
#endif
break;
}
@ -171,7 +168,7 @@ feature_ptr ogr_featureset::next()
}
#ifdef MAPNIK_DEBUG
clog << count_ << " features" << endl;
std::clog << "OGR Plugin: " << count_ << " features" << std::endl;
#endif
return feature_ptr();
}

View file

@ -42,9 +42,6 @@
#include "ogr_index.hpp"
#include "ogr_feature_ptr.hpp"
using std::clog;
using std::endl;
using mapnik::query;
using mapnik::box2d;
using mapnik::CoordTransform;
@ -81,7 +78,7 @@ ogr_index_featureset<filterT>::ogr_index_featureset(OGRDataSource & dataset,
std::sort(ids_.begin(),ids_.end());
#ifdef MAPNIK_DEBUG
std::clog<< "query size=" << ids_.size() << "\n";
std::clog << "OGR Plugin: query size=" << ids_.size() << std::endl;
#endif
itr_ = ids_.begin();
@ -147,7 +144,7 @@ feature_ptr ogr_index_featureset<filterT>::next()
case OFTWideStringList: // deprecated !
{
#ifdef MAPNIK_DEBUG
clog << "unhandled type_oid=" << type_oid << endl;
std::clog << "OGR Plugin: unhandled type_oid=" << type_oid << std::endl;
#endif
break;
}
@ -155,7 +152,7 @@ feature_ptr ogr_index_featureset<filterT>::next()
case OFTBinary:
{
#ifdef MAPNIK_DEBUG
clog << "unhandled type_oid=" << type_oid << endl;
std::clog << "OGR Plugin: unhandled type_oid=" << type_oid << std::endl;
#endif
//boost::put(*feature,name,feat->GetFieldAsBinary (i, size));
break;
@ -166,7 +163,7 @@ feature_ptr ogr_index_featureset<filterT>::next()
case OFTDateTime: // unhandled !
{
#ifdef MAPNIK_DEBUG
clog << "unhandled type_oid=" << type_oid << endl;
std::clog << "OGR Plugin: unhandled type_oid=" << type_oid << std::endl;
#endif
break;
}
@ -174,7 +171,7 @@ feature_ptr ogr_index_featureset<filterT>::next()
default: // unknown
{
#ifdef MAPNIK_DEBUG
clog << "unknown type_oid=" << type_oid << endl;
std::clog << "OGR Plugin: unknown type_oid=" << type_oid << std::endl;
#endif
break;
}
@ -187,8 +184,9 @@ feature_ptr ogr_index_featureset<filterT>::next()
}
#ifdef MAPNIK_DEBUG
clog << count_ << " features" << endl;
std::clog << "OGR Plugin: " << count_ << " features" << std::endl;
#endif
return feature_ptr();
}