[gdal-dev] Gdal contour number of contour with -p

Julien Cabieces julien.cabieces at oslandia.com
Fri Oct 5 04:54:32 PDT 2018


Yes, polygons are properly disjoints.

I agree with your proposal, two attributes with a_min/a_max seems to be
the better option.

I'll try to propose a patch in the days to come.

Regards,

Julien


On 28/09/2018 17:50, Even Rouault wrote:
> On mercredi 26 septembre 2018 09:30:53 CEST Julien Cabieces wrote:
>> Hi,
>>
>> I notice that executing gdal_contour has different number of contour
>> with or without -p option.
>>
>> gdal_contour  -b 1 -a level -fl 1 -f GPKG NETCDF:"/tmp/myfile.nc":MYVAR
>> /tmp/outfile.gpkg
>>
>> This generates one contour line.
>>
>> gdal_contour  -p -b 1 -a level -fl 1 -f GPKG
>> NETCDF:"/tmp/myfile.nc":MYVAR /tmp/outfile.gpkg
>>
>> This generates two contour polygons, one where all values are greater
>> than 1 and other one where all values are lesser than 1.
>>
>> I was wondering if it wouldn't be better to generate only one polygon
>> contour where all values are greater than 1, in order to keep the same
>> contour number with or without the option.
> This is the classical problems of intervals and sticks :-)
> Polygons are intervals, and lines are sticks, so I don't find it odd that you 
> don't get the same number of objects. Having the union of polygons to fill the 
> raster extent seems to me to be a desirable property.
>
> Side question: I was wondering if the exterior polygon a hole at the place 
> where the interior polygon is ? ie are polygons properly disjoint ?
>
> The question is more on the semantics of the attributes created for polygons. 
> For clarity, we should probably have two attributes, one with the minimum 
> value and one with the maximum one. That would make sense especially when used 
> the -fl options with irregular levels. So perhaps a -a_min and -a_max could be 
> useful for polygons.
> Or if we have a single value, we should precisely define if it is the minimum 
> or the maximum value.
>
> Even
>
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pEpkey.asc
Type: application/pgp-keys
Size: 2489 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20181005/5bd632ad/attachment.key>


More information about the gdal-dev mailing list