<div dir="ltr">I'm pretty sure that ST_SnapToGrid and ST_ReducePrecision provide identical results for non-polygons.</div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Tue, Apr 29, 2025 at 3:45 AM Sandro Santilli <<a href="mailto:strk@kbt.io">strk@kbt.io</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">When the input is a line, is there any known difference between<br>
ST_SnapToGrid and ST_ReducePrecision ?<br>
Or, is the ONLY difference related to polygons ?<br>
<br>
Example of identical results:<br>
<br>
ST_SnapToGrid( 'MULTIPOINT(5 0, 5.02 0)', 1); -- MULTIPOINT(5 0,5 0)<br>
ST_ReducePrecision('MULTIPOINT(5 0, 5.02 0)', 1); -- MULTIPOINT(5 0,5 0)<br>
<br>
ST_SnapToGrid( 'LINESTRING(5 0, 5.02 0)', 1); -- LINESTRING EMPTY<br>
ST_ReducePrecision('LINESTRING(5 0, 5.02 0)', 1); -- LINESTRING EMPTY<br>
<br>
ST_SnapToGrid( 'LINESTRING(5 0, 5 5, 5.02 0)', 1); -- LINESTRING(5 0,5 5,5 0)<br>
ST_ReducePrecision('LINESTRING(5 0, 5 5, 5.02 0)', 1); -- LINESTRING(5 0,5 5,5 0)<br>
<br>
--strk;<br>
<br>
Libre GIS consultant/developer 🎺<br>
<a href="https://strk.kbt.io/services.html" rel="noreferrer" target="_blank">https://strk.kbt.io/services.html</a><br>
</blockquote></div>