[geos-devel] WKT Precision

Martin Davis mtnclimb at gmail.com
Tue Jan 5 16:39:03 PST 2021


And for the record, I am -10 on outputting scientific notation, except for
extremely large numbers (say > 10^20 - which should rarely occur in real
data).  It just makes the output hard to read.

On Tue, Jan 5, 2021 at 4:35 PM Martin Davis <mtnclimb at gmail.com> wrote:

>  setTrim and setRoundingPrecision are GEOS-specific (not in JTS).
>
> What JTS has is WKTWriter.setPrecisionModel().  What that does is to set
> the max number of decimal places according to the precision supplied (e.g.
> scale = 10 produces 1 decimal, scale = 100 produces 2, etc)
>
> I like the simplicity of having setRoundingPrecision always apply to the
> decimal places.  I can't really envision a scenario where there is any
> point in reducing the sig figs (i.e. lopping off digits to the L of the
> decimal place) since they would have to be output as zeroes anyway, so
> there is no savings.
>
> And I would think having trim = true as the default would be most
> friendly, since there doesn't seem to be any value in keeping trailing
> zeroes after the decimal point.
>
> On Tue, Jan 5, 2021 at 3:41 PM Paul Ramsey <pramsey at cleverelephant.ca>
> wrote:
>
>> What do people think is the best practice for outputing WKT precision?
>
>
> (Also, what do these knobs (setTrim, setRoundingPrecision) mean in JTS
>> world? I'm guessing our behaviour is *not* an exact analogue.
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geos-devel/attachments/20210105/b62e2498/attachment.html>


More information about the geos-devel mailing list