I would like to include an overlay raster layer into my OpenLayers map. I've pre-transformed the image into the correct projection (EPSG:900913) and saved as a png using the gdal_translate
command:
gdal_translate -a_srs "EPSG:900913" -of "PNG" $RASTERFILEDIR/$x ../data/$x.png
When the file converts it includes an .xml file with transform information as follows:
<GeoTransform>
7.0153687766181468e+05,
2.9999999999999904e+01,
0.0000000000000000e+00,
9.5377345182658464e+05,
0.0000000000000000e+00,
-2.9999999999999904e+01
</GeoTransform>
In OpenLayers I'm loading the image like this:
var imageLayer = new OpenLayers.Layer.Image(source.label, source.src,
new OpenLayers.Bounds(source.bounds[0],source.bounds[1],source.bounds[2],source.bounds[3]),
new OpenLayers.Size(source.size[0], source.size[1]),
{
isBaseLayer: false,
alwaysInRange: true,
projection: new OpenLayers.Projection("EPSG:900913")
});
mapObj.map.addLayers([imageLayer]);
Where the bounds and size are calculated correctly. I end up seeing my image hovering over Africa instead of Columbia. It looks very much like there needs to be a translation included, but I'm not doing it correctly.
How do I know where to look for the translation amount, and how do I provide that information to OpenLayers?
The application I'm working on is here: http://www.stanford.edu/~rpsharp/map-overlay-annotation-test/inseam_explorer.html
Thanks for any help!