1

How can I use gdal_translate for AAIGrid so that the raster values are not more than 4 decimal places.

  • 1
    Starting with GDAL 1.11, another option is SIGNIFICANT_DIGITS=4 from the help gdal.org/frmt_various.html use -co SIGNIFICANT_DIGITS=4 if that works as advertised can you please answer your own question to attest that this parameter works. – Michael Stimson Jul 20 '17 at 4:38
  • Sorry, I copied the wrong text, it's -co DECIMAL_PRECISION=4, from the same page. The SIGNIFICANT_DIGITS option might force exponent notation which may or may not be 100% supported by various packages. – Michael Stimson Jul 20 '17 at 4:49
  • tried both. if the number is 3.4449939727783203125 the SIGNIFICANT_DIGITS=5 produces 3.445 and DECIMAL_PRECISION=5 produces 3.44499 – Nazmul Ahasan Jul 20 '17 at 7:30
2

It can be done by adding -co DECIMAL_PRECISION=4 in gdal_translate command.

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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