file = "MOD09GA.A2008006.h09v05.005.tif" mapCoord = cgGeoMap(file, Image=geoImage) pos = [0.1, 0.1, 0.9, 0.9] cgDisplay, 800, 800 cgImage, geoImage, Position=pos mapCoord -> SetProperty, Position=pos cgMap_Grid, /CGGrid, /Box_Axes, Map=mapCoord cgMap_Continents, /USA, Map=mapCoord, Color='blu7' ; Make position vectors. mapCoord -> GetProperty, XRANGE=xr, YRANGE=yr s = Size(img, /Dimensions) xvec = cgScaleVector(Findgen(s[0]+1), xr[0], xr[1]) yvec = cgScaleVector(Findgen(s[1]+1), yr[0], yr[1]) ; Select the latitude and longitude you want to know the pixel location of. longitude = -99.25 latitude = 32.16 ; Display the pixel we are looking for? xy = mapCoord -> Forward(longitude, latitude) cgPlots, xy[0], xy[1], PSYM=2, SymSize=3, Color='red' ; Find the pixel location and print it. xpixel = Value_Locate(xvec, xy[0]) ypixel = Value_Locate(yvec, xy[1]) Print, xpixel, ypixel ; Confirm this is the right location. cgDisplay, 800, 800, Wid=1 cgImage, geoImage, Position=pos, /Axes cgPlots, xpixel, ypixel, PSYM=2, SymSize=3, Color='red' END