Resolve bugs in linestring rasterization.

Fixes #397.
Merge pull request #428 from joshmarcus/issue/397

Resolve bugs in linestring rasterization.