Classify Polygons Operation

On this page, you will find general help for the ProRaster product family including links to documentation, instructional videos, and training videos.
Previous Topic: Classify Raster Operation
Next Topic: Clip to Polygon Operation
Back to: ProRaster Scientific Help
Back to: ProRaster Help
Back to: ProRaster
Go to: ProRaster Essential help page, ProRaster Premium help page, ProRaster Scientific help page.
The ProRaster User Guide is available for download as a PDF.

Watch this video on YouTube to learn how to use this processing operation. Use the chapter indexing to skip to the detail you need.

A classified raster field contains an “Index” band which contains a zero-based unsigned integer index value for each cell. This index maps directly to the row number of a class table. The class table may contain any number of rows and columns. Each column has a particular data type – for example it may contain a color type like RGB or a text string. The raster engine presents the Index band and all the columns in the class table as raster bands which you are free to render or use in processing operations, just like any other kind of data band. Note that bands in classified fields are never interpolated – nearest neighbour is always used. 

The Classify (Polygons) operation will convert an existing polygon database in MapInfo Table format into a classified raster that is written in MRR format. Unlike most other operations, this operation does not produce a virtual raster output. It outputs directly to a physical raster on disk. 

The operation is capable of processing extremely large and complex polygon table inputs, and of generating extremely large, high-resolution raster outputs. The goal is to provide an alternative raster dataset for visualisation and querying that can outperform the same operations on the original polygon dataset by orders of magnitude. 

A GIS table is a spreadsheet-style database. The table can contain multiple columns containing data in a wide variety of formats (text, integer, date-time, etc). Each record in the table will contain a value for each column in the table. In addition to this data, it will contain a geometry object and a style object. The geometry object will contain some variety of geometry primitive – a point, line, or polygon for example. It may contain one or more polygons, and each can be a complex polygon containing multiple parts (holes and islands). In rare cases, a record may contain a collection of different geometry objects. Each record will also contain a style object which describes how to render the geometry object. For example, this might contain line styles or brush styles. 

In this processing operation, the input GIS table can be copied to the output classification table in totality. All data will be preserved, where possible. The operation will determine which polygon each raster cell lies in and link that cell back to the appropriate record in the table. By default, the “point in polygon” test is made for the point at the centre of the raster cell, and if the point is found to lie in multiple polygons it will choose one of them in no defined order.

Simple Convert

 To convert a GIS Table to a Classified Raster, simply specify the input table file name, the output raster file name, and the output raster cell size. 

When you browse to the GIS Table its structure will be acquired and the names of all the columns in the table are presented in a list. By default, the style object in each record will be used to define the color for that class. 

Enter the cell size (width and height) for the output raster. You can specify this as a decimal number or as a fractional number (numerator/denominator). When working with very large rasters it is a good idea to specify coordinates and distances using fractions. Internally, ProRaster will use fractional mathematics, and this can avoid round-off errors that are unavoidable with decimal numbers. For example, to specify a cell size of one arcsecond (about 30 metres) use the fraction 1/3600. To specify a cell size of 0.01 metres, use a fraction of 1/100. When you enter the width, the height is automatically populated with the same data. 

You can also enter the origin coordinate of the output raster but in the ProRaster system this is not necessary. In ProRaster, the origin coordinate is not the bottom left corner of the raster – it is a coordinate that specifies the centre of the tiling system. It does not limit the extent or location of the raster cells in any way. You are free to set it to a reasonable value, but it won’t matter if you don’t. However, the origin coordinate is critical to cell alignment. Cells will always lie an integer number of cell width/height distances from the origin coordinate. 

Column Selection

You can restrict the number of columns in the output raster by removing them from the column list. Select the column in the list, then hit the “Remove selected column” button at the top right corner. If you make a mistake, just hit the “Reset column list to default” button to restart.

Column Class Type

Columns in the class table can be marked with a special class type. These special types are Class, Value, Data, Label, Color, Red, Green, and Blue. Assigning a special class type to a column in the table tells ProRaster that that column ought to be used for a particular purpose. For example, the “Label” column will be used in the cell value tooltip when you move your cursor over the raster. The “Color” column (or “Red”, “Green”, and “Blue” columns) will be used to render the raster. 

  • The ”Class” type column contains the original class value, which may be different to the zero-based class index assigned in the raster.
  • The “Value” type column contains the primary data value for the class.
  • The “Data” type columns contain any data. You can assign multiple columns to this class type.
  • The “Label” type column contains the text label most appropriate for the class.
  • The “Color” type column contains an RGB color value for the class.
  • The “Red”, “Green”, and “Blue” type columns contain an 8-bit (0- 255) color for the class. 

By default, the style object column will be used to acquire the “Color”. To assign or reassign a class type to a column, select the column in the list, then select the class type from the drop list. Only the “Data” class can be assigned to more than one column. 

Grouping

Instead of outputting a class for every record in the table, you can group multiple records together. In this scenario, only the values in the table for the first record in the group are retained and the class table in the raster will contain fewer records than the original GIS table. However, the polygons for all records are still processed and assigned to the appropriate group. 

To group records together, assign the column class type appropriately as described above. Then, choose to group by selecting the column class type to target. For example, you could choose to group by “Label”. All the records that have the same text label will be assigned to the same group. It can be convenient to use the “Value” class type to target a column in the table on which to group. 

Querying

You can execute a simple SQL query to select only certain records from the table, thus limiting the output. For example, if you have a table that contains property boundaries and a column identifying the LGA for each property, then you can query the table to select all properties that are within a specified local government area. The output raster will only contain cells that intersect the properties in that LGA. 

To specify a query, check the “Query…” box then select the column to target. When you select a column, the GIS table is then queried to find all unique values in that column. You can then select a value. In effect, you will execute an SQL query of the form – “SELECT * FROM <table> WHERE <column>=’<value>’”. 

If you wish to use more complex SQL queries, you will have to do that using your GIS software prior to running the processing operation.

High-Resolution Rasters

 This operation is very efficient and can generate very high-resolution rasters. As you decrease the cell size, you must expect the output raster file size to increase. However, classified rasters can be very efficiently compressed so the raster file size does not increase linearly. 

Finally, give your computer room to chew on this problem. Whilst running, you can expect the operation to consume 100% of your CPU resources!