-
General syntax aspects in the MiraMon Support Applications (MSA)
Introduction
Syntax aspects that affect some MiraMon Support Applications are explained here in a generic way.

Related database field selection
- REL v.1:
- /TAULA1= the index, numbered from 0, indicating which table in the database contains the relevant attribute field: -1 if it is the principal table or the index of the field of the principal table to which the associated table is linked (normally a thesaurus).
- /CAMP1= is the index of the field within the selected table (also numbered from 0). These indexing criteria may be found using InfoTop or using the Windows interface of the program wCombiCa and pressing the button ">>BAT...".
- REL v.4:

Record selection when there are multiple records for a graphical object
- /REPE=indicates which record to use should there exist multiple records for the same graphical identifier (1 for the first, 2 for the second, ...). If entered with a minus sign the count starts from the last. If 2 is entered, for example, and it does NOT exist, then the graphical object is totally ignored. The default value is 1.

Selection of graphic objects according to database attributes, or raster cells for querying their values
- /COND#_TAULA= and /COND#_CAMP= table and field selected for the condition #. # is an index that starts from 1. To learn more about these parameters follow the instructions about Related database field selection in this document.
- /COND#_OP= logical condition operator. # is an index that starts from 1. It can be:
- "EQ" equal to (=)
- "NO_EQ" not equal to (=/=)
- "LT" less than... (<)
- "GT" greater than... (>)
- "LT_EQ" less than or equal to... (<=)
- "GT_EQ" greater than or equal to... (>=)
- "INTERVAL" closed interval ([a,b])
- "EQ_SUBCADENA" string with... (with)
- "NO_EQ_SUBCADENA" string without... (without)
- /COND#_VALOR= the field value. Inverted comas are needed if it contains spaces.
- /COND#_NEXE= logical link between conditions # and #+1. It can be AND or OR.
- /COND#_PRIOR= priority of the condition #, indexed from 1. This is an optional parameter. If it is not indicated the priority is just the order. Dialog boxes show a traduction of condition priorities expressed in bracket notation.

Selection of one vertex Z coordinate in a 3D vectorial file with multiple height for each vertex
- /ALCADA= Sets which of the possible heights is chosen: 0 select the first chosen one, 1 to select the highest one and 2 to select the lowest one.

Internal date and hour format
- DATE: Date is saved with the YYYYMMDD format, that is 20030103 for March 1st, 2003. This format has the advantage that it can be ordered as is.
- HOUR: Hour can be stored down to one-hundredth of a second with the HHmmsscc format, that is 23595999 means 23:59:59.99 hours (in the official local hour). Please note that this format uses the 24h format; 12h am/pm format is not supported. Depending on the hour type some other codification can be added to this string:
- UTC Hour: A Z is added as a suffix, for instance 23595999Z for 23:59:59.99 UTC hour.
- Local Official Hour with corrector: The hour corrector is added at the end. This corrector is composed of a + or - sign, two digits which indicate the number of hours and two digits which indicate the number of minutes (without separators). For instance: 23595999+0130 for the 23:59:59.99 official local hour with an UTC corrector of one hour and a half.
- Solar hour: An S is added at the end of the hour, for instance 23595999S, for the 23:59:59.99 local solar hour.
- UNIQUE DATE and HOUR: Date and hour are written followed and separated by a blank space, for instance "20030103 2359599" for March 1st, 2003 at 23:59:59.99 local official hour (without corrector).
- DATE and HOUR INTERVAL: Date and hour for the end of the interval are written after the initial date and hour of the interval, separated by a colon (without blank spaces). For instance, "20030103 2359599,20040103 2359599" for the interval between March 1st, 2003 at 23:59:59.99 and March 1st, 2004 at 23:59:59.99 both at local official hours (without corrector). In a given interval or time period both hours must be of the same type. For instance, it is not possible to mix local official hours with corrector with local official hour without corrector, despite the fact that it is possible to store a different hour corrector for the initial and final hours.
- INCOMPLETE DATE and HOUR: In the need to document an incomplete hour the 9 digit is used as a marker. If the whole hour is unknown it is not necessary to write it down. For instance, "20030103 23999999,20040103" would correspond to the period between March 1st, 2003 at 23 hours (minutes, seconds and hundredths of a second are known) and March 1st, 2004 (unknown hour).
For further information on dates and hours please refer to general considerations.

Available algorithms for topological structuring (/ALGORISME)
MiraMon allows vector information sets to be topologically structured. This topological structuring involves analyzing and, consequently, organizing vector entities so that their spatial relationships are explicitly described. The benefits of this topological structuring are multiple: guaranteeing spatial consistency, avoiding unwanted (total or partial) overlaps of entities, avoiding errors such as "gaps" between polygons, saving storage space and increasing the speed of data transmission, allowing network analysis, etc. These benefits allow to increase the possible range of geographic analyses (some of which are not possible without topological structuring) and to carry them out in a robust and reliable way.
In the case of linear elements (e.g., rivers), or in the case of the edges of polygonal elements (e.g., cadastral parcels), the analysis to be carried out involves the detection of intersections between the segments that form the lines and the edges of polygons; these intersections can be along the segments or by contact of their ends and generate special vertices that are called nodes (just as the vertices of segments that do not intersect with any other segment are also nodes). In layers with many lines or polygons, this procedure can require considerable calculation time, which can increase exponentially depending on how the original entities are arranged (large lines that have many intersections with the others, explicit overlap by pairs of segments [as happens in explicit polygon layers of most GIS formats], etc). To perform this detection as efficiently as possible, it is possible to choose between two algorithms (procedures): "direct algorithm" and "sweeping algorithm" (escombratge). These algorithms are available in the different MiraMon applications that perform topological structuring (LinArc, BufDist, CombiCap, Retalla, SHPTop, etc.) and are indicated, on the command line, with the /ALGORISME= modifier. The different algorithms available are listed below.
- /ALGORISME=DIRECTE (direct algorithm): The algorithm determines the intersection of each of the segments with the rest of the segments, analyzing them two by two. Each intersection found implies, except when it is at the end of the two segments, the partition of one segment or both, and the increase in the complexity of the pending analysis task until the topological structuring is concluded.
- /ALGORISME=ESCOMBRATGE (sweeping algorithm): It uses the Bentley-Ottmann algorithm, which orders the vector elements in a certain way in the plane and performs a sweep from left to right that calculates the intersections between nearby elements. This avoids comparing elements that are known to never intersect, thus avoiding a lot of calculation time in a large number of situations.
- /ALGORISME=AUTOMATIC (automatic algorithm): The choice between the methods described above is left to the program.
Then,
- /ALGORISME=DIRECTE it is faster for layers where structuration has been done before, or it is known that there are no intersections beyond the existing vertices (the topological structuration is implicit or is it an explicit polygon layer [edges repeated 2 times]).
- /ALGORISME=ESCOMBRATGE it is faster in precisely the opposite case: layers where the elements intersect other elements causing intersections points that were not previously vertices at the end of lines and, therefore, are new nodes in the output layer.
If at the time of structuring a layer it is known that the structuring will generate new vertices (that is, intersections will be detected) it is better to choose "escombratge" (sweep). Otherwise, "directe" (direct) can be chosen. If in doubt, indicate "automatic", but this mode may require more time than the fastest of the previous two (but less than the slowest), since if when it has done a percentage of the procedures it detects that the initial mode is not optimal it starts again with the other mode.

Decision for quantiles (optional modifier /MEDIANA_EMPAT=)
If an application performs the calculation of some quantile (such as the median, a quartile or a percentile), indicates the type of tiebreaker to be used for its calculation when the quantile position is between two values in the series. The criterion will also be applied when the mean of the absolute deviation around the median must be calculated (since it requires the median to be calculated). The calculation options are:
- /MEDIANA_EMPAT=1 to choose an alternate value.
- /MEDIANA_EMPAT=2 to choose the lower value.
- /MEDIANA_EMPAT=3 to choose the higher value.
- /MEDIANA_EMPAT=4 to choose the average of the two values between which it is.
The default option is 1.
