Can I change the pixel sizes in a world file?

by jth   Last Updated July 03, 2018 02:22 AM

I start with a dataset that has projection WGS84 and pixel size 0.000274658203125 degrees/pixel. I run gdal_translate to convert it to a PNG:

gdal_translate dataset.tif output.png -of PNG -ot byte -scale -strict -co worldfile=yes

Running gdalinfo output.png shows that the pixel size has lost precision and is now 0.000274658200000.

However, I can edit the world file (output.wld) and change the X and Y pixel sizes to 0.000274658203125 and -0.000274658203125, respectively. Now, running gdalinfo output.png shows the proper pixel size.

So, my questions are:

  • Is pixel size only controlled by the world file and can therefore be changed simply by editing the world file?
  • If so, would it be better to construct my own world file in the first place?

Related Questions