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

Home » Public Forums » archive » CGMAP_GSHHS: problem with land/water colors
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
CGMAP_GSHHS: problem with land/water colors [message #85515] Wed, 14 August 2013 12:08 Go to previous message
Matteo is currently offline  Matteo
Messages: 28
Registered: August 2011
Junior Member
Hi,

I noticed using CGMAP_GSHHS.PRO that if no ocean waters are present on a map, the LAND keyword for the land color does not work properly. Here's a snippet code that reproduces the problem (note that it is very similar to the one included in the examples of the CGMAP_GSHHS header). Just set your PATH to include the CGxxx routines and the correct directory for the gshhs.b file.


PRO test_gshhs

!path=[SET PATH HERE]
datafile='./gshhs_h.b' [SET PATH TO GSHHS_H.B HERE]

; include some water
map_limits = [29.,-95.,34.,-88]
; land only
;map_limits = [31.,-95.,34.,-88]

cgDisplay, 500, 350
pos = [0.1,0.1, 0.9, 0.8]

; set map projection
cgmap_set, limit = map_limits, /mercator, position=pos

; set a SKYBLUE background
cgColorfill, [pos[0], pos[0], pos[2], pos[2], pos[0]], $
[pos[1], pos[3], pos[3], pos[1], pos[1]], $
/Normal, Color='skyblue'

; issue CGMAP_GSHHS
cgMap_GSHHS, datafile, Fill=1, Level=4, Color='black', /Outline, $
Land='tan', Water_color='skyblue', NoClip=0

; overdraw state borders
cgmap_set, limit = map_limits, /mercator, /continents, position=pos, $
color='yellow', /usa, /noerase
END


Run the program first with map_limits set to include some Gulf waters around Lousiana (map_limits = [29.,-95.,34.,-88]). Then comment in the 'land only' option to exclude the water at the lower latitudes.
In the latter case I obtain a SKYBLUE rather than a TAN background, which is obviously wrong. Furthermore, the WATER_COLOR keyword only works for inland water bodies, therefore CGCOLORFILL must be used to start from a SKYBLUE background.

You will also notice that having to reissue CGMAP_SET at the end to draw state borders (yellow) over everything leads to imperfect overlap with the black GSHHS shorelines, expected because of the different resolution.

I would appreciate if anybody could take a look at it. Apologies to David if I'm mistaking the correct usage of his routine.

m
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Not IDL Related Question
Next Topic: copying text to the system clipboard

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

Current Time: Wed Oct 08 17:29:27 PDT 2025

Total time taken to generate the page: 0.00427 seconds