1

I am using the gdal_grid command line with invdist algorithm and would like to spedify a smoothing parameter but I am wondering whether it shouold be in pixel or data units (meters in my case)?

I've found the following related links :

but none is clearly specifying the unit.

1
  • 1
    From my understanding, the smoothing S comes into the game through the distance formula : d = sqrt( dx2 + dy2 = S2). Hence S should have th same units as the xand y used to compute the distance?
    – stellasia
    Commented Feb 8, 2017 at 12:59

1 Answer 1

2

From looking at gdalgrid.cpp it seems that the smoothing parameter should be in units comparable to the coordinate system, not the raster grid.

// line 165
for( GUInt32 i = 0; i < nPoints; i++ )
{
    double dfRX = padfX[i] - dfXPoint;
    double dfRY = padfY[i] - dfYPoint;
    const double dfR2 =
        dfRX * dfRX + dfRY * dfRY + dfSmoothing * dfSmoothing; //<--- HERE

    /* stuff */

    // Is this point located inside the search ellipse?
    if( dfRadius2 * dfRX * dfRX + dfRadius1 * dfRY * dfRY <= dfR12 )
    {
        // If the test point is close to the grid node, use the point
        // value directly as a node value to avoid singularity.
        if( dfR2 < 0.0000000000001 )
        {
            *pdfValue = padfZ[i];
            return CE_None;
        }
2
  • Thanks for digging into the code! Not used to it so not clear to me that dfRX is the coordinate system unit, but I believe you :)
    – stellasia
    Commented Feb 9, 2017 at 8:52
  • @stellasia For some context, padfX and padfY are the input XY data coordinates and dfXPoint and dfYPoint are the coordinates of the pixel to estimate. Commented Feb 9, 2017 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.