You are here: Other topics > Plotting > Format of Grid definition file
GEOVIA Surpac

Format of Grid definition file

The plotting grids are defined in the SSI_PLOTTING:grids.ssi file. A sample of the file is shown below.

# "ssi.plotting.grids" :Version 4
(grid "YXA3"
  (purpose "Converted from user.chr")
  (xgrid 
    (line_type 1)
    (pen 1)
    (grid_line_interval 0.00)
    (grid_style lines)
    (tick_size 1.50)
    (line_priority 0)
    (text_location both_ends)
    (text_interval 1.00)
    (text_sign normal)
    (decimals -1)
    (text_height 0.18)
    (font_bold 0)
    (font_italic 0)
    (font_underline 0)
    (font_name "DefaultFixed")
    (text_priority 10)
    (text_before "")
    (text_after " E")
    (horizontal_offset 0.20)
    (vertical_offset 0.20)
    (grid_offset 0.00)
  )
  (ygrid 
    (line_type 1)
    (pen 1)
    (grid_line_interval 0.00)
    (grid_style lines)
    (tick_size 1.50)
    (line_priority 0)
    (text_location both_ends)
    (text_interval 1.00)
    (text_sign normal)
    (decimals -1)
    (text_height 0.18)
    (font_bold 0)
    (font_italic 0)
    (font_underline 0)
    (font_name "DefaultFixed")
    (text_priority 10)
    (text_before "")
    (text_after " N")
    (horizontal_offset 0.20)
    (vertical_offset 0.20)
    (grid_offset 0.00)
  )
)

The first line of the file is a unique file header to distinguish this file to prevent errors when working with the file. This line also identifies the version for the format of the file so that future compatibility issues can be resolved easily.

The file uses a number of keywords each with appropriate arguments to define the structure of a grid definition.

All keywords and their arguments are contained in enclosing parentheses as shown in the example above. A grid definition begins with the (grid keyword and contains the following keywords:

  • grid
  • Describes the name of the grid enclosed in " characters

  • purpose
  • Permits a verbose description, enclosed in " characters, for the grid to be defined

  • xgrid, ygrid
  • Defines the start of the parameters for the X grid lines and labels or the Y grid lines and labels respectively. Each grid definition will consist of both an xgrid and a ygrid component. The X and Y grid parameters are identical and will only be defined once.

    • line_type
    • Defines the type of line that will be drawn. The type of line is described using an integer, at this time the only valid value is 1, which represents a solid line, that is, no dashes or dots.

    • pen
    • Defines the pen number that will be used to draw the line. The pen number is a positive integer. Valid values are between 1 and 999 inclusive.

    • grid_line_interval
    • Defines the default interval to be presented to the user when entering the grid parameters while processing a map. A value of zero will cause the Process Map function to calculate the default grid line interval as:

      • map scale * 0.1 if the map is using metric units
      • map scale * 2.0 if the map is using imperial units

      The map scale referred to is the X or Y scale as appropriate for the grid lines in question.

      If a non-zero value is entered in this field (a positive value that is) then it is this value that will be displayed as the default grid line interval when processing the map.

    • grid_style
    • This parameter defines the default grid line style that will be presented to the user when entering the grid parameters while processing a map. The different styles of grid lines may be:

      • lines
      • Solid lines that extend the full width, or height, of the drawing area.

      • ticks
      • Tick marks around the perimeter of the drawing area only.

      • crosses
      • Crosses throughout the drawing area region and tick marks around the perimeter of the drawing area.

      The size of the tick marks and crosses is determined by the tick size parameter.

    • tick_size
    • This is the size, in centimetres, of the tick marks and crosses that are drawn for the grid.

    • line_priority
    • This is the priority of the grid lines/ticks/crosses that are drawn for the grid. The priority must be an integer in the range 0 to 125 inclusive.

    • text_location
    • Grid line labels may be placed on the map, or not, to suit your requirements. There are 4 alternatives available to determine the placement of the grid line labels. These are:

      • both ends
      • This is the most commonly used alternative and ensures that grid labels are placed at both ends of the grid lines, provided of course that they are not clashed off the map by other features of higher priority on the map.

      • start
      • Labels are only placed at the start of the grid line. For horizontal grid lines the start is at the left edge of the drawing area. For vertical grid lines the start is at the bottom edge of the drawing area.

      • end
      • Labels are only placed at the end of the grid line. For horizontal grid lines the end is at the right edge of the drawing area. For vertical grid lines the end is at the top edge of the drawing area.

      • none
      • Grid labels are not drawn at either end of the grid lines.

    • text_interval
    • The text interval determines the frequency of labels on the grid lines. Only those grid lines whose grid value is an integral multiple of the label interval will have labels.

      A label interval of 100 though will ensure that only grid lines whose value is an integral multiple of 100 will have labels drawn. With such a grid line interval you could therefore have a map with grid lines at values of 100, 125, 150, 175 and 200 but only have labels drawn on the 100 and 200 grid lines.

      The text interval must be a positive value equal to greater than 1.0

    • text_sign
    • The text sign determines a sign is placed with the grid value or not. Valid values are:

      • normal
      • Normal number sign conventions are used. That is, a preceding negative sign is used for negative numbers and no sign is used for positive numbers.

      • explicit
      • A preceding sign is always used for both negative and positive numbers.

      • none
      • No number sign is used regardless of whether the number is negative of positive.

    • decimals
    • This determines how many decimal places, if any will be used when formatting the numerical part of the grid label. Values must be within the bounds of -1 to 3 inclusive.

      -1 will give no decimal places and no decimal point. 0 Will give no decimal places though a decimal point will be used. 1 through to 3 inclusive will give the requisite number of decimal places.

    • text_height
    • This is the height, in centimetres of the grid line labels. The text height must be a positive real number.

    • font_bold 
    • This is the bold option for the font. The value must be 1 to turn bold on, or 0 to turn it off.

    • font_italic 
    • This is the italic option for the font. The value must be 1 to turn italics on, or 0 to turn it off.

    • font_underline 
    • This is the underline option for the font. The value must be 1 to turn underline on, or 0 to turn it off.

    • font_name
    • This is the name of the font to use for grid labels lines. This must be a known system font, Default or DefaultFixed. If the given font is not known to Surpac, it will be substituted with the Default font.

    • text_priority
    • This is the priority of the grid labels and must be an integer in the range 0 to 125 inclusive.

    • text_before
    • This is the text that will be pre-pended to the formatted grid value for labelling the grid line.

    • text_after
    • This is the text that will be appended to the formatted grid value for labelling the grid line.

    • horizontal_offset
    • This is the offset from the closest edge of the drawing area to the start (or end depending if the label is at the start or end of the grid line) of the grid label. It must be a numeric value and may be positive, zero or negative.

    • vertical_offset
    • This is the offset above the grid line to the bottom of the grid label. It must be a numeric value and may be positive, zero or negative.

    • grid_offset
    • This is the offset which determines the values at which grid lines will be placed. A value of zero will ensure that grid lines are placed at integral multiples of the grid line interval. A non zero value will cause the grid lines to be a values that are offset by this amount. Therefore, an offset value of 25 with a grid line interval of 100 will produce grid lines at values of 125, 225, 325, etc.