csv: remove protective string checks now that spirit parsing is working

This commit is contained in:
Dane Springmeyer 2011-10-31 19:12:13 -04:00
parent 74d0af396e
commit b3c2bfef01
2 changed files with 4 additions and 6 deletions

View file

@ -579,12 +579,7 @@ void csv_datasource::parse_csv(T& stream,
desc_.add_descriptor(mapnik::attribute_descriptor(fld_name,mapnik::String));
}
// only true strings are this long
else if (value_length > 20
// TODO - clean up this messiness which is here temporarily
// to protect against the improperly working spirit parsing below
|| value.find(",") != std::string::npos
|| value.find(":") != std::string::npos
|| (std::count(value.begin(), value.end(), '-') > 1))
else if (value_length > 20)
{
UnicodeString ustr = tr.transcode(value.c_str());
boost::put(*feature,fld_name,ustr);

3
tests/data/csv/nypd.csv Normal file
View file

@ -0,0 +1,3 @@
Precinct,Phone,Address,City,geo_longitude,geo_latitude,geo_accuracy
5th Precinct,(212) 334-0711,19 Elizabeth Street,"New York, NY",-70.0,40.0,house
9th Precinct,(212) 477-7811,130 Avenue C,"New York, NY",-73.0,41.0,house
1 Precinct Phone Address City geo_longitude geo_latitude geo_accuracy
2 5th Precinct (212) 334-0711 19 Elizabeth Street New York, NY -70.0 40.0 house
3 9th Precinct (212) 477-7811 130 Avenue C New York, NY -73.0 41.0 house