<!DOCTYPE html><html><head><title></title><style type="text/css">#qt p.qt-MsoNormal,#qt div.qt-MsoNormal{margin-top:0cm;margin-right:0cm;margin-left:0cm;margin-bottom:0.0001pt;font-size:12pt;font-family:"Times New Roman", serif;}
#qt a:link{color:blue;text-decoration-line:underline;text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;}
#qt a:visited{color:purple;text-decoration-line:underline;text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;}
p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div style="font-family:Arial;">Hi Matt,<br></div><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">The definitions are correct. For the union you want a rectangle (or polygon) that's larger than the input, indeed. But you want the smallest of those rectangles, because there's an infinity of them. The larger ones would cover an arbitrary area of the plane (or the globe, if you want).<br></div><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">Same for the intersection. You want the largest polygon equal to or contained in the inputs. Otherwise a smaller answer could just as well be a single point (or empty), even in nondegenerate cases.<br></div><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">If you allow me a parallel to arithmetic, the least (sic) common multiple of 3 and 5 is 15, not 150.<br></div><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">Laurentiu</div><div style="font-family:Arial;"><br></div><div style="font-family:Arial;"><span style="color:var(--ui-page-color-fg);font-family:"Proxima Nova", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;">On Tue, Oct 18, 2022, at 18:46, Matt.Wilkie wrote:</span><br></div><blockquote type="cite" id="qt" style=""><div class="qt-WordSection1"><p class="qt-MsoNormal"><span style="color:rgb(31, 73, 125);"><span class="font" style="font-family:Calibri, sans-serif;"><span class="size" style="font-size:11pt;">To my mind the outputs of Union should be the largest extent area and Intersect is the smallest extent area. However any explanation
in words alone will always have some ambiguity. It can’t be avoided.</span></span></span><br></p><p class="qt-MsoNormal"><span style="color:rgb(31, 73, 125);"><span class="font" style="font-family:Calibri, sans-serif;"><span class="size" style="font-size:11pt;"> </span></span></span><br></p><p class="qt-MsoNormal"><span style="color:rgb(31, 73, 125);"><span class="font" style="font-family:Calibri, sans-serif;"><span class="size" style="font-size:11pt;">Union and Intersect via Wiki.GIS.com (I do find the intersect diagram less clear in this example than the next one):</span></span></span><br></p><p class="qt-MsoNormal"><span style="color:rgb(31, 73, 125);"><span class="font" style="font-family:Calibri, sans-serif;"><span class="size" style="font-size:11pt;"><img width="300" height="107" style="width:3.125in;height:1.1166in;" id="qt-Picture_x0020_1" src="cid:image001.jpg@01D8E2CB.3FB14410" alt="http://wiki.gis.com/wiki/images/thumb/2/28/Union.jpg/300px-Union.jpg"></span></span></span><span style="color:rgb(31, 73, 125);"><span class="font" style="font-family:Calibri, sans-serif;"><span class="size" style="font-size:11pt;"></span></span></span><br></p><p class="qt-MsoNormal"><span style="color:rgb(31, 73, 125);"><span class="font" style="font-family:Calibri, sans-serif;"><span class="size" style="font-size:11pt;"><img width="300" height="104" style="width:3.125in;height:1.0833in;" id="qt-Picture_x0020_3" src="cid:image002.jpg@01D8E2CC.3BE26C50" alt="http://wiki.gis.com/wiki/images/thumb/4/4e/Demo_one.JPG/300px-Demo_one.JPG"></span></span></span><span style="color:rgb(31, 73, 125);"><span class="font" style="font-family:Calibri, sans-serif;"><span class="size" style="font-size:11pt;"></span></span></span><br></p><p class="qt-MsoNormal"><span style="color:rgb(31, 73, 125);"><span class="font" style="font-family:Calibri, sans-serif;"><span class="size" style="font-size:11pt;"> </span></span></span><br></p><p class="qt-MsoNormal"><span style="color:rgb(31, 73, 125);"><span class="font" style="font-family:Calibri, sans-serif;"><span class="size" style="font-size:11pt;">Union and Intersect in Wikipedia polygon theory:</span></span></span><br></p><p class="qt-MsoNormal"><span style="color:rgb(31, 73, 125);"><span class="font" style="font-family:Calibri, sans-serif;"><span class="size" style="font-size:11pt;"> </span></span></span><br></p><p class="qt-MsoNormal"><span style="color:rgb(31, 73, 125);"><span class="font" style="font-family:Calibri, sans-serif;"><span class="size" style="font-size:11pt;"><img width="480" height="374" style="width:5in;height:3.9in;" id="qt-Picture_x0020_4" src="cid:image005.gif@01D8E2CC.BDA0FE00"></span></span></span><span style="color:rgb(31, 73, 125);"><span class="font" style="font-family:Calibri, sans-serif;"><span class="size" style="font-size:11pt;"></span></span></span><br></p><p class="qt-MsoNormal"><span style="color:rgb(31, 73, 125);"><span class="font" style="font-family:Calibri, sans-serif;"><span class="size" style="font-size:11pt;"> </span></span></span><br></p><p class="qt-MsoNormal"><span style="color:rgb(31, 73, 125);"><span class="font" style="font-family:Calibri, sans-serif;"><span class="size" style="font-size:11pt;"> </span></span></span><br></p><p class="qt-MsoNormal"><span style="color:rgb(31, 73, 125);"><span class="font" style="font-family:Calibri, sans-serif;"><span class="size" style="font-size:11pt;"><a href="http://wiki.gis.com/wiki/index.php/Union">http://wiki.gis.com/wiki/index.php/Union</a></span></span></span><br></p><p class="qt-MsoNormal"><span style="color:rgb(31, 73, 125);"><span class="font" style="font-family:Calibri, sans-serif;"><span class="size" style="font-size:11pt;"><a href="https://en.wikipedia.org/wiki/Boolean_operations_on_polygons">https://en.wikipedia.org/wiki/Boolean_operations_on_polygons</a></span></span></span><br></p><p class="qt-MsoNormal"><span style="color:rgb(31, 73, 125);"><span class="font" style="font-family:Calibri, sans-serif;"><span class="size" style="font-size:11pt;"> </span></span></span><br></p><p class="qt-MsoNormal"><span lang="EN-US" style="color:rgb(31, 73, 125);"><span class="font" style="font-family:Calibri, sans-serif;"><span class="size" style="font-size:10pt;">-Matt</span></span></span><i><span style="color:rgb(31, 73, 125);"><span class="font" style="font-family:Calibri, sans-serif;"><span class="size" style="font-size:10pt;"></span></span></span></i><br></p><p class="qt-MsoNormal"><span style="color:rgb(31, 73, 125);"><span class="font" style="font-family:Calibri, sans-serif;"><span class="size" style="font-size:11pt;"> </span></span></span><br></p><p class="qt-MsoNormal"><b><span lang="EN-US" style=""><span class="font" style="font-family:Calibri, sans-serif;"><span class="size" style="font-size:11pt;">From:</span></span></span></b><span lang="EN-US" style=""><span class="font" style="font-family:Calibri, sans-serif;"><span class="size" style="font-size:11pt;"> gdal-dev <gdal-dev-bounces@lists.osgeo.org> <b>On Behalf Of </b>Idan Miara<br> <b>Sent:</b> October 17, 2022 1:55 AM<br> <b>To:</b> Nicolas Godet <nicolas.godet@outlook.fr><br> <b>Cc:</b> Andrew C Aitchison <andrew@aitchison.me.uk>; gdal-dev@lists.osgeo.org<br> <b>Subject:</b> [EXT] Re: [gdal-dev] [Doc] gdal_calc.py extent option</span></span></span></p><p class="qt-MsoNormal"> <br></p><div><p class="qt-MsoNormal">Hi! <br></p><div><p class="qt-MsoNormal">I needed the docs are correct but as this is the second time it confuses people maybe the wording should be revised?<br></p></div><div><p class="qt-MsoNormal"> <br></p></div><div><p class="qt-MsoNormal"><a href="https://can01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FOSGeo%2Fgdal%2Fpull%2F5969&data=05%7C01%7CMatt.Wilkie%40yukon.ca%7C8ec9f2c95b7c485d163508dab01d7941%7C98f515313973490abb70195aa264a2bc%7C0%7C0%7C638015937908111424%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=qgiJYx5KjebSDNQrw4QJHhY%2FrntE1Pyxfn32x31xlus%3D&reserved=0">https://github.com/OSGeo/gdal/pull/5969</a><br></p></div><div><p class="qt-MsoNormal"> <br></p></div><div><p class="qt-MsoNormal">Any ideas? <br></p></div></div><p class="qt-MsoNormal"> <br></p><div><div><p class="qt-MsoNormal">On Mon, 17 Oct 2022, 11:49 Nicolas Godet, <<a href="mailto:nicolas.godet@outlook.fr">nicolas.godet@outlook.fr</a>> wrote:<br></p></div><blockquote style="border-top-width:initial;border-right-width:initial;border-bottom-width:initial;border-top-style:none;border-right-style:none;border-bottom-style:none;border-top-color:initial;border-right-color:initial;border-bottom-color:initial;border-image-source:initial;border-image-slice:initial;border-image-width:initial;border-image-outset:initial;border-image-repeat:initial;border-left-width:1pt;border-left-style:solid;border-left-color:rgb(204, 204, 204);padding-top:0cm;padding-right:0cm;padding-bottom:0cm;padding-left:6pt;margin-left:4.8pt;margin-right:0cm;"><div><div><p class="qt-MsoNormal"><span style="color:black;"><span class="font" style="font-family:Calibri, sans-serif;">Indeed, this is right.</span></span><br></p></div><div><p class="qt-MsoNormal"><span style="color:black;"><span class="font" style="font-family:Calibri, sans-serif;">My bad..</span></span><br></p></div><div class="qt-MsoNormal" align="center" style="text-align:center;"><hr size="3" width="98%" align="center"><br></div><div id="qt-m_261857090517944928divRplyFwdMsg"><p class="qt-MsoNormal"><b><span style="color:black;"><span class="font" style="font-family:Calibri, sans-serif;"><span class="size" style="font-size:11pt;">De :</span></span></span></b><span style="color:black;"><span class="font" style="font-family:Calibri, sans-serif;"><span class="size" style="font-size:11pt;"> Andrew C Aitchison <<a href="mailto:andrew@aitchison.me.uk" target="_blank">andrew@aitchison.me.uk</a>><br> <b>Envoyé :</b> lundi 17 octobre 2022 10:25<br> <b>À :</b> Nicolas Godet <<a href="mailto:nicolas.godet@outlook.fr" target="_blank">nicolas.godet@outlook.fr</a>><br> <b>Cc :</b> <a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a> <<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a>><br> <b>Objet :</b> Re: [gdal-dev] [Doc] gdal_calc.py extent option</span></span></span></p><div><p class="qt-MsoNormal"> <br></p></div></div><div><div><p class="qt-MsoNormal"><span style=""><span class="size" style="font-size:11pt;">On Mon, 17 Oct 2022, Nicolas Godet wrote:<br> <br> > Dear Devs,<br> ><br> > In documentation<<a href="https://can01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgdal.org%2Fprograms%2Fgdal_calc.html%23cmdoption-extent&data=05%7C01%7CMatt.Wilkie%40yukon.ca%7C8ec9f2c95b7c485d163508dab01d7941%7C98f515313973490abb70195aa264a2bc%7C0%7C0%7C638015937908111424%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=ZQebVL1FblaUBIaZBYBsXHNJ0JfFm4nO8RzK2Gp4TZE%3D&reserved=0" target="_blank">https://gdal.org/programs/gdal_calc.html#cmdoption-extent</a>>,
extent param description seems a bit odd to me.<br> ><br> ><br> > union - the extent (bounds) of the output will be the minimal<br> > rectangle that contains all the input extents.<br> ><br> > intersect - the extent (bounds) of the output will be the maximal<br> > rectangle that is contained in all the input extents.<br> ><br> > Shouldn't it be the other way around?<br> <br> I think this *is* the right way round;<br> "all" can be misunderstood but I can not think of a clearer phrasing,<br> although "every one of" might help.<br> <br> > As I intend to add this option to QGIS gdal_calc window (very useful<br> > option), I must be sure.<br> <br> -- <br> Andrew C. Aitchison Kendal, UK<br> <a href="mailto:andrew@aitchison.me.uk" target="_blank">andrew@aitchison.me.uk</a></span></span></p></div></div></div><p class="qt-MsoNormal"></p><div>_______________________________________________<br></div><div> gdal-dev mailing list<br></div><div> <a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br></div><div> <a href="https://can01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgdal-dev&data=05%7C01%7CMatt.Wilkie%40yukon.ca%7C8ec9f2c95b7c485d163508dab01d7941%7C98f515313973490abb70195aa264a2bc%7C0%7C0%7C638015937908111424%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=dG%2BQVSiawyConLIg1vLJYu9P2pYZ2Y%2Bq2n0XqQ7ADO4%3D&reserved=0" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br></div><p></p></blockquote></div></div><div>_______________________________________________<br></div><div>gdal-dev mailing list<br></div><div><a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br></div><div><a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br></div><div><br></div></blockquote></body></html>