-
MicroPol: Erase polygons and micropolygons of a polygon or categorical raster layer
Access this help text as a web page: MicroPol
Presentation and options
This application allows three options to eliminate micropolygons:
Option 1 (Vectorial local):
This option makes a study of each local micropolygon without considering that may be in contact with other micropolygons. To remove micropolygons, the application only removes one of the arches that makes border. The application eliminates the longest arc or arc bordering the largest polygon, as a parameter. However, the polygon 0 (or zero polygon: outer border) is an exception to these criteria because it presupposes that in general the boundary of the polygon 0 is better defined. This is especially important in the polygon files that come from a map series and the border polygon 0 is usually a rectangle or a trapezoid and it is desirable that the sides are no longer straight. That is why the application only removes an arc bordering the polygon 0 if it is the only way to eliminate the micropolygon. However, when removing micropolygons end nodes and arcs with halters are generated in complex cases. These structures are not cyclable and are removed automatically. This forces the application to eliminate some extra boundary arcs..
Option 2 (Vectorial global):
The second option generates a study of the layer removing micropolygons starting with the smallest of all and progressing until there are no polygons with a smaller area than indicated. Furthermore, this mode performs a previous analysis of polygons with narrow areas. These narrow zones are truncated in new polygons to be removed later if they become small polygons. It also incorporates a thematic affinities table that allows prioritizing to merge certain categories when the micropolygon is in contact with more than one adjacent polygon, allowing the micropolygon to be merged into a class that makes more thematically sense. In case of a tie it also uses the longest border or largest area criteria to determine in which adjacent polygon it will be absorbed. The merger removes all arcs of contact between the two polygons to be merged. The attributes of the arcs are always recovered to multiple record of the greater polygon. It also keeps the area occupied by each attribute before merging polygons. Finally a revision is made that, by default, merges polygons that have the first same attribute. This behavior can be changed in the /RESPECTAR_1_REG parameter that prevents merging a monorecord polygon with another multirecord polygon, or with the /RESPECTAR_N_REG parameter that prevents merging polygons that have not exactly the same thematic attributes in multirecord fields.
Option 3 (Raster):
This option removes groups of cells present in a categorical raster (for example, a map of the ground cover) and assimilate them to the most abundant category in an immediate environment of 3x3 cells, 5x5 cells, etc.
POLYGON CASE
One of the characteristics of a topologically structured graphical database is that it fully describes the space within it, thus providing complete information, in both geometric and thematic terms, about each of the graphical elements (polygons) that constitute it. Sometimes a polygon database can contain thematic "holes", that is polygons that have no thematic attribute assigned to them and that should be displayed as "transparent" and ignored thematically (not consulted); this could be the case, for example, of the area within an atoll in the middle of an ocean. Such a situation is perfectly correct and is supported by MiraMon. However, this is not the most common situation, and often the occurrence of polygons without thematic labels is due simply to lack of care or perhaps to the existence of small areas resulting from inaccuracies and errors in the graphical database.
In the first case, when the lack of attributes is due to a lack of care, a simple attribute-based query in MiraMon, requesting those elements whose attributes are blank, and whose area is reasonably large would allow their visual identification. Such polygons are easily identified by selecting the option to leave polygons without attributes transparent (not filled in) in the Advanced... display option. Once identified the polygons are given labels and the problem is resolved.
In the second case, however, the polygons are usually very small and are known as micropolygons, or sliver polygons. This application tries to help detecting and eliminating these micropolygons, a task that is frequently extremely tedious since in some circumstances very many such polygons can occur. In fact, if certain basic rules are followed when generating maps, such as the use of connectivity tools (Edit|Connect upon previous vector in MiraMon), micropolygons practically never appear, but when these rules are not followed, or when files from different sources are imported into the system (specially from a CAD program, or from formats without topology, like SHP), then it will perhaps be necessary to apply this filter.
This application allows erasing micropolygons that meet a series of conditions. Generally, a micropolygon is a small object, sometimes longs and, often, without a themed layer. Therefore, it presents a small area, a small area/perimeter ratio (big perimeter and small area) and has not been labelled. This application incorporates these three criteria and an additional one to be allowed to mark a polygon as erasable through a logical field of the main polygons database.
MicroPol generates a new layer of polygons by selecting the necessary arcs from the original arcs database, which remains unaltered. Once the application has been run it is possible that the arcs database could also be filtered, keeping only the necessary arcs to sustain the polygon borders. This operation can be performed with the Emancipa application.
Affinity file format
The affinity table, only necessary in highly professional micropolygon erasing applications, is a DBF table with the following structure:
- [NOM_CAMP1]: it coincides with a field name of the polygon file. Its content are the field values of the micropolygons to erase.
- [NOM_CAMP#]: it coincides with the umpteenth field name.
- ...
- ABSOR1: this field, with a fixed name, contains the field values of the main table with name NOM_CAMP1 of the polygons it absorbs.
- ABSOR#: same for the umpteenth field. The number of fields of this incremental name is the same as the number of free names fields from the beginning of the table.
- ...
- PRIORITAT: is the priority index of this attribute combination. High values represent high affinity. The syntax parameter /AFIN_ORDRE allows inverting this interpretation. It is possible to assign the same value to several combinations.
It is important to note that this scheme allows defining asymmetrical priorities, i.e., if the value of micropolygons A is absorbed with B with priority 1, a micropolygon of B value can be absorbed in an A value polygon with priority 15 or not even having an assigned priority (non-present combination in the table).
RASTER CASE
This mode allows to eliminate groups of few cells present in a categorical raster (for example a map of soil cover) and assimilate them to the most abundant category in an immediate environment (3x3 cells, 5x5 cells, etc).
Internally, the application performs a vectorization of the input categorical raster, taking into account the presence or not of the parameter Ignorar_veins_diagonal and then re-rasterizes it but converts to a different value all the existing values in the raster (including the NoData) in all those polygons that have an area in cells less than or equal to Area_max. Once created this new raster that contains a new "flag" value for all the raster polygons with an area considered micropolygons, it is performed an execution equivalent to FagoVal application with a convolution window of value Fin_convol, with a mode criterion iterating to the maximum possible, avoiding the assignment to NoData both when eliminating an isolated value and when the NoData is the majority in the convolution window and without a minimum modal value to replace the central value of the convolution window.
It is important to note that mode 3 is different to vector modes options because in mode 3 the neighborhood analyzed is immediate, at a distance of 1 cell (if Fin_convol is 3), of two cells (if Fin_convol is 5), etc. On the other hand, in vector modes, the criterion is different (the largest area of the entire polygon in contact with the micropolygons). For eliminating the micropolygons of a raster with the same criteria as in a vector layer of polygons, the raster has to be vectorized with RasTop and continue from the base of polygons obtained.
More information can be consulted at the following reference:
Burriel JA, Ibáñez JJ, Masó J (2008) SIOSE en Cataluña: obtención a partir del Mapa de Cubiertas del Suelo de Cataluña. Hernández L, Parreño JM (eds.) Tecnologías de la Información Geográfica para el desarrollo territorial. Servicio de Publicaciones y Difusión Científica de la ULPGC. Las Palmas de Gran Canaria. Pp. 876-889. ISBN: 978-84-96971-53-0. XIII Congreso Nacional de Tecnologías de la Información Geográfica. Las Palmas de Gran Canaria.
Dialog box of the application
Syntax
Syntax:
- MicroPol 1 PolOriginFile OutputPolFile [/FONDRE] [/AREA_MIN] [/AREA_PERI_MIN] [/SENSE_ATRIBUT] [/CAMP_LOGIC] [/NEXE_CRITERIS] [/TAULA_LOGIC_ARC] [/CAMP_LOGIC_ARC] [/ATRIB_ELIM] [/EMANCIPA]
- MicroPol 2 PolOriginFile OutputPolFile MinArea WidthMin PartialArea [/FONDRE] [/FITXER_AFIN] [/AFIN_ORDRE] [/DESCARTA_POL_0] [/DESCARTA_POL_LLINDA_AMB_0] [/FONDRE_PER_ARC_ESTRET] [/sufix _ARC_POL_0] [/CAMP_TEMATIC] [/CAMP_TEMATIC_QUALITAT] [/CAMP_AREA_TPERCENT] [/TPERCENT_AREA_MIN] [/RESPECTAR_1_REG] [/RESPECTAR_N_REG] [/COEF_ESTRET] [/FITXER_EXCEP_MIDES] [/_ARC_PROTEGIT] [/FITXER_ARCS_A_AFEGIR] [/EMANCIPA]
- MicroPol 3 InputIMGfile OutputIMGFile Area_max Fin_convol [/IGNORAR_VEINS_DIAG]
Options:
- 1:
This option makes a study of each local micropolygon without considering that may be in contact with other micropolygons.
- 2:
The second option generates a study of the layer removing micropolygons starting with the smallest of all and there is no progress until polygon area smaller than indicated.
- 3:
This option removes groups of cells present in a categorical raster of an area smaller than the number of cells indicated by the user.
Parameters:
- PolOriginFile
(Origin polygon file -
Input parameter): It is the name of the polygon file to process.
- OutputPolFile
(Output polygon file -
Output parameter): It is the name of the polygon file resulting from the process of eliminating micropolygons (the files PolOriginFile and OutputPolFile cannot be the same).
- MinArea
(Minimum area -
Input parameter): It is the minimum area below which the polygons must disappear.
- WidthMin
(Minimum width -
Input parameter): Minimum width of a polygon area under which the polygon breaks into a totally narrower fragment than the stated width. This fragment will be erased if it shows a smaller area than AreaMin.
- PartialArea
(Partial area -
Input parameter): It is the field name that contains or it is desired to contain the partial area of each record of the resulting polygons in case that it shows multiple records. This field allows knowing the occupied area by each record before the micropolygon fusion. In the case that this field does not exist, the application will create it.
- InputIMGfile
(Input raster file -
Input parameter): It is the categorical raster file name to process.
- OutputIMGFile
(Output raster file -
Output parameter): It is the name of the output categoric raster file from the process of removing micropolygons. It must be a different file than the origin file.
- Area_max
(Maximum area to be deleted in cells -
Input parameter): Indicates which maximum area in cells [or pixels] will be deleted. For example, if 1 is written (the smallest admitted value) isolated cells will be deleted, if 2 is written both isolated cells and groups of 2 adjacent cells will be deleted, etc.
- Fin_convol
(Convolution window -
Input parameter): Convolution window side. It must be an odd number, typically 3 or 5. Equivalent to the homonymous parameter of the FagoVal application.
Modifiers:
/AREA_MIN=
(Minimum area)
Value of the minimum area that a polygon can have. (Input parameter) /AREA_PERI_MIN=
(Area/Perimeter)
Minimum area/perimeter ratio value. (Input parameter) /SENSE_ATRIBUT
(Without attributes)
Indicates that polygons without thematic attributes should be deleted. (Input parameter) /CAMP_LOGIC=
(Logical field)
Corresponds to the logical field that indicates whether a polygon should be deleted. This should be a logical field (L). In each record of the polygon principal table, 'true' is shown if the polygon is to be deleted, and 'false' if it is to be preserved. To learn more about the values of these parameters follow the considerations in general syntax. (Input parameter) /NEXE_CRITERIS=
(Criteria nexus)
Indicate 'OR' if it is only necessary to satisfy one of the criteria in order to delete a polygon. The default value is 'AND', which means that all the criteria should be satisfied at the same time. (Input parameter) /TAULA_LOGIC_ARC=
(Logical arcs table)
Table that contains the logical field from the arc database with 'true' to stablish the arcs that can be eliminated in case of becoming micropolygon boundary. When this parameter is missing, all arcs can be eliminated. To learn more about the values of this parameter the considerations in general syntax can be followed. (Input parameter) /CAMP_LOGIC_ARC=
(Logical arcs field)
logical field from the arc database with 'true' to stablish the arcs that can be eliminated in case of becoming micropolygon boundary. When this parameter is missing, all arcs can be eliminated. To learn more about the values of this parameter the considerations in general syntax can be followed. (Input parameter) /ATRIB_ELIM
(Inherits attributes)
Indicates that the polygon that absorbs the micropolygon inherits its attributes. If this parameter is missing then the attributes of the micropolygon will be lost. It must be noted that there is no need to state which is the field or fields that define if the polygon has attributes: it is considered that the polygon has no attributes if all non-geometrical-topological fields are empty, in exception of, indeed, CAMP_LOGIC_ARC, if this criterion is also activated. (Input parameter) /FONDRE= (Melt) Indicates to which neighboring polygon the area occupied by the micropolygon should be assigned. Select one of these values: - POL_GRAN to assign the space to the biggest neighbor.
- FRONTERA_MES_LLARGA so that the longest arc of the disappearing micropolygons is eliminated. It is the default value.
- POL_PETIT to assign the space to the contiguous polygon with a smaller area. It groups small polygons among themselves (option 2 only).
- FRONTERA_MES_CURTA to erase the smallest arc from the disappearing micropolygon. (option 2 only).
(Input parameter) /FITXER_AFIN=
(Affinities file)
It is the DBF file that defines the affinities between thematic attributes. This file must have, at least, 3 fields, with names:- The field coinciding with the name of the thematic field of the polygon main table to consider its affinity with neighbors. More than one field can be included if required.
- ABSOR1 field including the thematic field values neighboring to the considered polygon. More than one field can be included (ABSOR2, ABSOR3, etc) if required.
- PRIORIDAD field containing a numerical indicator of the priority (or order) by which the correspondence value of the aforementioned fields is applied.
. (Input parameter) /AFIN_ORDRE
(Affinities order)
If this parameter is stated, it assumes that a smaller number in the PRIORIDAD field of the affinity table has a higher affinity than a higher number. In its absence it is assumed that a higher number represents a higher affinity. (Input parameter) /DESCARTA_POL_0
(Discard outside polygon)
Indicates that the outside polygon will not be modified. (Input parameter) /DESCARTA_POL_LLINDA_AMB_0
(Discard outer edge polygons)
Indicates that any polygon that is in contact directly with polygon 0, will not be merged. (Input parameter) /FONDRE_PER_ARC_ESTRET
(Narrow arc merge)
The application tries to avoid merging polygons by an arc considered narrow, leaving this as the last alternative. If this parameter is indicated narrow arcs are considered equal to others for merging polygons unless the arches have been created during the polygon fragmentation. (Input parameter) /sufix _ARC_POL_0
(Parameters selection of graphical objects)
Parameters of graphical objects selection by attributes of the database with the suffix _ARC_POL_0 arcs. Refine behavior /DESCARTA_POL_LLINDA_AMB_0 to polygons bordering the polygon 0 from arcs that fulfill the conditions specified for the base data arches. This option is typically useful for eliminating micropolygons bordering coastlines but keep waiting a mosaic with an adjacent sheet with polygons in contact with the edge of a map sheet. For more information about the specific syntax see here. (Input parameter) /CAMP_TEMATIC=
(Thematic field)
Indicates which field of polygons database will be used to determine the thematic equality between polygons. By default, ALL thematic areas are considered to determine thematic equality between polygons and attributes to merge. To learn more about the values of these parameters the general considerations of the document of the general syntax can be followed. (Input parameter) /CAMP_TEMATIC_QUALITAT=
(Quality thematic field)
Indicates the thematic field of the polygons database on which the quality of generalization about the field will be studied. This study is stored in an HTML file with the same name as the destination file but with the .htm. extension. If this parameter is not indicated, the application does not carry out the study. (Input parameter) /CAMP_AREA_TPERCENT
(Percentage field)
In addition to the partial area, it indicates that a field with the percentage of covering for each record of any multirecord of the main attributes of the table is added. (Input parameter) /TPERCENT_AREA_MIN=
(Minimum percentage area)
Indicates not to keep a record with partial area percentage minor to this value. The proportion of partial area lost is distributed among the other records that exceed this threshold. If all the records have a partial area smaller than the one indicated, only the one with the largest area will be preserved. (Input parameter) /RESPECTAR_1_REG
(Respect a record)
Indicates that the application tries to preserve as much as possible the monorecords. So, it avoids to merge multirecords polygons with monorecords polygons so it only will merge polygons where both have monorecord or polygons where both have multirecord. (Input parameter) /RESPECTAR_N_REG
(Respect N record)
Indicates that the application will try to preserve multirecord as much as possible. So, it will avoid merging multirecord polygons with different multirecord attributes. (Input parameter) /COEF_ESTRET=
(Narrow coefficient)
In the case of the removal of fragments of narrow objects, it indicates the approximate ratio between the minimum width and the minimum length necessary to remove the object. 1 to remove all fragments of narrow polygons. For example 20, the narrow object has to be ample_min*20 long to be removed. The default value is 3. (Input parameter) /FITXER_EXCEP_MIDES=
(DBF file)
DBF file for exception of AreaMin and AmpleMin parameters. It only has to be used if the parameter /FITXER_AFIN= is also indicated (an empty table has to be created to define any affinity). This file must have at least 3 fields:- The field that matches the name of the subject field of the main table of polygons to consider. More than one field can be included if required but the number of fields must match the table affinities.
- AREAMIN field that contains the value of the minimum area threshold to this category or white to indicate that it is necessary to use the general value specified in the AreaMin compulsory parameter.
- AMPLEMIN that contains the value of the minimum width threshold to this category or white to indicate that it is necessary to use the general value specified in the AmpleMin compulsory parameter.
(Input parameter) /_ARC_PROTEGIT=
(Protected arc)
Prevent the merger from polygons connecting arcs that fulfill the condition. This lets you dial arches that mark major divisions on the territory and cannot be suppressed. For more information about the specific syntax see here. (Input parameter) /FITXER_ARCS_A_AFEGIR=
(Protected arc)
Allows to add to the arc file arches in order to generate polygons and closed areas which must be preserved independently from others. Generally it is useful to manually digitize boundaries in places that are small polygons with equal or similar attributes and form its own entity separate from the rest of the matrix but the conventional generalization process should completely merged with the matrix (since they are no physically connected). These new boundaries are included after the clipping process and before the merging process. The arches have to be digitized to close areas, by defining either rings or polygons to connect with other preexisting lines or created during the process of breaking polygons. If more than one line has to be digitized to define a certain area, consecutive digitization is required. The main table of these arc files must have the same structure as the main table of the arcs on which the polygons are structured. It should be noted that these added arcs could still disappear during the polygons merging process; to avoid this effect, the selecting parameter with suffix _ARC_PROTEGIT should be indicated as previously explained and check the added arcs with attributes that make them protected. (Input parameter) /EMANCIPA (Emancipate the result) Indicates the need to achieve an emancipated result. (Input parameter) /IGNORAR_VEINS_DIAG
(Ignore diagonal neighbors)
Indicates whether, in the computation of area of the raster polygons, the contact of two cells of equal value by the diagonal implies that they are considered part of the same polygon. Equivalent to the parameter /NO_AGRUPAR_POLIGONS_PER_NODES of the RasTop application. (Input parameter)