Re: mapcontinents with /hires option failing [message #83317] |
Fri, 22 February 2013 10:00 |
PMan
Messages: 61 Registered: January 2011
|
Member |
|
|
On Friday, February 22, 2013 9:28:21 AM UTC-5, Paul Mallas wrote:
> I have found a problem with mapcontinents using the /hires option (running IDL 8.2.2 on Windows 7 64 bit)
>
>
>
> I seem to recall it working fine before if prior IDL versions, so I am not sure if it actually a bug in the code or perhaps the data is just corrupted in the location where I am looking (like the vertices are in the wrong order in a shapefile and the order determines the what is inside the shape and what is outside). But it appears that the for this case, the continent is mapped incorrectly and the Mediterranean Sea is mapped as land. See the example below:
>
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
>
> pro mapTest
>
> compile_opt idl2
>
>
>
> map1 = MAP('Geographic', $
>
> LIMIT=[35, -6 , 37 , -4], $
>
> FILL_COLOR='light_blue', $
>
> WINDOW_TITLE='Straits of Gibraltar')
>
>
>
> grid1 = map1.MAPGRID
>
> grid1.LINESTYLE = 'dotted'
>
> grid1.LABEL_SHOW = 0
>
>
>
> m1 = MAPCONTINENTS(FILL_COLOR='beige')
>
> wait, 3
>
> m1 = MAPCONTINENTS(FILL_COLOR='green', /hires)
>
>
>
> end
David, thanks for the taking a look. Chris, thanks for the tip.
Regards,
Paul
|
|
|
Re: mapcontinents with /hires option failing [message #83318 is a reply to message #83317] |
Fri, 22 February 2013 09:51  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Chris Torrence writes:
> It looks like there are a couple of things going on. By default, the MAP() function is assigning the center_longitude of the projection to the center of the map, instead of 0 degrees. I'm not sure if this is correct or not, but regardless, the map_proj_forward is then having trouble clipping the polygon.
>
> I'll look into both issues, but in the meantime, if you specify CENTER_LONGITUDE=0 in your map() call, it should give you a nice looking map.
Yes, I think the problem is that Map_Proj_Init returns incorrect UV
coordinates if the center longitude is anything other than zero. I've
had to correct this myself in my cgMap object because I haven't been
able to get anyone at ExcelisVis to understand what the hell I was going
on about. :-)
Here is the article that describes the problem:
http://www.idlcoyote.com/map_tips/uvrange.php
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.")
|
|
|
Re: mapcontinents with /hires option failing [message #83320 is a reply to message #83318] |
Fri, 22 February 2013 09:37  |
chris_torrence@NOSPAM
Messages: 528 Registered: March 2007
|
Senior Member |
|
|
Hi Paul & David,
It looks like there are a couple of things going on. By default, the MAP() function is assigning the center_longitude of the projection to the center of the map, instead of 0 degrees. I'm not sure if this is correct or not, but regardless, the map_proj_forward is then having trouble clipping the polygon.
I'll look into both issues, but in the meantime, if you specify CENTER_LONGITUDE=0 in your map() call, it should give you a nice looking map.
Cheers,
Chris
ExelisVIS
|
|
|
Re: mapcontinents with /hires option failing [message #83323 is a reply to message #83320] |
Fri, 22 February 2013 07:22  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
> I'm guessing it probably has more to do with the Map or MapContinents
> functions not working properly, because there doesn't seem to be
> anything wrong with the HIRES data. These commands work correctly:
>
> mapCoord = cgMap('Equirectangular', LIMIT=[35, -6 , 37 , -4], $
> Position=[0.1, 0.1, 0.9, 0.9])
> cgDisplay
> mapCoord ->draw
> cgColorFill, Position=[0.1, 0.1, 0.9, 0.9], color='sky blue'
> cgMap_Continents, color='tan', MAP=mapCoord, /Fill, /HiRes
> cgMap_Grid, /Box_Axes, /Label, Map=mapCoord
It occurs to me that the MapContinents function might be using GSHHS
shoreline data, and that might be the problem. So, I tried the same
thing with high resolution GSHHS data:
mapCoord = cgMap('Equirectangular', LIMIT=[35, -6 , 37 , -4], $
Position=[0.1, 0.1, 0.9, 0.9])
cgDisplay
mapCoord ->draw
cgColorFill, Position=[0.1, 0.1, 0.9, 0.9], color='sky blue'
cgMap_GSHHS, 'C:\IDL\data\gshhs\gshhs_2.2\gshhs\gshhs_h.b', $
Map=mapCoord, Color='tan', /Fill,
cgMap_Grid, /Box_Axes, /Label, Map=mapCoord
This works perfectly, too. So, I don't think there is anything wrong
with the HIRES data. I think the problem must be in MapContinents.
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.")
|
|
|
Re: mapcontinents with /hires option failing [message #83324 is a reply to message #83323] |
Fri, 22 February 2013 06:41  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Paul Mallas writes:
> I have found a problem with mapcontinents using the /hires option (running IDL 8.2.2 on Windows 7 64 bit)
>
> I seem to recall it working fine before if prior IDL versions, so I am not sure if it actually a bug in the code or perhaps the data is just corrupted in the location where I am looking (like the vertices are in the wrong order in a shapefile and the order determines the what is inside the shape and what is outside). But it appears that the for this case, the continent is mapped incorrectly and the Mediterranean Sea is mapped as land
I'm guessing it probably has more to do with the Map or MapContinents
functions not working properly, because there doesn't seem to be
anything wrong with the HIRES data. These commands work correctly:
mapCoord = cgMap('Equirectangular', LIMIT=[35, -6 , 37 , -4], $
Position=[0.1, 0.1, 0.9, 0.9])
cgDisplay
mapCoord ->draw
cgColorFill, Position=[0.1, 0.1, 0.9, 0.9], color='sky blue'
cgMap_Continents, color='tan', MAP=mapCoord, /Fill, /HiRes
cgMap_Grid, /Box_Axes, /Label, Map=mapCoord
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.")
|
|
|