comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Question about projection for Google Earth
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Question about projection for Google Earth [message #85453] Thu, 08 August 2013 19:11 Go to previous message
timothyja123 is currently offline  timothyja123
Messages: 57
Registered: February 2013
Member
Hi Guys,

I'm trying to finish off some unfinished code that wasnt written by me. I'm fairly new to using projections, mapping, etc in IDL but from what I understand to map an image to Google Earth I need to use something like:

mapStruct = MAP_PROJ_INIT( 117 , /GCTP, limit=limit) ; Equirectangular projection
xy = Map_Proj_Forward(lon, lat, MAP_STRUCTURE=mapStruct)
lon = Reform(xy[0, *])
lat = Reform(xy[1, *])

The problem is that my lon/lat values contain a different number of values and Map_Proj_Forward() is complaining about this. Whay do they need to be the same? My overlay is a rectangular shape rather than a square why can this no be handled?


The code that I was left with does something like this but the image doesnt overlay correctly on Google Earth I assume this is because it uses the incorrect projection.

limit = dblarr(4)
limit[0] = min(lat)
limit[1] = min(lon)
limit[2] = max(lat)
limit[3] = max(lon)

polon = limit[1]+0.5*(limit[3]-limit[1])
map_set, 0,polon,0,/cyl,limit=limit, /noborder, xmargin=0,ymargin=0

contour, values*mask,lon,lat, levels=levels,C_color=c_levels,/overplot,c_labels = 0,/cell_fill, min_value = 2

hamax = 0 & bathy_mask = 0 & lat = 0 & lon = 0

most_image = tvrd()
Device, close = 1

; output image to a PNG file with transparency
name = 'test.png'
outputOverlayFile = filepath(name, root_dir=sourcepath(), subdir=['output'])

; set transparency
idx = where(most_image LT 240, trans_count)
if trans_count GT 0 then begin
write_png,outputOverlayFile ,most_image, r2,g2,b2, transparent=idx
endif


Anyhelp or tips on this would be greatly appreciated. I have looked at some of David Fanning's guides on creating images for Google Earth but could find anything on this exact issue.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Keyword UNAME not allowed in call to: CW_FSLIDER
Next Topic: parallel sign in postscript output in device fonts (direct graphics)

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:20:40 PDT 2025

Total time taken to generate the page: 0.00190 seconds