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
Re: Question about projection for Google Earth [message #85454 is a reply to message #85453] Thu, 08 August 2013 19:26 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
timothyja123@gmail.com writes:

>
> 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.

All of these details are handled automatically for you in cgImage2KML.

http://www.idlcoyote.com/idldoc/cg/cgimage2kml.html

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")
[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: Fri Oct 10 12:54:24 PDT 2025

Total time taken to generate the page: 0.16182 seconds