Le jeudi 6 septembre 2012 16:09:05 UTC+2, David Fanning a écrit :
> Coyote writes:
>
>
>
>>
>
>>> Here is the code that gives me a blank window and which I am
>
>>> trying to fix:
>
>>>
>
>>> obj = Image(googleImage, MAP_PROJECTION=projection, $
>
>>> ELLIPSOID=ellipsoid, GRID_UNITS=1, $
>
>>> CENTER_LONGITUDE=centerLon, CENTER_LATITUDE=centerLat, $
>
>>> LIMIT=limit, XRANGE=xrange, YRANGE=xrange, $
>
>>> DIMENSIONS=[700,700], LOCATION=[50,50], /BOX_AXES)
>
>>
>
>>
>
>> I have now tried this, which works no better. :-(
>
>>
>
>> s = Size(googleImage, /DIMENSIONS)
>
>> xscale = Abs(xrange[1] - xrange[0]) / s[1]
>
>> yscale = Abs(yrange[1] - yrange[0]) / s[2]
>
>> 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=centerLon, CENTER_LATITUDE=centerLat, $
>
>> LIMIT=limit, XRANGE=xrange, YRANGE=xrange, $
>
>> DIMENSIONS=[700,700], LOCATION=[50,50], /BOX_AXES)
>
>>
>
>
>
> Folks! Seriously!? No one has an answer?
>
>
>
> The good news is that you are not alone. I've posed the same
>
> problem to the good folks in IDL Technical Support and I haven't
>
> received an answer from them, either.
>
>
>
> This is not really a hard problem. I have a georegistered image.
>
> I want to set up a map coordinate system that reflects that so
>
> I can draw on top of the image, discover the cursor location in
>
> map units, etc. It is done EVERY day in the real world.
>
>
>
> Is is really possible that this can't be done in IDL using the
>
> function graphics system?
>
>
>
> I'm getting tired of writing "IDL is unusable" articles, but
>
> if experienced people (one might say IDL experts) can't figure
>
> out how to do the very simplest things with your software, there
>
> is something seriously wrong. I've been blaming the software and
>
> documentation, but maybe the users are just not bright enough
>
> to use such sophisticated tools. (Although how long-time users
>
> because idiots all at once is a mystery I don't yet have an
>
> explanation for.)
>
>
>
> Anyway, I solder on, looking for solutions anywhere I can find them.
>
> Let me know if you come up with something!
>
>
>
> Cheers,
>
>
>
> David
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Looking at your map display problem, I got the following issue:
centerlat = 40.6000d
centerlon = -105.1000d
xrange = [-11711131.0d, -11688226.0d]
yrange = [4914254.0d, 4937159.5d]
map = map_proj_init('Mercator', ELLIPSOID='WGS 84', CENTER_LONGITUDE=0, CENTER_LATITUDE=0)
print, map_proj_inverse(mean(xrange), mean(yrange), MAP_STRUCTURE=map)
; -105.10000 40.410029
I should have found 40.6° for the latitude, is'nt it ?
print, map_proj_inverse(xrange, yrange, MAP_STRUCTURE=map)
; -105.20288 40.331647
; -104.99712 40.488320
Same thing regarding the latitude range boundaries which seem sligthly different
from those in your PNG example (40.525 and 40.675, by eye).
Cheers,
alain.
|