Skip to content

Instantly share code, notes, and snippets.

@jef-n
Created February 2, 2017 12:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jef-n/6818b7f8d8016c078e7e167d9641ae0f to your computer and use it in GitHub Desktop.
Save jef-n/6818b7f8d8016c078e7e167d9641ae0f to your computer and use it in GitHub Desktop.
--- orig/gdal-2.1.3/ogr/ogrcompoundcurve.cpp 2017-01-20 09:20:48.000000000 +0100
+++ gdal-2.1.3/ogr/ogrcompoundcurve.cpp 2017-02-02 08:40:55.627891600 +0100
@@ -578,8 +578,17 @@
fabs(end.getY() - start.getY()) > dfToleranceEps ||
fabs(end.getZ() - start.getZ()) > dfToleranceEps )
{
- CPLError(CE_Failure, CPLE_AppDefined, "Non contiguous curves");
- return OGRERR_FAILURE;
+ poCurve->EndPoint(&start);
+ if( fabs(end.getX() - start.getX()) > dfToleranceEps ||
+ fabs(end.getY() - start.getY()) > dfToleranceEps ||
+ fabs(end.getZ() - start.getZ()) > dfToleranceEps )
+ {
+ CPLError(CE_Failure, CPLE_AppDefined, "Non contiguous curves");
+ return OGRERR_FAILURE;
+ }
+
+ CPLDebug("GML", "reversing curve");
+ ((OGRSimpleCurve*)poCurve)->reversePoints();
}
((OGRSimpleCurve*)poCurve)->setPoint(0, &end); /* patch so that it matches exactly */
}
~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment