Re: Error with MapProjection::Forward [message #86674 is a reply to message #86673] |
Wed, 27 November 2013 10:41  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
> A vector of X and Y projected meter values associated with the image can
> be constructed like this:
>
> dims = Image_Dimensions(googleImage, XSIZE=xsize, YSIZE=ysize)
> xvec = cgScaleVector(Dindgen(xsize) + 1, xrange[0], xrange[1])
> yvec = cgScaleVector(Dindgen(ysize) + 1, yrange[0], yrange[1])
>
> If you wanted to trim 50 pixels of the left of the image and 100 pixels
> off the right of the image. You might do something like this:
>
> googleImage = googleImage[*, 50:xsize-100, *]
>
> You will have to re-define your xrange accordingly:
>
> xrange = [xvec[50],xvec[xsize-100]]
By the way, these are the details of how this is done, more or less. In
practice, I would use cgClipToMap from the Coyote Library to do this in
one go. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|