Here is where the projected meter numbers come from:
limit = [-84.7500, -180.000, 84.7500, 180.000]
mapStruct = Map_Proj_Init('mercator', /gctp, ellipsoid='wgs 84', limit=limit)
cm = map_proj_forward(-105.100, 40.600, map=mapStruct)
xcenter = cm[0,0]
ycenter = cm[1,0]
Print, 'XCenter: ', xcenter
Print, 'YCenter: ', ycenter
metersPixel = cgGoogle_MetersPerPixel(12)
Print, 'meters per pixels: ', metersPixel
xrange = [xcenter - (300*metersPixel), xcenter+(300*meterspixel)]
yrange = [ycenter - (300*metersPixel), ycenter+(300*meterspixel)]
Print, 'X Range: ', xrange
print, 'Y Range: ', yrange
So, I have tried passing X and Y vectors like this:
s = Size(googleImage, /DIMENSIONS)
xscale = Abs(xrange[1] - xrange[0]) / s[1]
yscale = Abs(yrange[1] - yrange[0]) / s[2]
Print, 'X Scale: ', xscale
Print, 'Y Scale: ', yscale
x = (Findgen(s[1])*xscale) + xrange[0] + (xscale/2)
y = (Findgen(s[2])*yscale) + yrange[0] + (yscale/2)
obj = Image(googleImage, x, y, MAP_PROJECTION=projection, $
ELLIPSOID=ellipsoid, GRID_UNITS=1, $
CENTER_LONGITUDE=-105.1, CENTER_LATITUDE=40.60, $
LIMIT=limit, DIMENSIONS=[700,700], LOCATION=[50,50], /BOX_AXES)
This produces a map display, but no image.
Or, I have tried passing the X and Y ranges like this:
obj = Image(googleImage, MAP_PROJECTION=projection, $
ELLIPSOID=ellipsoid, GRID_UNITS=1, $
CENTER_LONGITUDE=-105.1, CENTER_LATITUDE=40.60, $
XRANGE=xrange, YRANGE=yrange, $
LIMIT=limit, DIMENSIONS=[700,700], LOCATION=[50,50], /BOX_AXES)
This produces a blank window with nothing in it.
I have even tried using the IMAGE_DIMENSIONS keyword like this:
xdim = Abs(xrange[1] - xrange[0])
ydim = Abs(yrange[1] - yrange[0])
Print, xdim, ydim
obj = Image(googleImage, MAP_PROJECTION=projection, $
ELLIPSOID=ellipsoid, GRID_UNITS=1, $
CENTER_LONGITUDE=-105.1, CENTER_LATITUDE=40.60, $
XRANGE=xrange, YRANGE=yrange, $
LIMIT=limit, DIMENSIONS=[700,700], LOCATION=[50,50], $
IMAGE_DIMENSIONS=[xdim, ydim], /BOX_AXES)
That also results in a blank window.
And, I've tried numerous variations besides these, too. I'm
really at a complete loss.
Cheers,
David
|