I have a 2048x1024 PNG representing a WGS 84 projection of global data, where pixel 0,0 is lat 90 lon -180 and pixel 2047,1023 is (just shy of) lat -90 lon 180. When I add it as a raster layer in QGIS (specifying WGS 84 as the CRS) it's pulling in as pixel 0,0 = lat 0 lon 0 and pixel 2047,1023 = (nonsensical) lat -1023 lon 2047.

How can I fix this? I've messed around with the Raster menu a bit to see whether that helps, but didn't figure anything out. Perhaps I need to define a custom projection to translate and scale?

  • Sounds like the georeference isn't recognized. Does it have a world file (.pgw)? – Michael Stimson Jul 15 '14 at 4:26
  • Aha! No, it didn't--it was data I created, and I hadn't been aware of world files. I created one, and now it works. – Emdot Jul 15 '14 at 12:48
  • Lesson learned. I'll turn that into an answer. – Michael Stimson Jul 15 '14 at 21:20

When a raster has upper-left of 0,0 and cellsize of 1 it is because the georeference isn't recognized.

Some image formats do not support internal georeference and others give the option of internal or external georeference. External georeference most commonly takes the form of a world file; there is a very good document here for understanding the content of world files (yes, it's Esri but the world file format is ancient in computer terms dating back to at least the 90's).

A world file is the first and last letter of the image format with a 'w' on the end:

.tif becomes .tfw, .png becomes .pgw, .bmp becomes .bpw....

If there's not a world file then the file probably isn't georeferenced. Exceptions include (but are not limited to) .ecw, .jp2, .tif, .img and .asc which support internal georeference and .bil/.hdr which has its own special georeference arrangement.

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.