[Proj] NADCON data

Hamish hamish_b at yahoo.com
Mon Jun 8 02:06:26 PDT 2009


Gerald wrote:
> what follows is a quick list of the headers for the current NADCON
> distribution.
....
> One added complaint about this stuff is that the headers
> could have at least a short ID as to the general area.  I have
> to get the atlas out to figure where some of these spots are.

mostly out of idle curiosity I used that table to make grids in GRASS
and plotted them up. see http://bambi.otago.ac.nz/hamish/grass/screenshots/nadcon_grids.jpg


fwiw, commands to do that:
$ tr -s ' ' '|' < nadcon_grids.txt | sed -e 's/^|//' > nadcon_grids.dat

GRASS>>>

# build grids
while read LINE ; do
    if [ `echo "$LINE" | grep -c '^#'` -eq 1 ] ; then
       continue
    fi

    NAME=`echo "$LINE" | cut -f1 -d'.'`
    NUM_COLS=`echo "$LINE" | cut -f2 -d'|'`
    NUM_ROWS=`echo "$LINE" | cut -f3 -d'|'`
    NUM_Z="1"
    MIN_LON=`echo "$LINE" | cut -f5 -d'|'`
    DEL_LON=`echo "$LINE" | cut -f6 -d'|'`
    MIN_LAT=`echo "$LINE" | cut -f7 -d'|'`
    DEL_LAT=`echo "$LINE" | cut -f8 -d'|'`

    echo
    echo "$NAME ..."

    v.mkgrid map="$NAME" grid=$NUM_ROWS,$NUM_COLS position=coor \
       coor=$MIN_LON,$MIN_LAT box=$DEL_LON,$DEL_LAT

done < nadcon_grids.dat


# sort by number of columns so widest is drawn first
NAMES=`sort -r -n -t'|' -k 2 nadcon_grids.dat | cut -f1 -d'.' | grep -v '^#'`


#display
d.mon x0
d.rast etopo2

for NAME in $NAMES ; do
  RANDOM_COLOR="$((RANDOM / 128)):$((RANDOM / 128)):$((RANDOM / 128))"

  d.vect $NAME type=boundary color=$RANDOM_COLOR
done

# save as jpeg
d.out.file nadcon_grids format=jpg

# identify a grid
d.what.vect   [click]


probably much more efficient to do that as raster arrays, but whatever.


Hamish



      




More information about the Proj mailing list