User's Guide

WDB2RAS

Rasterize vector data from World Data Bank II

Function:

Rasterize vector data from World Data Bank II (WDBII) and either create a new image that can be used as an overlay for the input image, copy the image data from the input image to a new image with line work overlaid on it, or write the line work directly into the input image. This routine places line work into AVHRR LAS images in satellite or other projections. If the input image is in the AVHRR satellite's projection, it must have an associated AVHRR Data Descriptor Record (ADDR).

Parameters:

IN
Input image. The image for which the vector overlay is being generated. It must be a single band image if the vector data is to be overlaid onto the image (when OUT is NULL).

OUT
Output image. The output image will be a one-band image containing a background of BACKGRND values or the image data from IN, with lines of PIXVAL drawn over it. When this parameter is NULL, the vector data is drawn directly into the input image.

AREA(NA)
World Data Bank II area. The area of the World Data Bank II that is to be rasterized. The name of a user-specified area is used as the file name for nonstandard World Data Bank II format files.

   = NA:  North America
   = EU:  Europe
   = AS:  Asia
   = SA:  South America
   = AF:  Africa
   = User-specified area

CIL(--)
Coastlines, islands, and lakes classifications. The outlines of these coastlines, islands, and lakes will be drawn into the appropriate image. If defaulted, none of these features will be drawn.

  = 1:   Coastlines, islands, 
         and lakes that appear 
         on all maps
  = 2:   Major islands and lakes
  = 3:   Intermediate islands 
         and lakes
  = 4:   Minor islands and lakes
  = 6:   Intermittent major 
         lakes
  = 7:   Intermittent minor 
         lakes
  = 8:   Reefs
  = 9:   Major salt pans
  = 10:  Minor salt pans
  = 13:  Major ice shelves
  = 14:  Minor ice shelves
  = 15:  Glaciers

RIV(--)
Rivers. The outlines of these types of rivers will be drawn into the appropriate image. If defaulted, no rivers will be drawn.

  = 1:   Permanent major rivers
  = 2:   Additional major rivers
  = 3:   Additional rivers
  = 4:   Minor rivers
  = 5:   Double-lined rivers
  = 6:   Major intermittent 
         rivers
  = 7:   Additional intermittent
         rivers
  = 8:   Minor intermittent 
         rivers
  = 10:  Major canals
  = 11:  Minor canals
  = 12:  Irrigation canals

BDY(--)
International boundaries or limits of sovereignty. These boundaries will be drawn into the appropriate image. If defaulted, none of these boundaries will be drawn.

  = 1:  Demarcated or delimited
  = 2:  Indefinite or in dispute
  = 3:  Other line of separation
        or sovereignty on land

PDY(--)
Internal boundaries. These boundaries will be drawn into the appropriate image. If defaulted, none of these boundaries will be drawn.

  = 1:  First order 
        administrative
  = 2:  Second order 
        administrative
  = 3:  Third order 
        administrative

RRR(--)
Railroads. The outlines of these railroads will be drawn into the appropriate image. If defaulted, no railroads will be drawn.

  = 11:  Broad gauge
  = 12:  Standard gauge
  = 13:  Narrow gauge

RDS(--)
Roads. The outlines of these roads will be drawn into the appropriate image. If defaulted, no roads will be drawn.

  = 11:  2 or more lanes
  = 12:  Hard-surface highway
  = 13:  Gravel
  = 14:  Unsurfaced
  = 15:  Track, trail, or 
         caravan
  = 16:  Road ferries
  = 17:  Under construction
  = 19:  Undifferentiated

PIXVAL(255)
Pixel value. The grey level value to be given to the rasterized vector data.

BACKGRND(0)
Background value. The value given to the pixels of the output image that are not assigned a value from the input vector data. If BACKGRND is NULL, the background of OUT will be filled with the pixel values from the input image. This parameter is ignored if OUT is NULL.

LINWT(1)
Line weight. The width, in number of pixels, of the rasterized line.

PNTINT(1)
Point interval. Every PNTINT point from the WDBII line segment will be used to generate line work in OUT. Increasing PNTINT will allow the user to generate an image more quickly while maintaining relatively accurate line work. Each increment of PNTINT is about 40% faster than the previous PNTINT, up to PNTINT=5. After that, the speed increase is less noticeable. For example, specifying PNTINT=5 will complete in one-third to one-fourth the time of PNTINT=1.

PROJ(SAT)
Projection code. The projection type of the input image.

  = SAT:  Satellite projection.  The input image is 
          in satellite projection.
  = OTH:  All other projections.  Projection 
          information for the image is retrieved from
          the DDR.

Examples:

  1. LAS> wdb2ras in=inimg out=outimg area=na cil=(1,2)

    OUTIMG will be a one-band image the same size as INIMG, containing the coastlines, islands, and lakes that appear on all maps, and other major islands and lakes of North America. Since INIMG is in the satellite's projection, OUTIMG will also.

  2. LAS> wdb2ras in="inimg(:2)" out=-- area=(na,sa) riv=4 pixval=1023 linwt=2

    Band two of INIMG will have line work drawn into it. The minor rivers of North and South America will be drawn with a pixel value of 1023. Lines will be two pixels wide.

  3. LAS> wdb2ras in=inimg out=outimg area=sa bdy=1 proj=oth pntint=4

    The international boundaries of South America will be drawn into OUTIMG. INIMG was reprojected, so OUTIMG will be in the same projection. Every fourth point of the WDBII segments is selected.

Description/Algorithm:

WDBII files contain vector data of feature outlines. The data consists of a series of latitude/longitude pairs that are points along the line segments. In order to "rasterize" the WDBII vector data, each latitude/longitude point in the file must be converted to a line/sample coordinate. The points must then be connected to produce line segments.

Processing begins by opening a temporary scan file. The correct WDBII files for the specified areas and features are opened. While reading through the WDBII file, whenever a line segment falls within the image, the corresponding line and sample values of every PNTINT point in that segment are calculated. Then the endpoints and line/sample values of pixels connecting these two points are written to the temporary scan file. After all the WDBII files have been read, they are closed and the scan file is sorted. The raster image is then opened and the sorted file is read. Line work is inserted into the raster image as it is being written. If a new output image is being created, it will be a single-band image the same size as IN. For each line in the sorted file, the appropriate pixels are set to PIXVAL, and the rest are set to BACKGRND or copied from IN if BACKGRND is NULL. If no output image is specified, the lines will be written over the top of IN with a pixel value of PIXVAL.

Nonfatal Error Messages:

  1. [wdb2ras-nofile] <XXXX> file does not exist

    The specified WDBII file does not exist; therefore, the expected line work will not be created. The program will go on to the next feature.

  2. [wdb2ras-outaddr] Error creating addr file for OUT

    An error occurred while creating an AVHRR DDR file for OUT. This file may be necessary if OUT will in turn be processed using ADAPS functions.

  3. [wdb2ras-warn] Nonfatal error encountered

    A nonfatal error was encountered during processing. The preceding message explains the exact error.

Fatal Error Messages:

  1. [wdb2ras-alloc] Error allocating dynamic memory

    An error occurred dynamically allocating memory, which was required for further processing. Contact the system administrator if the problem persists.

  2. [wdb2ras-brange] BACKGRND is not within the valid range for <XXX> data

    The value specified for BACKGRND was not within the valid range for the data type of IN. Retry, using a different value for BACKGRND.

  3. [wdb2ras-empty] No vector data occurs in the output image

    After scanning all lines in the specified WDBII files, no segments were found to fall in the output image. Check that the AREA specified covers the area of the scene.

  4. [wdb2ras-fatal] Fatal error encountered

    A fatal error was encountered during processing. The preceding message explains the exact error.

  5. [wdb2ras-onebnd] Only a single band image allowed on input

    This error may occur in two cases. One band of IN must be specified when OUT is NULL, because the line work is placed directly into IN. If OUT is specified and BACKGRND is NULL, one band from IN must be specified from which background data will be taken. Retry, either by specifying a new image in OUT or by specifying one band in IN.

  6. [wdb2ras-opnscn] Error opening scan file

    An error occurred opening a file into which line segments will be placed. Check to ensure there is sufficient disk space and that you have write permission in the current working directory.

  7. [wdb2ras-pcode] Projection code of image is invalid

    PROJ was specified as "OTH", but the input image's DDR had an invalid projection code. Ensure that the image is in a valid projection. If not, reproject the image or use the "SAT" satellite projection.

  8. [wdb2ras-pcoord] Corner projection coordinates of image are invalid

    PROJ was specified as "OTH", but the input image's DDR had invalid corner projection coordinates. These are necessary to find the appropriate line and sample for the given line segment. Ensure that the image is in a valid projection. If not, reproject the image or use the "SAT" satellite projection.

  9. [wdb2ras-pdist] Projection distances per pixel of image are invalid

    PROJ was specified as "OTH", but the input image's DDR had invalid values for projection distance per pixel. These are necessary to find the appropriate line and sample for the given line segment. Verify that the image has a valid DDR. If not, reproject the image, or use the "SAT" satellite projection.

  10. [wdb2ras-prange] PIXVAL is not within the valid range for <XXX> data

    The value specified for PIXVAL was not within the valid range for the data type of IN. Retry, using a different value for PIXVAL.

  11. [wdb2ras-punit] Invalid projection unit

    PROJ was specified as "OTH", but the input image's DDR had an invalid projection unit. This is necessary to find the appropriate line and sample for the given line segment. Reproject the image, or use the "SAT" satellite projection.

  12. [wdb2ras-system] System file sort failed

    An error occurred while sorting the scan file of line segments. Check to ensure there is sufficient disk space to write another file the same size as the scan file.

User Notes:

  1. WDB2RAS works for LAC or GAC AVHRR LAS images. They may have been subsampled (i.e. reduced or enlarged in size) and/or reprojected.

  2. Increasing PNTINT will allow the user to generate an image more quickly while maintaining relatively accurate line work. Each increment of PNTINT is noticeably faster than the previous, up to PNTINT=5. After that, the speed increase is less noticeable. For example, specifying PNTINT=5 will generally complete in one-third to one-fourth the time of PNTINT=1. The line work will be relatively accurate, but the lines may appear more "jagged" as the distance between points increases.

  3. To overlay line work onto IN, OUT must be set to NULL. To create a new image of line work , OUT must be specified.

  4. For more information about the World Data Bank II, refer to the WDBII General Users' Guide.