Skip to content

Commit

Permalink
csv: remove protective string checks now that spirit parsing is working
Browse files Browse the repository at this point in the history
  • Loading branch information
Dane Springmeyer committed Oct 31, 2011
1 parent 74d0af3 commit b3c2bfe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 1 addition & 6 deletions plugins/input/csv/csv_datasource.cpp
Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions tests/data/csv/nypd.csv
@@ -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

0 comments on commit b3c2bfe

Please sign in to comment.