Opened 9 years ago

Closed 9 years ago

#5861 closed defect (fixed)

GDAL Proximity Documentation Clarification

Reported by: rbarnes Owned by: warmerdam
Priority: normal Milestone:
Component: Docs Version: unspecified
Severity: normal Keywords:
Cc:

Description

The existing gdal_proximity.py documentation has this to say:

-maxdist n: The maximum distance to be generated. All pixels beyond this distance will be assigned either the nodata value, or 65535. Distance is interpreted in pixels unless -distunits GEO is specified.

That is not informative to me. Under what conditions is nodata versus 65535 used?

The attached patch suggests an alternative wording which I believe is unambiguous (this is based on gdalproximity.cpp).

The maximum distance to be generated. The nodata value will be used for pixels beyond this distance. If a nodata value is not provided, the input band will be queried for its nodata value. If the input band does not have a nodata value, then the value 65535 will be used. Distance is interpreted in pixels unless -distunits GEO is specified.

Attachments (1)

gdal_prox_maxdist.diff (894 bytes ) - added by rbarnes 9 years ago.

Download all attachments as: .zip

Change History (5)

by rbarnes, 9 years ago

Attachment: gdal_prox_maxdist.diff added

comment:1 by Even Rouault, 9 years ago

Component: defaultDocs
Resolution: fixed
Status: newclosed

trunk r28574 "Doc: clarify meaning of -maxdist option (patch by rbarnes, #5861)"

comment:2 by Even Rouault, 9 years ago

Resolution: fixed
Status: closedreopened

Hum, actually looking at the code, I think this is wrong. It should rather be : "If a nodata value is not provided, the *output* band will be queried for its nodata value. If the *output* band"

fNoDataValue = (float) GDALGetRasterNoDataValue( hProximityBand, &bSuccess );

The input band is hSrcBand

comment:3 by rbarnes, 9 years ago

I based my changes on the documentation on Lines 80-86, which it seems I misinterpreted now that I reread them. On the other hand, I do not think these lines are very clear either.

I'll be sure to interpret the code itself next time!

Late tonight or perhaps even Sunday is the earliest I can submit a modified patch.

Again, my apologies.

comment:4 by Even Rouault, 9 years ago

Resolution: fixed
Status: reopenedclosed

trunk r28627 "gdal_proximity doc: replace mention of input band nodata by output band (#5861)"

Note: See TracTickets for help on using tickets.