User's Guide

TAB2RAS

Converts vector data stored in a labeled table to a raster image

Function:

Converts vector data that is stored in a labeled table to raster image data. It can process polygon, line, or point data, but only one type of data can be processed at a time.

Parameters:

Subcommand -POLYGON:
The -POLYGON subcommand converts polygon vector data to raster data. Polygon boundaries are represented by a network of logical boundary lines. Each boundary line has element id designators for the polygons located on the left and right sides of the boundary line. The proper left and right polygon designation is required if PIXVAL is not specified.

The LAS image generated by TAB2RAS-POLYGON features filled polygons. Either the value of the element id designators, LEFTATR or RGHTATR, associated with each boundary of the polygon or the value specified by PIXVAL is assigned to the interior of a polygon. The background value, BACKGRND, is assigned to each pixel that is not assigned to a polygon.

Multiple assignments for a pixel are resolved in favor of the left most boundary line intersection in the pixel. A boundary line intersects a pixel when the boundary line crosses the horizontal scan line running through the center of the pixel.

INLT
Input labeled table. This is the input labeled table file that contains the polygon, line, or point vector data. In the first (master) labeled table file is a list of subfiles that are associated with this labeled table file. If you want to use this list of subfiles as it exists, only the name of the master labeled table file is needed. If different subfiles are to be used, the master file and all of the subfiles will need to be specified. They should be specified in the following order. The fifth file is optional, and will be used to place projection information in the DDR.


   File containing the Y X coordinates
   File containing the primary attributes
   File containing the secondary attributes
   File containing the bounding information
   File containing the projection information

OUT
Output image. The output image will be a single-band BYTE, INTEGER*2, or INTEGER*4 image. The data type will be determined by the largest value to be placed in the output image.

PIXSIZ
Pixel size. PIXSIZ defines the ground dimension of each pixel. PIXSIZ is specified in the same units of measure as the vector data. The first value is the dimension in the line (Y) direction, and the second value is in the sample (X) direction.

BACKGRND(0)
Back ground value. The value given to the pixels of the output image that are not assigned a value from the input vector data.

CORNVALS(--)
Corner values. The corner coordinate value of the northwest corner of the output image. These values should be specified in the same units as the vector data and should be in Y/X format. The values will be used exactly as specified and NL and NS must also be specified. If a null value is specified, CORNATR must be specified.

NL(--)
Number of lines. The number of lines in the output image. This value is ignored if CORNVALS is not specified.

NS(--)
Number of samples. The number of samples in the output image. This value is ignored if CORNVALS is not specified.

CORNATR("YMAX","XMIN","YMIN","XMAX")
Corner attribute. The attribute name of the field that defines the corners of the output image. This can be four 1 X 4 matrix attributes, two 1 X 2 matrix attributes or one 2 X 2 matrix attributes. The values will be rounded to a divisor of the pixel size. This parameter is ignored if CORNVALS is specified.

PIXVAL(--)
Pixel value. The pixel value that will be assigned to all polygons in the output image.

LEFTATR("LFTREG")
Left element id attribute. The attribute name of the field that defines the pixel value to the left of the boundary line that will be used for the polygon in the output image. This parameter is ignored if PIXVAL is specified.

RGHTATR("RGTREG")
Right element id attribute. The attribute name of the field that defines the pixel value to the right of the boundary line that will be used for the polygon in the output image. This parameter is ignored if PIXVAL is specified.

PTIDATR("ID")
Point ID attribute. The attribute name of the field that defines the ID value for each of the polygon boundary lines. Each line must have an unique ID value associated with it. This id attribute must tie the line to the other attribute values in the labeled table either directly or through the use of the index attribute.

INDEXATR("INDEX")
Index attribute. The attribute name of the field that defines the index numbers for each of the polygon boundary lines. If a null values is specified, it is assumed that there is a direct link between the ID attribute values and the other attribute values.

COORSATR("Y","X")
Coordinate attribute. The attribute name of the field that defines the coordinates of the each of the points that create the polygon boundary line. Each line must have at least two points. If the coordinates are specified under one attribute, the coordinates must be in the Y/X order.

SEQNOATR("SEQ")
Sequence number attribute. The attribute name of the field that defines the sequence number of each of the coordinates that make up the boundary line.

PRJPMATR("PPARMS")
Projection parameters attribute. The attribute name of the field that defines the projection parameters. This will not be used if the fifth labeled table is not specified.

PRJCDATR("PCODE")
Projection type attribute. The attribute name of the field that defines the projection code. This will not be used if the fifth labeled table is not specified.

ZONEATR("PZONE")
Zone number attribute. The attribute name of the field that defines the zone number. This will not be used if the fifth labeled table is not specified.

DCODEATR("PDATUM")
Datum code attribute. The attribute name of the field that defines the datum code. This will not be used if the fifth labeled table is not specified.

UNITSATR("UNITS")
Projection measurement units attribute. The attribute name of the field which defines the units of measurement. This will not be used if the fifth labeled table is not specified.

VALIDATR("PVALID")
DDR valid attribute. The attribute name of the valid flag. This will not be used if the fifth labeled table is not specified.

LISTFLG(NO)
List flag. Flag to specify if error messages from range check should be displayed.

 
 = YES: List messages.  Error messages will be 
        displayed if coordinate values do not lie 
        within the output image.
 = NO:  Do not list messages.  Error messages will
        not be displayed if coordinate values are 
        outside the image.

MOSCFLG(NO)
Mosaic flag. The mosaic flag may be used when a polygon raster image is being produced that is to be mosaiced with other polygon raster images. The intent of the mosaic process is to eliminate gaps that may otherwise occur in a mosaiced image due to pixel assignment rounding.


  = YES: Apply mosaic option.  The last pixel of non
         background data in each line is repeated in 
         the next pixel of the same line.  The last
         line in the image that has any non back
         ground values is modified in such a way that
         each pixel in that line having the back
         ground value is assigned the value of the 
         pixel above it. 
  = NO:  Do not apply mosaic option.  No extra pixels
         are filled.
Subcommand -LINE:
The -LINE subcommand converts line vector data to raster data. The LAS image generated features the line network imposed on a background filled with the value specified by BACKGRND. Each pixel that is intersected by an line has the value of either the attribute specified by PXVALATR or the value specified by PIXVAL assigned to it. A line intersects a pixel when the line passes through any part of the pixel. The top and left pixel borders are considered to be part of the pixel. The bottom and right pixel borders are considered to be part of other pixels.

Each line has a priority assigned to it. Multiple line assignments for a pixel are resolved using the priority assignments of the lines, the starting sample of the lines on the contested image line, and the shortest horizontal run of the lines in contention. Note that this assignment scheme forces the abbreviation and interruption of lower priority lines by lines of higher priority.

INLT
Input labeled table. This is the input labeled table file that contains the polygon, line, or point vector data. In the first (master) labeled table file is a list of subfiles that are associated with this labeled table file. If you want to use this list of subfiles as it exists, only the name of the master labeled table file is needed. If different subfiles are to be used, the master file and all of the subfiles will need to be specified. They should be specified in the following order. The fifth file is optional, and will be used to place projection information in the DDR.


   File containing the Y X coordinates
   File containing the primary attributes
   File containing the secondary attributes
   File containing the bounding information
   File containing the projection information

OUT
Output image. The output image will be a single-band BYTE, INTEGER*2, or INTEGER*4 image. The data type will be determined by the largest value to be placed in the output image.

PIXSIZ
Pixel size. PIXSIZ defines the ground dimension of each pixel. PIXSIZ is specified in the same units of measure as the vector data. The first value is the dimension in the line (Y) direction, and the second value is in the sample (X) direction.

BACKGRND(0)
Back ground value. The value given to the pixels of the output image that are not assigned a value from the input vector data.

CORNVALS(--)
Corner values. The corner coordinate value of the northwest corner of the output image. These values should be specified in the same units as the vector data and should be in Y/X format. The values will be used exactly as specified and NL and NS must also be specified. If a null value is specified, CORNATR must be specified.

NL(--)
Number of lines. The number of lines in the output image. This value is ignored if CORNVALS is not specified.

NS(--)
Number of samples. The number of samples in the output image. This value is ignored if CORNVALS is not specified.

CORNATR("YMAX","XMIN","YMIN","XMAX")
Corner attribute. The attribute name of the field that defines the corners of the output image. This can be four 1 X 4 matrix attributes, two 1 X 2 matrix attributes or one 2 X 2 matrix attributes. The values will be rounded to a divisor of the pixel size. This parameter is ignored if CORNVALS is specified.

PIXVAL(--)
Pixel value. The pixel value that will be assigned to all of the lines in the output image.

PXVALATR("COLOR")
Pixel value attribute. The attribute name of the field that defines the pixel values that will be used for each of the lines in the output image. This parameter is ignored if PIXVAL is specified.

PTIDATR("ID")
Point ID attribute. The attribute name of the field that defines the ID value for each of the lines. Each line must have an unique ID value associated with it. This id attribute must tie the line to the other attribute values in the labeled table either directly or through the use of the index attribute.

INDEXATR("INDEX")
Index attribute. The attribute name of the field that defines the index numbers for each of the lines. If a null values is specified, it is assumed that there is a direct link between the ID attribute values and the other attribute values.

COORSATR("Y","X")
Coordinate attribute. The attribute name of the field that defines the coordinates of the each of the points that create the line. Each line must have at least two points. If the coordinates are specified under one attribute, the coordinates must be in the Y/X order.

SEQNOATR("SEQ")
Sequence number attribute. The attribute name of the field that defines the sequence number of each of the coordinates that make up the line.

PRIORATR("PRIORITY")
Priority attribute. The attribute name of the field that defines the priority of a particular line compared to an intersecting line.

LNWGTATR(--)
Line weight attribute. The attribute name of the field that defines the line weight each of the lines should have in the image. The values of this field should contain the width that each line will be in pixels.

PRJPMATR("PPARMS")
Projection parameters attribute. The attribute name of the field that defines the projection parameters. This will not be used if the fifth labeled table is not specified.

PRJCDATR("PCODE")
Projection type attribute. The attribute name of the field that defines the projection code. This will not be used if the fifth labeled table is not specified.

ZONEATR("PZONE")
Zone number attribute. The attribute name of the field that defines the zone number. This will not be used if the fifth labeled table is not specified.

DCODEATR("PDATUM")
Datum code attribute. The attribute name of the field that defines the datum code. This will not be used if the fifth labeled table is not specified.

UNITSATR("UNITS")
Projection measurement units attribute. The attribute name of the field which defines the units of measurement. This will not be used if the fifth labeled table is not specified.

VALIDATR("PVALID")
DDR valid attribute. The attribute name of the valid flag. This will not be used if the fifth labeled table is not specified.

LISTFLG(NO)
List flag. Flag to specify if error messages from range check should be displayed.

 
 = YES: List messages.  Error messages will be 
        displayed if coordinate values do not lie 
        within the output image.
 = NO:  Do not list messages.  Error messages will
        not be displayed if coordinate values are 
        outside the image.
Subcommand -POINT:
The -POINT subcommand converts point vector data to raster image data. Several points may have the same identifier. Each point identifier has a priority assigned to it. Multiple point assignments for a single pixel are resolved using these priority assignments.

The LAS image generated features the points imposed on a background filled with BACKGRND. Each pixel that is intersected by a point has the value of either the attribute specified by PXVALATR or the value specified by PIXVAL assigned to it. A point is intersects a pixel when the point lies in any part of the pixel. The top and left pixel borders are considered to be part of the pixel. The bottom and right pixel borders are considered to be part of other pixels.

INLT
Input labeled table. This is the input labeled table file that contains the polygon, line, or point vector data. In the first (master) labeled table file is a list of subfiles that are associated with this labeled table file. If you want to use this list of subfiles as it exists, only the name of the master labeled table file is needed. If different subfiles are to be used, the master file and all of the subfiles will need to be specified. They should be specified in the following order. The fifth file is optional, and will be used to place projection information in the DDR.


   File containing the Y X coordinates
   File containing the primary attributes
   File containing the secondary attributes
   File containing the bounding information
   File containing the projection information

OUT
Output image. The output image will be a single-band BYTE, INTEGER*2, or INTEGER*4 image. The data type will be determined by the largest value to be placed in the output image.

PIXSIZ
Pixel size. PIXSIZ defines the ground dimension of each pixel. PIXSIZ is specified in the same units of measure as the vector data. The first value is the dimension in the line (Y) direction, and the second value is in the sample (X) direction.

BACKGRND(0)
Back ground value. The value given to the pixels of the output image that are not assigned a value from the input vector data.

CORNVALS(--)
Corner values. The corner coordinate value of the northwest corner of the output image. These values should be specified in the same units as the vector data and should be in Y/X format. The values will be used exactly as specified and NL and NS must also be specified. If a null value is specified, CORNATR must be specified.

NL(--)
Number of lines. The number of lines in the output image. This value is ignored if CORNVALS is not specified.

NS(--)
Number of samples. The number of samples in the output image. This value is ignored if CORNVALS is not specified.

CORNATR("YMAX","XMIN","YMIN","XMAX")
Corner attribute. The attribute name of the field that defines the corners of the output image. This can be four 1 X 4 matrix attributes, two 1 X 2 matrix attributes or one 2 X 2 matrix attributes. The values will be rounded to a divisor of the pixel size. This parameter is ignored if CORNVALS is specified.

PIXVAL(--)
Pixel value. The pixel value that will be assigned to all of the points in the output image.

PXVALATR("COLOR")
Pixel value attribute. The attribute name of the field that defines the pixel values that will be used for each of the points in the output image. This parameter is ignored if PIXVAL is specified.

PTIDATR("ID")
Point ID attribute. The attribute name of the field that defines the ID value for each of the points. This id attribute must tie the point to the other attribute values in the labeled table either directly or through the use of the index attribute.

INDEXATR("INDEX")
Index attribute. The attribute name of the field that defines the index numbers for each of the points. If a null values is specified, it is assumed that there is a direct link between the ID attribute values and the other attribute values.

COORSATR("Y","X")
Coordinate attribute. The attribute name of the field that defines the coordinates of the each point. If the coordinates are specified under one attribute, the coordinates must be in the Y/X order.

PRIORATR("PRIORITY")
Priority attribute. The attribute name of the field that defines the priority of a particular point compared to a duplicate point.

PRJPMATR("PPARMS")
Projection parameters attribute. The attribute name of the field that defines the projection parameters. This will not be used if the fifth labeled table is not specified.

PRJCDATR("PCODE")
Projection type attribute. The attribute name of the field that defines the projection code. This will not be used if the fifth labeled table is not specified.

ZONEATR("PZONE")
Zone number attribute. The attribute name of the field that defines the zone number. This will not be used if the fifth labeled table is not specified.

DCODEATR("PDATUM")
Datum code attribute. The attribute name of the field that defines the datum code. This will not be used if the fifth labeled table is not specified.

UNITSATR("UNITS")
Projection measurement units attribute. The attribute name of the field which defines the units of measurement. This will not be used if the fifth labeled table is not specified.

VALIDATR("PVALID")
DDR valid attribute. The attribute name of the valid flag. This will not be used if the fifth labeled table is not specified.

LISTFLG(NO)
List flag. Flag to specify if error messages from range check should be displayed.

 
 = YES: List messages.  Error messages will be 
        displayed if coordinate values do not lie 
        within the output image.
 = NO:  Do not list messages.  Error messages will
        not be displayed if coordinate values are 
        outside the image.

Examples:

  1. LAS> tab2ras-line inlt=in out=out pixsiz=(30,30) cornvals=(1234,1343) nl=512 ns=512 pxvalatr=index ptidatr=id indexatr=index coorsatr=(y,x) seqnoatr=seqence prioratr=priority

    This example creates a 512 X 512 image named OUT. It contains the lines as defined by the attributes Y and X in the labeled table IN. The pixel values of the lines are the index numbers that are associated with the lines. Each line ID has a SEQUENCE and PRIORITY assigned to it through the INDEX attribute. The line work is imposed over a background of zero.

  2. LAS> tab2ras-point inlt=(mask;lt,mask;lt1,mask;lt2) out=mask pixsiz=(10,10) backgrnd=255 cornatr=(ymax,xmin,ymin,xmax) pxvalatr=color ptidatr=id indexatr=-- coorsatr=(y,x) listflg="yes"

    An output image named MASK is created. Its size is calculated from CORNATR and PIXSIZ attribute. It contains points as defined by the attributes Y and X. over and imposed background of 255. The pixel value of each point is defined by the COLOR attribute and is tied to each point id through the ID attribute. Any points that lie outside the image will be reported to the user.

  3. LAS> tab2ras-polygon inlt=nwsnow out=snow pixsiz=(30,30) cornvals=(200000,-200000) nl=1024 ns=1024 pxvalatr=index ptidatr=id indexatr=-- leftatr=lefreg rghtatr=rgtreg coorsatr=(y,x) seqnoatr=seq

    A 1024x1024 image named SNOW is created containing filled polygons. The pixel values of the filled polygon is determined by the LEFREG and RGTREG attributes. These values are tied directly to the line id through the ID attribute.

Description/Algorithm:

SUBCOMMAND -POLYGON

Each of the line segments of the polygons are read from the labeled table file and placed into a temporary file. This temporary file is sorted based on the line id and sequence number of each line segment. This sorted file is then read and the line/sample values for each polygon boundary are calculated from the Y/X coordinate values and placed into another temporary file. This file is sorted based on the line number and sample location. This sorted file is then read as the output image is being created. The filled polygons are created by filling in the specified lines in the correct pixel locations of the output image. The pixel value of a particular polygon will be determined by the value of the attribute specified by LEFTATR or RGHTATR that is associated with the element id designator or by the specified PIXVAL. Unassigned pixels in the LAS image are given a value specified by the parameter BACKGRND.

After the last line of the output image is written, an associated history file is created for the output image and a completion message is displayed.

SUBCOMMAND -LINE

Each of the lines are read from the labeled table file and placed into a temporary file. This temporary file is sorted based on the line id and sequence number of each line segment. This sorted file is then read and the line/sample values are calculated from the Y/X coordinate values and placed into another temporary file. This file is sorted based on the line number, priority value, starting and ending sample location. This sorted file is then read as the output image is being created and the lines are placed in the correct pixel locations of the output image. The pixel value of a particular line will be determined by the value of the attribute specified by PXVALATR that is associated with the line or by the specified PIXVAL. The width of a particular line will be determined by the value of the weight attribute associated with the line. A width of one is one pixel wide, two is two pixels wide, and three is three pixels wide. If a weight of two is specified, the extra pixel is placed on the left side of positively sloped lines and the right slope for negatively sloped lines. Unassigned pixels in the LAS image are given a value specified by the parameter BACKGRND. After the last line of the output image is written, an associated history file is created for the output image and a completion message is displayed.

SUBCOMMAND -POINT

Each of the points are read from the labeled table file and line/sample values are calculated and placed into a temporary file. This file is sorted based on the line number, priority value, and samples location. This sorted file is then read as the output image is being created and the points are placed in the correct pixel locations of the output image. The pixel value of a particular point will be determined by the value of the attribute specified by PXVALATR that is associated with the line or by the specified PIXVAL. Unassigned pixels in the LAS image are given a value specified by the parameter BACKGRND. After the last line of the output image is written, an associated history file is created for the output image and a completion message is displayed.

Nonfatal Error Message:

  1. [tab2ras-warn] Nonfatal error encountered

    A nonfatal error was encountered during processing. The message that is displayed immediately preceding this message is the specific error that was encountered from a library routine. Processing continues.

Fatal Error Messages:

  1. [tab2ras-alloc] Error allocating dynamic memory

    An error occurred while trying to dynamically allocate buffer space. Contact the system manager when this error occurs.

  2. [tab2ras-attribute] Attribute <XXXX> could not be found

    The attribute <XXXX> was not found in the main labeled table file or any of its subfiles. Respecify the attribute name.

  3. [tab2ras-fatal] Fatal error encountered

    A fatal error was encountered during processing. The error message that is displayed immediately preceding this message is the specific error that was encountered.

  4. [tab2ras-open] Error opening <xxxxx> file

    An error occurred opening one of the temporary files. Contact the system manager when this error occurs.

  5. [tab2ras-empty] No vector data occurs in the output image

    No vector data lies within the image so no output image is created. Rerun with LISTFLG="YES" or respecify the corner coordinates.

  6. [tab2ras-nl] NL must be specified

    NL must be specified if CORNVALS is specified.

  7. [tab2ras-ns] NS must be specified

    NL must be specified if CORNVALS is specified.

  8. [tab2ras-pixel1] Either PIXVAL or PXVALATR must be specified

    One of these parameters must be specified to set the pixel value of the vector data.

  9. [tab2ras-corn] Either CORNVALS or CORNATR must be specified

    One of these parameters must be specified to set the corner coordinates of the image.

  10. [tab2ras-idcorr] Attribute <XXXX> could not be found in the coordinate file

    The specified attribute must be in the same file as the coordinate values.

  11. [tab2ras-index] Attribute <XXXX> could not be found in the same file as <XXXX>

    The index and id values must be in the same file in order to provide a link between the id and the primary attributes.

  12. [tab2ras-system] System file sort failed

    An error occurred sorting a temporary file. Set the environment variable DATAPATH to a disk with enough free space for the temporary file.

  13. [tab2ras-pixel2] Either PIXVAL or LEFTATR and RGHTATR must be specified

    One of these parameters must be specified to set the pixel value of the vector data.

  14. [tab2ras-nl] NL must be greater than zero

    Parameter NL must be a positive number and cannot be equal zero.

  15. [tab2ras-ns] NS must be greater than zero

    Parameter NS must be a positive number and cannot be equal to zero.

User notes:

  1. Related functions include RAS2TAB and other labeled table routines.

  2. TAB2RAS makes some assumptions about the organization of the labeled table files and subfiles. It is assumed that the Y,X locations of the features are linked to the specific attributes(color, weight, priority, left or right region) by either the ID or INDEX attribute. The labeled table that contains the Y,X locations is assumed to be the first labeled table file entered. It is also expected that when the fifth labeled table file is entered that all the projection attributes will come from there.
  3. When specifying the upper left corner coordinates, the maximum Y value and minimum X value should be used.

  4. Unexpected file read errors will occur if there wasn't at least two points for each line segment.

  5. The attribute that specifies the ID must be in the same file or subfile as the file that specifies the coordinate (Y/X) values.

  6. If a DATAPATH is specified, the path with the most available disk space will be chosen. As it is not known how much disk space will be required, this disk space will not be reserved, and may cause problems if there is little space available and another program attempts to access the same disk space.