Hello,

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:

CREATE TABLE public.error_union_empty
(
    geom geometry(MultiPolygon),
    gid integer NOT NULL DEFAULT nextval('fallo_gid_seq'::regclass),
    CONSTRAINT error_union_empty_pkey PRIMARY KEY (gid)
);
INSERT INTO error_union_empty
(SELECT ST_union(geom,ST_GeomFromText('POLYGON EMPTY'), 0.001152) geom
FROM f_polygon);

But the result is an empty table.
Then I tried to do the same but by doing the union with the polygon himself, 
and this approach seems to work ok.

CREATE TABLE public.error_union_empty2
(
    geom geometry(MultiPolygon),
    gid integer NOT NULL DEFAULT nextval('fallo_gid_seq'::regclass),
    CONSTRAINT error_union_empty2_pkey PRIMARY KEY (gid)
);
insert into error_union_empty2
select  ST_CollectionExtract(ST_union(f_polygon.geom,f_polygon.geom, 0.001152)) 
geom
from f_polygon;

Why is not working the first approach? Have I missed something in the query?
Any help or comments are welcome.
Does anyone knows if  is expected to have a simplify with gridsize in the 
future?

Thanks!


________________________________

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.
Evite imprimir este mensaje si no es estrictamente necesario.

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.
Avoid printing this message if it is not absolutely necessary.
_______________________________________________
postgis-users mailing list
postgis-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/postgis-users

Reply via email to