-
TiraVec: Rasterize vector files
Access this help text as a web page: TiraVec
Presentation
This application takes a vector point file, a line/arc file, a polygon ornode file (whether structured or not) and rasterizes it using an existing ornew raster.
Although the application supports all MiraMon vector formats it isrecommended that structured formats are used in the case of polygon filessince these allow holes within polygons and are free of overlapping polygons(except for any non topological groups that they may contain). Moreover thestructured vector formats allow linking to a database, which in turn allowsa greater degree of control over the raster attributes and the automaticgeneration of categories. If an unstructured polygon files is rasterizedthen where superpositions occur the value of the last polygon prevails.
Based on MiraMon structured vector files, the application supports therasterization of many types of field attributes: Numeric ('N'),Logical ('L'), Character ('C') or Date ('D'). Fornumeric ('N') fields the numeric value is rasterized directly,whilst for logical ('L') fields the raster contains 1 for true and 0for false. In this case TiraVec allows the user to indicate another field(numeric, alphanumeric, date, ...) for defining the raster category.Similarly, if the field for rasterizing is Character ('C') or Date('D') type then the application automatically generates a numericalindex which is rasterized as the raster value and these raster categoriesare documented with their equivalent alphanumeric attributes.
Based on unstructured vectors the application supports "integer"(long), "real" or "string" vector attributes. For"integer" and "real" type attributes only thoseattributes that are, or can be, transformed into numbers are rasterized. For"string" type attributes the application can also automaticallygenerate a numerical index which corresponds to a description of the rastercategories, as described above for structured vectors.
Apart from the different mentioned vector formats, this application also allows the rasterization of a TIN model (Triangulated Irregular Network). In this case, the input file should be a structured polygons file where each polygon must be triangular and every vertex of the polygons must have a Z value. To rasterize this layer, an interpolated Z value will be assigned to every cell from the three vertices of the polygon where the cell is contained.
TiraVec can raster over MiraMon raster files, that is "bit","byte", "integer", "long" and "real"formats, as well as over the compressed formats "byte-RLE","integer-RLE", "long-RLE" and"real-RLE".
Should the numerical value fall outside the range of allowed values for theraster image then it is possible to choose between saturating the maximum orminimum value, or eliminating the value as out of range. The following arethe allowed values for each type of raster, whether RLE type ordecompressed:
- bit: rasterizes as 1 unless the attribute is 0.
- byte: rounds off and rasterizes if 0 <= attribute <= 255.
- integer: rounds off and rasterizes if -32768 <= attribute <= 32767.
- long: rounds off and rasterizes if -2147483648 <= attribute <= 2147483647
- real: rasterizes the value.
In the case of structured polygons the zero polygon (or the universalpolygon that encloses all the rest) is not rasterized.
If the category definition field is set and there already existedpredefined categories then the category definition in the DOC file will be:'Nueva' / 'Vieja' (New/Old). It should be rememberedthat "real" type raster files do no support categories.
In cases where the REL vector file describes the units (REL v4 or above),this is appropriately documented in the documentation of the resultingraster file. If this is not the case, the name of the field used fordefining categories is placed as 'value units' in the DOC file ofthe raster or, if this is not available, the name of the rasterizedfield.
For the case of polygon files there are two basic criteria forrasterization: based on area, based on the central point; and acombination.
The first assigns to the cell the value to the category that occupies mostof its area; this is approximated by examining a horizontal line crossingthe cell. The second criterion simply assigns the value to the cell of thecategory that is found at its centre, without considering the fraction ofthe area of the cell that this category represents.
In the case of a TIN, the criterion of the center point will be used by default.
Sometimes, when we rasterize isolated polygons thinner than a pixel on aNODATA background, any criteria explained before is good enough in the normalmode. In this case, it is useful to combine them with the polygons as apolygons with border mode.
- The central point criterion (2) is less precise but completelyguarantees the spatial contiguity. It is also faster.
- The area criterion (1), although more precise, does not completelyguarantee contiguity between adjacent polygons at the nodes where 3 ormore polygons converge.
For this latter reason there exists a criterion that combines 1 and 2 inwhich 1 is used as the basic criterion, and 2 is used solely to fill inthose cells that have been left with the background value and to fix anypossible discontinuities. This is the recommended option if theraster is newly created or if a background value has been defined.
Nevertheless, the central point criterion with background value('2' and background parameter) is recommended for filling continuitygaps that are left when generating files using the area criterion, but itmay also have other applications.
For line files, there are three criteria (1, 2 and 4):
- Method 1 rasterizes with more precision in the areas around vertices,so it is the preferred option for short lines and for large celledrasters. It is the recommended method if the user wants thin linesof one cell width. It processes the coordinates as real numbers.
- The second method rasterizes accurately the sections between verticesbut can lead to significant geographic errors close to the vertices (cellsmay be affected although the line does not cross them and vice versa). Itis the process that is usually used in image processing applications. Ituses cell centre coordinates directly. This option is not recommended asit is less accurate than the previous option.
- Method 4 is essentially different to the previous two given that itdoes not minimize the number of cells affected but rather it rasterizes,using real coordinates, all the cells that are crossed by the geometrictrace of the vector. It is the method that should be chosen if the userwishes to rasterize all the cells affected by a line even those that areonly cut at the corners.
For point files the raster cell for each point is simply that cell in which the point falls.
This application includes and augments the functions of the applications TiraLin and TiraPol that are no longer included in MiraMon version 4.
Dialog box of the application
Syntax
Syntax:
- TiraVec RastCrit VecFile InputRaster OutRas Mode SatCrit BackVal [/TIPUS_DADA] [/XMIN] [/XMAX] [/YMIN] [/YMAX] [/COSTAT] [/TAULA] [/CAMP] [/TAULA_CAT] [/CAMP_CAT] [/TAULA_VORA] [/CAMP_VORA] [/VALOR_CONSTANT_VORA] [/REPE] [/OPERADOR] [/VALOR] [/VALOR_CONSTANT] [/3D] [/TIPUS_RASTER] [/EXAGERACIO] [/NOMES_POLIGON_0]
Parameters:
- RastCrit
(Rasterization criteria. -
Input parameter): The meaning of this parameter depends on whether polygons, lines or points are to be rasterized.
- For polygons it represents the polygon limits criterion:
- '1' Each cell is rasterized if the polygon occupies more than half its area (estimated from the horizontal profile across its centre).
- ' '2' Each cell is rasterized only if the central point of the cell falls inside the polygon.
- '3' Criterion '1' is first applied and then criterion '2', but only over the background value.
- VecFile
(Vector file -
Input parameter): Vector file for rasterization, with extension.
- InputRaster
(Input raster -
Input parameter): Image over which the rasterization is begun. If you want to rasterize in a new file, you must indicate '*' and you must indicate the additional parameter /COSTAT=. It is also possible to enter the extents and the type of data for the output raster: /XMIN=, /XMAX=, /YMIN=, /YMAX= and /TIPUS_DADA=. If the extents are not entered they are taken automatically from the vector file. The possible values for /TIPUS_DADA= are: "bit", "byte", "integer", "long", "real", "byte-RLE", "integer-RLE", "long-RLE" and "real-RLE". If /TIPUS_DADA= is not set or it is set to "auto", the program determines the optimum type of output data that will allow all the vector values to be rasterized without producing saturation. When no input raster is entered the program rasterizes over a file that is initialized to the background value.
- OutRas
(Output raster file -
Output parameter): The output raster file. It may not exist or it may be the same file as RasOri.
- Mode (Input parameter): takes into account:
- '0' normal mode: polygons as polygons, arcs and lines as lines, points and nodes as points.
- '1' polygons as lines or lines as points.
- '2' polygons as points (rasterizes the vertices).
- '3' polygons as a polygons with border.
- '4' TIN model.
- SatCrit
(Saturation criterion -
Input parameter): Saturation criterion:
- '0' Vectors with attributes outside the permitted range of the raster are ignored.
- ' '1' No vectors are ignored, the saturated value is set when outside the range.
.
- BackVal
(Background value -
Input parameter):
- '0' Rasterize over the previous values of the image.
- '1' Rasterize only over the background value.
Modifiers:
/TIPUS_DADA=
(Data type)
Data type of the output file. If this parameter is not specified or set to "auto", the program determines the optimal output data type that allows all values in the vector to be rasterized without causing saturation. When no input raster is specified, the program rasterizes over a file initialized to the background value. (Input parameter) /XMIN=
(Minimum X)
Minimum X of the extents of the raster output file when there is no input raster file. If this is not set then the vector extents are used. If there is an input raster file then these extents cannot be set. (Input parameter) /XMAX=
(Maximum X)
Maximum X of the extents of the raster output file when there is no input raster file. If this is not set then the vector extents are used. If there is an input raster file then these extents cannot be set. (Input parameter) /YMIN=
(Minimum Y)
Minimum Y of the extents of the raster output file when there is no input raster file. If this is not set then the vector extents are used. If there is an input raster file then these extents cannot be set. (Input parameter) /YMAX=
(Maximum Y)
Maximum Y of the extents of the raster output file when there is no input raster file. If this is not set then the vector extents are used. If there is an input raster file then these extents cannot be set. (Input parameter) /COSTAT=
(Cell size)
Is the raster cell size. This must be set if there is no input raster. (Input parameter) /TAULA=
(Table selection)
If the values to be rasterized are from a database field, the selection criteria database table is indicated. In REL1, it is required for structured files. To learn more about the values of these parameters, follow the considerations in the general syntax document. (Input parameter) /CAMP=
(Field)
The selection criteria database field of the table is indicated. In REL1, it is required for structured files. To learn more about the values of these parameters, follow the considerations in the general syntax document. (Input parameter) /TAULA_CAT=
(Category table)
If you want to get a categorical output raster, indicate the table where the categories are stored. (Input parameter) /CAMP_CAT=
(Category field)
If the values to be rasterized are from a database field, if you want to get a categorical output raster, indicate the table field where the categories are stored. (Input parameter) /TAULA_VORA=
(Table for rasterizing the borders)
For the polygons mode as bordered polygons, indicate the table of the selected database to rasterize polygon borders. (Input parameter) /CAMP_VORA=
(Field to rasterize the borders)
For the polygons mode as bordered polygons, indicates the field in the selected database table to rasterize the borders of the polygon. (Input parameter) /VALOR_CONSTANT_VORA=
(Constant value of the border)
For the polygons mode as bordered polygons, the edge of the polygon is rasterized with the specified constant value. (Input parameter) /REPE=
(Record selected)
If the values to be rasterized are from a database field, indicates which record is chosen when there is more than one record for a graphic identifier (multiple record). To learn more about the values of this parameter, follow the considerations in the general syntax document. (Input parameter) /OPERADOR=
(Operator)
If the values to be rasterized are from a database field, it changes the way the program works based on its value. For fields of type 'N' (or VEC's of type "integer" or "real") the default value is NONE. For fields of type 'C', 'D' or 'L' (or VEC's of type "string") the default value is TRACTAR_C_COM_N, which indicates that the cell value is converted to numeric and when this is possible the element is rasterized. For fields of type 'C', 'D' or 'L' (or VEC's of type "string") you can specify PROJECT_CAMP to automatically generate a numeric index and use the field values ??to define the categories. You can generate a raster mask of the polygons with value equal to one of specified concrete EQ or different from one specified concrete NO_EQ; then, you must indicate the value to compare with /VALUE=. For structured polygon files polygon 0 is never rasterized; you can specify NOMES_POLIGON_0 to rasterize a mask with values 0 on polygon 0 and 1 on all other polygons (ie a mask of the holes in polygon 0). (Input parameter) /VALOR=
(Value to compare)
If the values to be rasterized are from a database field, value to compare if an operator has been specified. (Input parameter) /VALOR_CONSTANT=
(Constant value)
If the values to be rasterized are from a database field, the indicated constant value will be rasterized. (Input parameter) /3D=
(Height value.)
If the values to be rasterized are from a database field, height in the 3d information stored on the binary vectorial file will be rasterized. (Input parameter) /TIPUS_RASTER=
(Raster data type)
Is the type of raster file for the output raster when there is no input raster. (Input parameter) /EXAGERACIO=
(Exaggeration or thickness value)
Is the exaggeration or thickness. Now, applies to points only. It allow you rasterize points as a squares of a certain size. The exaggeration is in map units and is applied in both directions and is modified by the pixel size. So, The size of the square that represents a point is approximately the double of the exaggeration rounded to the nearest multiple of the pixel size. (Input parameter) /NOMES_POLIGON_0
(0 polygon mask)
For structured polygon files, if you want to rasterize a mask with values 0 on polygon 0 and 1 on all other polygons (ie a mask of the holes on polygon 0). (Input parameter)