Skip to content

Added sfcgal_geometry_as_text_decim function to C API

lbartoletti requested to merge github/fork/mloeks/master into master

Created by: mloeks

new sfcgal_geometry_as_text_decim function allows to set the numDecimals parameter which is passed to the asText function and then used in WktWriter. This way the precision of coordinate values in the generated WKT can be controlled over the C API. Most importantly, the default "exact mode" of CGAL outputting integer fractions (= invalid WKT) can be avoided.

The existing function was not touched to ensure backwards compatibility.

removed comments for num_decimals parameter in sfcgal_prepared_geometry_as_ewkt function. so far, passed num_decimals did not have any effect since they were not passed to the asEWKT method. this is changed now and the precision can be controlled for EWKT as well.

The first enhancement was previously discussed and agreed upon in Issue #70. Should the second EWKT-related enhancement be undesired by the original authors, please reject that part or suggest a different implementation.

Many thanks, Matthias

Merge request reports