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

Home » Public Forums » archive » Geometric mismatch using cgImage and cgDrawShapes
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Geometric mismatch using cgImage and cgDrawShapes [message #92042] Fri, 02 October 2015 14:10 Go to previous message
Jonas Ardo is currently offline  Jonas Ardo
Messages: 12
Registered: April 2014
Junior Member
Hi

I have shape file (covering Senegal) in Sinusoidal projection I like to overlay on an image with the same projection.
Plotting the shape file only using cgDrawShapes works fine (http://postimg.org/image/8ax6pgm3x/) but when first using
cgImage to draw an image with the shape file on top, the data sets don't line up correctly and there is a geometric
mismatch ( http://postimg.org/image/s796ijbjj/).
The image and the shape file fit perfectly when displayed using ENVI.

What have I missed in order to get a good geometric match between the shape file and the image?


Code used:

pro mapmap
compile_opt idl2

e = ENVI(/HEADLESS)
file1 = 'D:\forskning\2015\MOD09A1\XPP\Senegal\MEAN_NPP_SENEGAL.img'
raster1 = e.OpenRaster(file1)
meannpp = raster1.GetData()

cgWindow, WAspect=1

shapefile = 'D:\forskning\2015\MBOW_etal\Brandt\data\Senegal_long_rot.sh p'

mapCoord = Obj_New('cgMap', 'SINUSOIDAL', LIMIT=[12, -18, 17, -11], $
Position=[0.05, 0.05, 0.95, 0.95], CENTER_LATITUDE=0, CENTER_LONGITUDE=0, $
FALSE_EASTING=0, FALSE_NORTHING = 0, SPHERE_RADIUS=6371007.181 )

mapCoord -> AddCmd

cgloadct,53, /Window, /Addcmd

cgImage, meannpp, /KEEP_ASPECT_RATIO, /ORDER, /WINDOW,MINVALUE=1,maxvalue=2000, /addcmd

cgDrawShapes, shapefile, Colors='black', MapCoord=mapCoord, /projected_XY, /AddCmd

cgMap_Grid, LatDel = 1.0, LonDel = 1.0, /Box_Axes, Color=cgColor('blue'), $
Map_Structure=mapCoord, /AddCmd

END


--
Jonas Ardö
Lund University, Sweden
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Coloring labelled regions (or states)
Next Topic: Temperature records

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

Current Time: Wed Oct 08 14:10:08 PDT 2025

Total time taken to generate the page: 0.00444 seconds