I used gdal_translate to change a jpeg to a geotiff. Attempting to use gdalwarp to create a mosaic I found the images skewed and this lead me to the observation in the title of the question. Below I've posted the line I used to translate and gdalinfo on the new image. Notice that the upper left and lower left longitudes are the same (-76.4303686) and the upper right and upper left latitudes are the same (38.1480727).
Is this a flaw/bug or am I doing something wrong?
C:\Users\path\to'Desktop>gdal_translate -a_ullr -76.43036800559511 38.14807271147 146 -76.43183999600483 38.148231283935985 IMG028.jpg img28.tif Input file size is 400, 267 0...10...20...30...40...50...60...70...80...90...100 - done. C:\Users\path\to\Desktop>gdalinfo img28.tif Driver: GTiff/GeoTIFF Files: img28.tif Size is 400, 267 Coordinate System is `' Origin = (-76.430368005595113,38.148072711471457) Pixel Size = (-0.000003679976024,0.000000593904362) Metadata: EXIF_BitsPerSample=8 8 8 EXIF_ColorSpace=65535 EXIF_DateTime=2013:11:02 15:13:42 EXIF_ExifVersion=0221 EXIF_Orientation=1 EXIF_PhotometricInterpretation=2 EXIF_PixelXDimension=400 EXIF_PixelYDimension=267 EXIF_ResolutionUnit=2 EXIF_SamplesPerPixel=3 EXIF_Software=Adobe Photoshop CC (Windows) EXIF_XResolution=(72) EXIF_YResolution=(72) Image Structure Metadata: INTERLEAVE=PIXEL Corner Coordinates: Upper Left ( -76.4303680, 38.1480727) Lower Left ( -76.4303680, 38.1482313) Upper Right ( -76.4318400, 38.1480727) Lower Right ( -76.4318400, 38.1482313) Center ( -76.4311040, 38.1481520) Band 1 Block=400x6 Type=Byte, ColorInterp=Red Band 2 Block=400x6 Type=Byte, ColorInterp=Green Band 3 Block=400x6 Type=Byte, ColorInterp=Blue
I'm new to GIS and really programming in general.
The pictures were taken from a high altitude and the camera was pointed directly below. The picture is effectively a rectangle. I do not have 'world files.' That being said, I do have information that was read from a GPS unit. The information is: latitude, longitude, altitude, heading (degrees clockwise from North). These co-ordinates are assumed to be at the exact center of the picture. The hard-coded ulx uly, lrx, lry values are a result of trigonometry. They were intended to represent the latitude and longitude of the upper-left and lower-right corners of the picture (which is what I understood GDAL wanted). Thus it might totally be possible that the upper-left corner of the picture is actually more southward than the lower right (i.e. the picture is upside down). I thought GDAL automatically reads the size of the image and assigns proper bounds for the upper right and lower left corners.
I read over the translate docs again and there seem to be no parameters with which I can tell GDAL to read data about orientation using a 'world file.'
What methods are available to factor in the rotation of the image?
Can someone provide easy-to-read links on how to use gdal_translate properly?
In particular, multiple methods of factoring in image rotation would be preferred. I do not want to create world files. It would be good if I could somehow factor in rotation using command line flags or something. Additionally, I'm unclear about what a projection is. I know 'projection' is like assigning parameters for what a pixel means in meters and what latitude and longitude means. But something like this is not helpful:
-a_srs srs_def: Override the projection for the output file. The srs_def may be any of the usual GDAL/OGR forms, complete WKT, PROJ.4, EPSG:n or a file containing the WKT.
I will continue to work on projection because I have a few leads but this 'world file' business and image rotation I do not even know where to start.