From gdal.org, the description of the "-a_ullr" flag is:

Assign/override the georeferenced bounds of the output file.

Are the georeferenced bounds the coordinates of the center of pixels located at the corners of the grid, or are the georeferenced bounds the coordinates of the corners of the corner pixels?

  • That's a really good question... Have you tried an example and interrogated the coordinates of the UL pixel in a GIS viewer? – Michael Stimson Aug 8 '17 at 22:23
  • @MichaelStimson I have not yet investigated, as I have just finished updating my GDAL to the latest stable release. -Will start toying around now with the coordinates for center of pixel and maximum extent (which I luckily have). – G. Deemer Aug 8 '17 at 22:28

After testing, the -a_ullr flag assigns the outermost coordinates of your raster. That is, the corners of grid cells located in the corners of the grid.

The command:

gdal_translate -of GTiff -a_srs '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' -a_nodata -9999 -A_ullr -124.733333333333 52.8749999999999 52.8749999999999 24.9499999999999 infile.dat outfile.tif

Results in a .tif where gdalinfo *.tif reads:

Corner Coordinates:

Upper Left (-124.7333333, 52.8750000) (124d44' 0.00"W, 52d52'30.00"N)

Lower Left (-124.7333333, 24.9500000) (124d44' 0.00"W, 24d57' 0.00"N)

Upper Right ( 52.8750000, 52.8750000) ( 52d52'30.00"E, 52d52'30.00"N)

Lower Right ( 52.8750000, 24.9500000) ( 52d52'30.00"E, 24d57' 0.00"N)

Center ( -35.9291667, 38.9125000) ( 35d55'45.00"W, 38d54'45.00"N)

This was also confirmed by adding a marker to the Upper Left coordinate within ArcGIS. 'Upper Left Corner Coordinate

  • ... which makes some sense: If you resample your raster using a doubled cell size, you don't want the extent to be changed. Think of a raster that covers the world in lat/lon using +/-180/90 as extent. – AndreJ Aug 9 '17 at 6:18

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.