[gdal-dev] [EXT] Re: [Doc] gdal_calc.py extent option

Laurențiu Nicola lnicola at dend.ro
Tue Oct 18 09:12:49 PDT 2022


Hi Matt,

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).

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.

If you allow me a parallel to arithmetic, the least (sic) common multiple of 3 and 5 is 15, not 150.

Laurentiu

On Tue, Oct 18, 2022, at 18:46, Matt.Wilkie wrote:
> 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.
>  
> Union and Intersect via Wiki.GIS.com (I do find the intersect diagram less clear in this example than the next one):
> http://wiki.gis.com/wiki/images/thumb/2/28/Union.jpg/300px-Union.jpg
> http://wiki.gis.com/wiki/images/thumb/4/4e/Demo_one.JPG/300px-Demo_one.JPG
>  
> Union and Intersect in Wikipedia polygon theory:
>  
> 
>  
>  
> http://wiki.gis.com/wiki/index.php/Union
> https://en.wikipedia.org/wiki/Boolean_operations_on_polygons
>  
> -Matt**
>  
> *From:* gdal-dev <gdal-dev-bounces at lists.osgeo.org> *On Behalf Of *Idan Miara
> *Sent:* October 17, 2022 1:55 AM
> *To:* Nicolas Godet <nicolas.godet at outlook.fr>
> *Cc:* Andrew C Aitchison <andrew at aitchison.me.uk>; gdal-dev at lists.osgeo.org
> *Subject:* [EXT] Re: [gdal-dev] [Doc] gdal_calc.py extent option
>  
> Hi! 
> I needed the docs are correct but as this is the second time it confuses people maybe the wording should be revised?
>  
> https://github.com/OSGeo/gdal/pull/5969 <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>
>  
> Any ideas? 
>  
> On Mon, 17 Oct 2022, 11:49 Nicolas Godet, <nicolas.godet at outlook.fr> wrote:
>> Indeed, this is right.
>> My bad..
>> 
>> *De :* Andrew C Aitchison <andrew at aitchison.me.uk>
>> *Envoyé :* lundi 17 octobre 2022 10:25
>> *À :* Nicolas Godet <nicolas.godet at outlook.fr>
>> *Cc :* gdal-dev at lists.osgeo.org <gdal-dev at lists.osgeo.org>
>> *Objet :* Re: [gdal-dev] [Doc] gdal_calc.py extent option
>>  
>> On Mon, 17 Oct 2022, Nicolas Godet wrote:
>> 
>> > Dear Devs,
>> >
>> > In documentation<https://gdal.org/programs/gdal_calc.html#cmdoption-extent <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>>, extent param description seems a bit odd to me.
>> >
>> >
>> > union - the extent (bounds) of the output will be the minimal
>> > rectangle that contains all the input extents.
>> >
>> > intersect - the extent (bounds) of the output will be the maximal
>> > rectangle that is contained in all the input extents.
>> >
>> > Shouldn't it be the other way around?
>> 
>> I think this *is* the right way round;
>> "all" can be misunderstood but I can not think of a clearer phrasing,
>> although "every one of" might help.
>> 
>> > As I intend to add this option to QGIS gdal_calc window (very useful
>> > option), I must be sure.
>> 
>> -- 
>> Andrew C. Aitchison                      Kendal, UK
>>                     andrew at aitchison.me.uk
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/gdal-dev <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>
>> 
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20221018/14ff756b/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 4315 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20221018/14ff756b/attachment-0002.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 3203 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20221018/14ff756b/attachment-0003.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.gif
Type: image/gif
Size: 33173 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20221018/14ff756b/attachment-0001.gif>


More information about the gdal-dev mailing list