Error with MapProjection::Forward [message #86661] |
Wed, 27 November 2013 03:17  |
atmospheric physics
Messages: 121 Registered: June 2010
|
Senior Member |
|
|
Hello,
Following the example at http://www.exelisvis.com/docs/ImageWithMapProjection.html
I have prepared the following IDL program for my requirement:
;-------------------------
PRO MELPITZ_GOOGLE_PLOT
CLOSE,/ALL
; DOWNLOAD A MAP
url = "http://maps.googleapis.com/maps/api/staticmap?" + $
"center=51.525517,12.927633&zoom=14&size=600x600" + $
"&maptype=satellite&sensor=true"
netObject = IDLnetURL()
!null = netObject.Get(URL=url, FILENAME="melpitz.png")
netObject = 0
; Load the newly created file
READ_PNG, "melpitz.png", img
; DISPLAY THE MAP IMAGE WITH THE MAP PROJECTION
centerLon = 12.927633D
centerLat = 51.525517D
zoom = 14
Re = 6378137D ; Radius of the Earth
resolution = (2*!DPI*Re)/(256*2D^zoom) ; meters/pixel
PRINT, resolution
; The image is 600 pixel wide by 600 pixel tall
deltax = 600*resolution ; meters
deltay = 600*resolution ; meters
; Convert the map center to spherical Mercator coordinates
; Create a hidden map object to do the conversions.
m = MAP('Mercator',/BUFFER, $
SEMIMAJOR_AXIS=6378137D, SEMIMINOR_AXIS=6378137D)
uv = m.Forward(centerLon, centerLat)
; Compute the image bounding box in spherical Mercator coordinates
x0 = uv[0] - deltax/2 ; meters
x1 = uv[0] + deltax/2 ; meters
y0 = uv[1] - deltay/2 ; meters
y1 = uv[1] + deltay/2 ; meters
m.Close
PRINT, [x0, y0, x1, y1]
END
; ------------------------------------------
I am using IDL Version 8.0 (linux x86_64 m64). (c) 2010, ITT Visual Information Solutions. When I run above IDL procedure, I get the following error:
IDL> .r MELPITZ_GOOGLE_PLOT.pro
% Loaded DLM: URL.
% Compiled module: MELPITZ_GOOGLE_PLOT.
IDL> MELPITZ_GOOGLE_PLOT
% Compiled module: READ_PNG.
% Loaded DLM: PNG.
9.5546285
% Loaded DLM: XML.
% Attempt to call undefined method: 'MAPPROJECTION::MAPFORWARD'.
% Execution halted at: MELPITZ_GOOGLE_PLOT 34
I tried to search in Google for the possible solution to the problem but could not resolve. Am I missing some function files? Please suggest me to resolve this issue and go forward.
Thanks in advance
|
|
|