| 111 | /************************************************************************/ |
| 112 | |
| 113 | static void PrintAlgorithmAndOptions(GDALGridAlgorithm eAlgorithm, |
| 114 | void *pOptions) |
| 115 | { |
| 116 | switch (eAlgorithm) |
| 117 | { |
| 118 | case GGA_InverseDistanceToAPower: |
| 119 | { |
| 120 | printf("Algorithm name: \"%s\".\n", szAlgNameInvDist); |
| 121 | GDALGridInverseDistanceToAPowerOptions *pOptions2 = |
| 122 | static_cast<GDALGridInverseDistanceToAPowerOptions *>(pOptions); |
| 123 | CPLprintf("Options are " |
| 124 | "\"power=%f:smoothing=%f:radius1=%f:radius2=%f:angle=%f" |
| 125 | ":max_points=%u:min_points=%u:nodata=%f\"\n", |
| 126 | pOptions2->dfPower, pOptions2->dfSmoothing, |
| 127 | pOptions2->dfRadius1, pOptions2->dfRadius2, |
| 128 | pOptions2->dfAngle, pOptions2->nMaxPoints, |
| 129 | pOptions2->nMinPoints, pOptions2->dfNoDataValue); |
| 130 | break; |
| 131 | } |
| 132 | case GGA_InverseDistanceToAPowerNearestNeighbor: |
| 133 | { |
| 134 | printf("Algorithm name: \"%s\".\n", |
| 135 | szAlgNameInvDistNearestNeighbor); |
| 136 | GDALGridInverseDistanceToAPowerNearestNeighborOptions *pOptions2 = |
| 137 | static_cast< |
| 138 | GDALGridInverseDistanceToAPowerNearestNeighborOptions *>( |
| 139 | pOptions); |
| 140 | CPLString osStr; |
| 141 | osStr.Printf("power=%f:smoothing=%f:radius=%f" |
| 142 | ":max_points=%u:min_points=%u:nodata=%f", |
| 143 | pOptions2->dfPower, pOptions2->dfSmoothing, |
| 144 | pOptions2->dfRadius, pOptions2->nMaxPoints, |
| 145 | pOptions2->nMinPoints, pOptions2->dfNoDataValue); |
| 146 | if (pOptions2->nMinPointsPerQuadrant > 0) |
| 147 | osStr += CPLSPrintf(":min_points_per_quadrant=%u", |
| 148 | pOptions2->nMinPointsPerQuadrant); |
| 149 | if (pOptions2->nMaxPointsPerQuadrant > 0) |
| 150 | osStr += CPLSPrintf(":max_points_per_quadrant=%u", |
| 151 | pOptions2->nMaxPointsPerQuadrant); |
| 152 | printf("Options are: \"%s\n", osStr.c_str()); /* ok */ |
| 153 | break; |
| 154 | } |
| 155 | case GGA_MovingAverage: |
| 156 | { |
| 157 | printf("Algorithm name: \"%s\".\n", szAlgNameAverage); |
| 158 | GDALGridMovingAverageOptions *pOptions2 = |
| 159 | static_cast<GDALGridMovingAverageOptions *>(pOptions); |
| 160 | CPLString osStr; |
| 161 | osStr.Printf("radius1=%f:radius2=%f:angle=%f:min_points=%u" |
| 162 | ":nodata=%f", |
| 163 | pOptions2->dfRadius1, pOptions2->dfRadius2, |
| 164 | pOptions2->dfAngle, pOptions2->nMinPoints, |
| 165 | pOptions2->dfNoDataValue); |
| 166 | if (pOptions2->nMinPointsPerQuadrant > 0) |
| 167 | osStr += CPLSPrintf(":min_points_per_quadrant=%u", |
| 168 | pOptions2->nMinPointsPerQuadrant); |
| 169 | if (pOptions2->nMaxPointsPerQuadrant > 0) |
| 170 | osStr += CPLSPrintf(":max_points_per_quadrant=%u", |
no test coverage detected