+ applied patch to loosen the type checking when reading float strings from a dbf file (jonb)
This commit is contained in:
parent
7e6e00f06a
commit
e28328ba13
1 changed files with 6 additions and 18 deletions
|
@ -136,27 +136,15 @@ void dbf_file::add_attribute(int col, mapnik::transcoder const& tr, Feature cons
|
||||||
}
|
}
|
||||||
if ( fields_[col].dec_>0 )
|
if ( fields_[col].dec_>0 )
|
||||||
{
|
{
|
||||||
try
|
double d = 0.0;
|
||||||
{
|
std::istringstream(str) >> d;
|
||||||
double d = boost::lexical_cast<double>(str);
|
boost::put(f,name,d);
|
||||||
boost::put(f,name,d);
|
|
||||||
}
|
|
||||||
catch (boost::bad_lexical_cast &)
|
|
||||||
{
|
|
||||||
boost::put(f,name,0.0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
try
|
int i = 0;
|
||||||
{
|
std::istringstream(str) >> i;
|
||||||
int i = boost::lexical_cast<int>(str);
|
boost::put(f,name,i);
|
||||||
boost::put(f,name,i);
|
|
||||||
}
|
|
||||||
catch (boost::bad_lexical_cast &)
|
|
||||||
{
|
|
||||||
boost::put(f,name,0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue