Skip to content

Instantly share code, notes, and snippets.

@springmeyer
Created October 28, 2013 19:01
Show Gist options
  • Save springmeyer/7202602 to your computer and use it in GitHub Desktop.
Save springmeyer/7202602 to your computer and use it in GitHub Desktop.
diff --git a/include/mapnik/ctrans.hpp b/include/mapnik/ctrans.hpp
index f02ab48..2093e3d 100644
--- a/include/mapnik/ctrans.hpp
+++ b/include/mapnik/ctrans.hpp
@@ -83,12 +83,21 @@ struct MAPNIK_DECL coord_transform
unsigned vertex(double *x, double *y) const
{
- unsigned command = geom_.vertex(x, y);
- if ( command != SEG_END)
+ unsigned command = SEG_MOVETO;
+ bool ok = false;
+ bool skipped_points = false;
+ double z = 0;
+ while (!ok && command != SEG_END)
{
- double z = 0;
- if (!prj_trans_->backward(*x, *y, z))
- return SEG_END;
+ command = geom_.vertex(x, y);
+ ok = prj_trans_->backward(*x, *y, z);
+ if (!ok) {
+ skipped_points = true;
+ }
+ }
+ if (skipped_points && (command == SEG_LINETO))
+ {
+ command = SEG_MOVETO;
}
t_->forward(x, y);
return command;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment