I am dealing with a PNG map that has an associated text file with this exact content.

PROJCS["WGS 84 / UTM zone 32N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4326"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","32632"]] 638154.25966967,4.23419760,0.00000000,5132648.32927090,0.00000000,-4.23419760 5846,4016

The first line is quite long and I recognize it as SRS information. The rest is likely a bounding box, but I am having an hard time realizing how woud it work, considering that there are six values rather than eight. So those would define three points rather than four according to my understanding.

And there's the last line which lets me totally clueless being it apparently in a different format (no decimals).

My end objective is to convert the pair into a GeoTIFF file.

  • Perhaps that last line is the number of rows/columns – Ali Sep 23 '15 at 9:39
  • 4
    I assume its a png world file, normally it has a .pgw suffix. See: feflow.info/html/help/… – nmtoken Sep 23 '15 at 9:45
  • 1
    Without the real values (which you've modified) it is hard to know. Are they at least in the right magnitude? Do the first and fourth values make sense as an easting-northing pair for the location that the PNG file covers? It looks a little like a world file, but the order and values don't really work the same as I'd expect. – BradHards Sep 23 '15 at 10:18
  • The data might be copyrighted, but the metadata can't be. Without the correct metadata, it's difficult to help you. – Vince Sep 23 '15 at 12:42
  • @BradHards the values are indeed in the right magnitude. I just changed some digits without putting a big offset compared to the original value. Anyways, there we go with the file as is. My end purpose would be to convert the pair into a GeoTIFF format. – Dakatine Sep 23 '15 at 12:53

The first six numbers out of eight look similar to GDAL GeoTranform element which is explained in http://www.gdal.org/gdal_tutorial.html. GeoTransform looks like this:

 <GeoTransform>-3.8018800000000000e+005, 5.0000000000000000e+002, 0.0000000000000000e+000, 8.2269430000000000e+006, 0.0000000000000000e+000,-5.0000000000000000e+002</GeoTransform>

I believe that this quiz can be resolved

638154.25966967  -> x coordinate of origin
4.23419760       -> pixel size in x direction 
0.00000000       -> rotation parameter 1
5132648.32927090 -> y coordinate of origin
0.00000000       -> rotation parameter 2
-4.23419760      -> pixel size in y direction 

5846             -> image width (or height) in pixels
4016             -> image height (or width) in pixels

By this information you can write a world file https://en.wikipedia.org/wiki/World_file


If your image is "image.png", save the world file as "image.pgw". Some programs may require extension as .tfw or .wld. The projection of the image is clearly EPSG:32632, UTM zone 32 http://epsg-registry.org/export.htm?wkt=urn:ogc:def:crs:EPSG::32632.

  • by the way, the image size is 11693x8032 pixels. Which, hey, is exactly twice as much as those two numbers down there... – Dakatine Sep 23 '15 at 14:20

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.