[gradsusr] Shapefiles drawing over each other

David Mocko David.Mocko at nasa.gov
Fri Apr 24 16:24:37 EDT 2015


Hello,

I'm trying to draw the U.S. Drought Monitor on 27 Jan 2004,
but I can't quite replicate this map using GrADS:
     http://droughtmonitor.unl.edu/data/pngs/20040127/20040127_conus_trd.png

I am using this shapefile available in the USDM archive:
     http://droughtmonitor.unl.edu/data/shapefiles_m/USDM_20040127_M.zip

What happens is that, depending on which order I draw the
individual polygons, some colors are overwritten by later
polygons that I draw.

If I draw the "yellow" drought category first, then the
yellow/light orange drought categories in Colorado are
overwritten with dark orange (grads_yellow-first.png).

If I draw the "red" drought category first, then the
light red/dark orange drought categories in Minnesota
are overwritten with light orange (grads_red-first.png).

I am attaching sample figures, as well as the GrADS scripts
that produce dthem.  Below, I list the result of "q shp" on
this shapefile, and my GrADS configuration.

Any help would be welcome,

David

---------
ga-> q shp USDM_20040127.shp

Shapefile Type=Polygon #Shapes=5 XBounds=-157.306:-88.7898 YBounds=19.1511:65.0444
0:  Polygon  parts=32  vertices=4022  XBounds=-157.306:-88.7898 
YBounds=19.1511:65.0444  ZBounds=0:0  MBounds=0:0
1:  Polygon  parts=8  vertices=2145  XBounds=-121.284:-89.1468 
YBounds=29.3411:49.3846  ZBounds=0:0  MBounds=0:0
2:  Polygon  parts=8  vertices=2057  XBounds=-120.725:-89.7628 
YBounds=30.1637:48.8752  ZBounds=0:0  MBounds=0:0
3:  Polygon  parts=8  vertices=1545  XBounds=-119.669:-91.0982 
YBounds=30.9017:48.4509  ZBounds=0:0  MBounds=0:0
4:  Polygon  parts=5  vertices=409  XBounds=-114.85:-102.183  YBounds=31.3319:47.3992 
  ZBounds=0:0  MBounds=0:0

---------
ga-> q config
Config: v2.1.a2.oga.2 little-endian readline grib2 netcdf hdf4-sds hdf5 
opendap-grids,stn athena geotiff shapefile cairo
Grid Analysis and Display System (GrADS) Version 2.1.a2.oga.2
Copyright (c) 1988-2013 by the Institute for Global Environment and Society (IGES)
This program is distributed WITHOUT ANY WARRANTY
See file COPYRIGHT for more information.

Built Wed Nov 12 22:59:49 EST 2014 for x86_64-unknown-linux-gnu

This version of GrADS has been configured with the following options:
   o Built on a LITTLE ENDIAN machine
   o Athena Widget GUI ENABLED
   o Command line editing ENABLED
       http://tiswww.case.edu/php/chet/readline/rltop.html
   o GRIB2 interface ENABLED
       http://www.ijg.org
       http://www.ece.uvic.ca/~mdadams/jasper
       http://www.nco.ncep.noaa.gov/pmb/codes/GRIB2
       g2clib-1.4.0
   o NetCDF interface ENABLED
       http://www.unidata.ucar.edu/software/netcdf
       netcdf 4.3.2 of May  1 2014 23:24:51 $
   o OPeNDAP gridded data interface ENABLED
   o OPeNDAP station data interface ENABLED
       http://iges.org/grads/gadoc/supplibs.html
       libgadap 2.0.oga.1
   o HDF4 and HDF5 interfaces ENABLED
       http://hdfgroup.org
       HDF 4.2r5
       HDF5 1.8.12
   o GeoTIFF and KML/TIFF output ENABLED
       http://www.libtiff.org
       http://geotiff.osgeo.org
   o KML contour output ENABLED
   o Shapefile interface ENABLED
       http://shapelib.maptools.org
   o Cairo graphics interface ENABLED
       http://cairographics.org
       http://cgit.freedesktop.org/pixman
       http://www.freetype.org/index2.html
       http://www.freedesktop.org/wiki/Software/fontconfig
       Cairo 1.12.16
       Pixman 0.28.0
       Freetype 2.3.8
       Fontconfig 2.11.1


-- 
--------------------------------------------------------------------------
David M. Mocko, Building 33, Room G108                David.Mocko at nasa.gov
NASA Goddard Space Flight Center                     Voice: (301)-614-6222
Code 610.1, Greenbelt MD 20771                         Fax: (301)-614-6246
SAIC (Science Applications International Corporation)
with the Global Modeling and Assimilation Office
  and the Hydrological Sciences Laboratory
                         http://neptune.gsfc.nasa.gov/hsb/personnel/?dmocko
--------------------------------------------------------------------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: grads_yellow-first.png
Type: image/png
Size: 160624 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20150424/2ff226da/attachment-0002.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: grads_red-first.png
Type: image/png
Size: 156902 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20150424/2ff226da/attachment-0003.png 
-------------- next part --------------

'reinit'

'sdfopen http://hydro1.sci.gsfc.nasa.gov/dods/NLDAS_FORA0125_M.002'
'set datawarn off'
'set mpdset mres'
'd maskout(apcpsfc,apcpsfc-9999.0)'
'q shp USDM_20040127.shp'
say result

'set rgb 41 255 255   0'
'set rgb 42 252 211 127'
'set rgb 43 255 170   0'
'set rgb 44 230   0   0'
'set rgb 45 115	  0   0'

'set line 41 1 0.6'
'set shpopts 41'
'draw shp USDM_20040127.shp 0 0'
'set line 42 1 0.6'
'set shpopts 42'
'draw shp USDM_20040127.shp 1 1'
'set line 43 1 0.6'
'set shpopts 43'
'draw shp USDM_20040127.shp 2 2'
'set line 44 1 0.6'
'set shpopts 44'
'draw shp USDM_20040127.shp 3 3'
'set line 45 1 0.6'
'set shpopts 45'
'draw shp USDM_20040127.shp 4 4'

'draw map'

'printim grads_yellow-first.png x1200 y900 white'
-------------- next part --------------

'reinit'

'sdfopen http://hydro1.sci.gsfc.nasa.gov/dods/NLDAS_FORA0125_M.002'
'set datawarn off'
'set mpdset mres'
'd maskout(apcpsfc,apcpsfc-9999.0)'
'q shp USDM_20040127.shp'
say result

'set rgb 41 255 255   0'
'set rgb 42 252 211 127'
'set rgb 43 255 170   0'
'set rgb 44 230   0   0'
'set rgb 45 115	  0   0'

'set line 45 1 0.6'
'set shpopts 45'
'draw shp USDM_20040127.shp 4 4'
'set line 44 1 0.6'
'set shpopts 44'
'draw shp USDM_20040127.shp 3 3'
'set line 43 1 0.6'
'set shpopts 43'
'draw shp USDM_20040127.shp 2 2'
'set line 42 1 0.6'
'set shpopts 42'
'draw shp USDM_20040127.shp 1 1'
'set line 41 1 0.6'
'set shpopts 41'
'draw shp USDM_20040127.shp 0 0'

'draw map'

'printim grads_red-first.png x1200 y900 white'


More information about the gradsusr mailing list