<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Calibri, Helvetica, sans-serif;">Hello, </span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Calibri, Helvetica, sans-serif;">I am trying to simplify a polygon by reducing the precision using ST_Union with the gridSize parameter ( I am using  postgis 3.1  and GEOS 3.9.1). I have read that it is possible to do that by a union
 of a geometry with an empty geometry (http://blog.cleverelephant.ca/2020/12/waiting-postgis-31-3.html).   However, does not works for me ( maybe is my fault because I am new with postgis). I have tried as follows:</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
<blockquote style="margin-top:0;margin-bottom:0">
<blockquote style="margin-top:0;margin-bottom:0">
<div><i>CREATE TABLE public.error_union_empty</i></div>
<div><i>(</i></div>
<div><i>    geom geometry(MultiPolygon),</i></div>
<div><i>    gid integer NOT NULL DEFAULT nextval('fallo_gid_seq'::regclass),</i></div>
<div><i>    CONSTRAINT error_union_empty_pkey PRIMARY KEY (gid)</i></div>
<div><i>);</i></div>
<div><i>INSERT INTO error_union_empty</i></div>
<div><i>(SELECT ST_union(geom,ST_GeomFromText('POLYGON EMPTY'), 0.001152) geom</i></div>
<div><i>FROM f_polygon);</i></div>
<div><br>
</div>
</blockquote>
</blockquote>
<div><span style="font-family: calibri, helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">But the result is an empty table.</span></div>
<div><span style="font-family: calibri, helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">Then I tried to do the same but by doing the union with the polygon himself, and this approach seems to work ok.</span></div>
<div><span style="font-family: calibri, helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);"><br>
</span></div>
<blockquote style="margin-top:0;margin-bottom:0">
<blockquote style="margin-top:0;margin-bottom:0">
<div><i>CREATE TABLE public.error_union_empty2</i></div>
<div><i>(</i></div>
<div><i>    geom geometry(MultiPolygon),</i></div>
<div><i>    gid integer NOT NULL DEFAULT nextval('fallo_gid_seq'::regclass),</i></div>
<div><i>    CONSTRAINT error_union_empty2_pkey PRIMARY KEY (gid)</i></div>
<div><i>);</i></div>
<div><i>insert into error_union_empty2</i></div>
<div><i>select  ST_CollectionExtract(ST_union(f_polygon.geom,f_polygon.geom, 0.001152)) geom
</i></div>
<div><i>from f_polygon;</i></div>
<div><br>
</div>
</blockquote>
</blockquote>
<div>Why is not working the first approach? Have I missed something in the query?</div>
<div>Any help or comments are welcome. </div>
<div>Does anyone knows if  is expected to have a simplify with gridsize in the future?</div>
<div><br>
</div>
<div>Thanks!</div>
<br>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="1"><br>
Este correo electrónico y, en su caso, cualquier fichero anexo al mismo, contiene información de carácter confidencial exclusivamente dirigida a su destinatario o destinatarios. Si no es vd. el destinatario indicado, queda notificado que la lectura, utilización,
 divulgación y/o copia sin autorización está prohibida en virtud de la legislación vigente. En el caso de haber recibido este correo electrónico por error, se ruega notificar inmediatamente esta circunstancia mediante reenvío a la dirección electrónica del
 remitente.<br>
Evite imprimir este mensaje si no es estrictamente necesario.<br>
<br>
This email and any file attached to it (when applicable) contain(s) confidential information that is exclusively addressed to its recipient(s). If you are not the indicated recipient, you are informed that reading, using, disseminating and/or copying it without
 authorisation is forbidden in accordance with the legislation in effect. If you have received this email by mistake, please immediately notify the sender of the situation by resending it to their email address.<br>
Avoid printing this message if it is not absolutely necessary.<br>
</font>
</body>
</html>