Hi David,
Good point about iMap. Currently, the problem is that the GeoTIFF tags
cannot be passed in as a keyword. It has to come from the file. I'll try to
address this in the next IDL version. In the meantime, you *can* pass in the
GeoTIFF as a data parameter, like this:
-----
file = 'AF03sep15b.n16-VIg.tif' ;dialog_pickfile()
image = Read_Tiff(file, GEOTIFF=geoTiff, ORIENTATION=orien)
if (orien eq 1) then image = Reverse(image,2)
LOADCT, 39, /SILENT
TVLCT, r, g, b, /GET
rgb = Transpose([[r],[g],[b]])
rgb[*,0] = 255 ; make background white
image >= 0 ; clip all negative values
; Ugly part which should go away in the next IDL version...
oParmSet = OBJ_NEW('IDLitParameterSet')
oParmSet->Add, OBJ_NEW('IDLitDataIDLImagePixels', image), $
PARAMETER_NAME='IMAGEPIXELS'
oParmSet->Add, OBJ_NEW('IDLitDataIDLPalette', rgb), $
PARAMETER_NAME='PALETTE'
oParmSet->Add, OBJ_NEW('IDLitDataIDLGeoTIFF', geotiff), $
PARAMETER_NAME='GEOTIFF'
iMap, INITIAL_DATA=oParmSet
; Change the map limits. Also should go away in next IDL version...
it = itgetcurrent(TOOL=oTool)
oDS = (oTool->GetSelectedItems())[0]->GetDataspace(/UNNORM)
oMap = oDS->_GetMapProjection()
oMap->SetProperty, LIMIT=[-45,-30,45,70]
oDS->OnProjectionChange
; Insert continents.
void = oTool->DoAction('Operations/Insert/Map/Continents')
oCont = (oTool->GetSelectedItems())[0]
oCont->SetProperty, FILL_BACKGROUND=0, COLOR=[255,0,0]
; Export to a bitmap file. This part is optional...
oDesc = oTool->GetByIdentifier('Operations/File/Export')
oExport = oDesc->GetObjectInstance()
; File suffix will automatically determine the file type.
oExport->SetProperty, FILENAME='outAfrica.png', $
SOURCE=1, $ ; do the entire window
SHOW_EXECUTION_UI=0, SCALE_FACTOR=2
void = oExport->DoAction(oTool)
oExport->SetProperty, SHOW_EXECUTION_UI=1
-----
You can see how you can mess around with both the image data and the palette
before passing them into the Parameter Set. In the next IDL version, this
should be much simpler, something like:
...read data...
...mess with image and palette...
iMap, image, GEOTIFF=geoTiff, RGB_TABLE=rgb, LIMIT=[-45,-30,45,70]
...insert continents...
Anyway, hope this helps. You're right about the image registration. iMap
looks good, but not perfect. I'll have to think about it some more. It looks
like a couple of pixels, not just something like half a pixel, which would
be easy to explain...
Cheers,
Chris
ITTVIS
"David Fanning" <news@dfanning.com> wrote in message
news:MPG.1fedbaf54e8d8289989e52@news.frii.com...
> Chris Torrence writes:
>
>> 1. Start iMap.
>> 2. File->Open, open one of your Africa images
>> 3. Double click on the image to bring up property sheet, edit the color
>> table to your liking
>> 4. Insert->Map continents
>> 5. Click on the Map tab on the right, change plot range to lon [-30,
>> +70],
>> lat [-45, +45]
>> 6. (bonus) Window->Data Manager, open your image data, click on GeoTIFF
>> tags
>> node, then click on the GeoTIFF tags property to view the tags.
>>
>> Everything looks fine to me:
>
> Yes, I agree, it looks a hell of a lot better
> than my attempt with iMap yesterday! But I'm not
> so sure it's any better than where I started. The
> color table you have chosen here masks the problem
> a little bit. If you inverse it, you see the problem
> more clearly.
>
> This iMap solution did give me a clue to set the
> CENTER_LAT keyword to 1, if I use the original
> standard parallels of -19 and 21. I like this
> better than changing them to -19,9999 and 20.0005
> the way I did yesterday.
>
> This gives me more or less what iMap is giving me,
> but--again--just not quite right. I find I still have
> to tweak the positions of the corner pixels just slightly
> to get everything aligned to my satisfaction.
>
> But, a couple of questions about iMap. I don't want
> to display the original data. I want to display a
> processed image with a particular set of colors
> (I think there are 15). So a processed, byte-scaled
> image with a particular color table. How would I get
> to this point after reading the GeoTiff file into
> iMap? Or, would I have to do this in a different way?
> I think this is what confused me about iMap yesterday.
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|