mapnik/mapnik — pull request #1456 by lightmare (2012-09-01 20:24:33+00:00)
Title: csv plugin doesn't compile with boost < 1.47

... because it uses
```c++
mapnik::wkt_parser parse_wkt
mapnik::json::geometry_parser parse_json;
```
whose definitions are preprocessed out with boost < 1.47.

It appears that spirit in boost 1.46 doesn't play well with ptr_vector. I rewrote the rules in wkt_grammar so that instead of returning a vector, they take a reference and append to it. This, apart from working with older boost versions, could also reduce the amount of allocations (I assume that originally when parsing a collection, each geom rule returned a ptr_vector, whose elements were then transferred to the collection, and the empty vector dropped; but I wouldn't bet on that, every now and again I'm learning how little I understand the inner workings of spirit).

Next I tried compiling with boost 1.42, and surprisingly succeeded after only commenting-out multi_pass iterator instantiation of json grammar (I guess it's only used by geojson plugin, which was disabled).

So much for the first commit, the other two are self-explanatory.

With these, tests/cpp_tests/csv_parse_test-bin passes with boost 1.46 and 1.42
(well it always passes, here I mean it didn't produce any parse errors for me)

There's a potential problem with appending geoms directly to the output, though. When parsing a multi/collection fails, some geoms may have already been appended. It's easy to fix with an extra local ptr_vector, I just don't know whether it's really a problem, or after a failed parse the vector is discarded anyway.