Geographic Coding – Geographic Problem: How to generate. WLD files in the case of a given ground control point?

Ok, so I have a jpeg and a bunch of ground control points (x/y pixels and corresponding lat/lon references).

I I want to generate a .wld world file from the command line to accompany jpeg. My coordinate system is Google Maps, which is EPSG: 900913.

I know I can use gdal_transform to generate .vrt given gcps , But what I need is the .wld file. (Not very clear about the difference, but this is definitely what I need!)

Anyone knows how to do this?

Thank you
Richard

The world file is basically a Determine the 6-line ascii text file for georeferencing. If you have a set of GCPs, you need to map them (using a tool like gdal) to a single affine transformation.

I don’t believe in gdal The command line utility allows you to create a world file directly, although if you set WORLDFILE = yes in the driver, some drivers in GDAL will do this for you when you write the image. You have to check the driver specific Format to see if it supports this feature.

However, if not, you can easily do it manually. Just use GCP to make a .VRT file and view it in a text editor. It will have one like this Part:

440720.0, 60, 0.0, 3751320.0, 0.0, -60.0

This “GeoTransform” is a world file The affine transformation used. All you need to do is create an ascii file with one value per line, as shown below:

60
0.0
0.0
-60.0
440720.0
3751320.0

This will be a valid .WLD file for your application.

FYI – 6 numbers are x pixel size, y shift per x value, x shift per y pixel, x origin, then y origin. (These changes provide rotation/shearing capabilities in affine transformation. Usually, they will be 0/0, Because you usually need orthorectified images).

For more information, see Wikipedia’s entry on Worldfiles.

Okay, so I There is a jpeg and a bunch of ground control points (x/y pixels and corresponding lat/lon references).

I want to generate a .wld world file from the command line to accompany the jpeg. Mine The coordinate system is Google Maps, which is EPSG: 900913.

I know I can use gdal_transform to generate .vrt given gcps, but what I need is a .wld file. (Not very clear about the difference, But this is definitely what I need!)

Anyone knows How do i do this?

Thank you
Richard

The world file is basically a 6-line ascii text file that determines georeferencing. If You have a set of GCPs and you need to map them (using a tool like gdal) to a single affine transformation.

I don’t believe that the gdal command line utility allows you to create a world file directly , Although if you set WORLDFILE = yes in the driver, some drivers in GDAL will do this for you when you write the image. You must check the specific format of the driver to see if it supports this feature.

However, if not, you can easily do it manually. Just use GCP to make a .VRT file and view it in a text editor. It will have a section like this:

440720.0, 60, 0.0, 3751320.0, 0.0, -60.0

This “GeoTransform” is the affine transformation used by the world file. All you need to do is create An ascii file with one value per line, as shown below:

60
0.0
0.0
-60.0
440720.0
3751320.0

This will be a valid .WLD file for your application.

FYI – 6 numbers are x pixel size, each x value y shifts, each The y pixel x shift, the x origin, and then the y origin. (These changes provide rotation/shearing capabilities in the affine transformation. Usually, they will be 0/0 because you usually need an orthorectified image).

For more information, please refer to Wikipedia’s entry on Worldfiles.

Leave a Comment

Your email address will not be published.