ASCII - SPRING Format

The proposal to use the ASCII format as a standard for SPRING is the same as the other software: it turns the cartographic data exchanging process simple, allowing each user to prepare its own data in this format and the companies representing the different systems to quickly write conversion routines.

The main characteristics of the ASCII/INPE format are:

  • legibility, allowing access to external edition.
  • independency of the internal representation for each machine.
  • flexibility, allowing addition of new fields as a function of requirements.

A set of geographic data in the proposed pattern is materialized as a file set coded in ASCII, where each file stores an entity type (points, lines and 3D lines etc). The information is stored in a sequential pattern and divided into lines of variable size bounded by Carriage Return followed by Line Feed. Multiple blanks and special characters such as Carriage Return and Tabs are equivalent to a single blank. There is no constraint related to the line length. Keywords allow to identify easily, several data types and format components. It was used, as keywords, terms from the english vocabulary, which are used in Brazil as common sense in order to facilitate the information exchange with international organizations.

Each ASCII file is divided into 3 sections: Identification (formed by a keyword identifying one of the modeled entities by the pattern), Information (section of variable size having the relevant information for the user about the data) and Data (section formed by data and specific attributes). See, next, each of them.

Learn more about Import/Export in SPRING

How to import or export ASCII data.


Identification

This section has to be at the beginning of the file, and has to be formed by one of the keywords that identifies one of the supported entities by the pattern. For this section the following keywords are defined:

  • LINES: data as lines without topology. These lines can be used to form polygons (closed areas, as for instance, urban maps) or open lines (for instance, a map with rivers from a region)
  • POINTS: points file ("label points") used for polygons or lines labeling, in case a polygon internal point or any point in a line;
  • POINT2D: point entity and its identification (label, name and object for cadastral points or class for thematic);
  • SAMPLE: sample of points in space, used as input for terrain numerical models. An entity file of the SAMPLES type might have either height spots (indicated by the keyword POINT3D or contour lines (indicated by the LINE3D keyword);
  • GRIDREG: files having a regular grid, used as input for the terrain numerical models;
  • TABLE: files having tables, used to store descriptive attributes for geographic objects;
  • TEXT: files having texts, used to give toponomy to any data model in SPRING;
  • POLYGONS: polygons file where each one is exported as an island. There is line duplicity that make boundary between two polygons. If it is imported to SPRING, the duplicity must be removed;
  • NETWORK: file of oriented lines in the network model. Each line has an identifier, impedance and demands;
  • NETWORK_OBJECTS: points file ("label points") used to label lines and nodes in an IL in the network model. To differentiate the line identification and nodes the keywords LINES and NODES are used, respectively.

Information

Located after the Identification of the entity type, this section is bounded by the keywords: INFO and INFO_END. This section is optional, but highly recommended in the files, because it has important information for the user about the data and, perhaps, for an analyst who wants to design a routine to read the data. This section has a variable size and it is composed by lines, the beginning of each line is identified by a keyword available for this section. For the Information section the following keywords are defined:

  • INFO: Indicates the beginning of the Information section.
  • INFO_END: Indicates the end of the Information section.
  • DATUM: Earth model used in the projection and corresponding parameters, presenting the following order, and separated by commas: name, semi-major axis or radius, flattening, ellipsoids displacement in the x, y and z directions.
  • PROJECTION: Data projection, and corresponding parameters presented in the following order and separated by commas: projection name, hemisphere, latitude origin, longitude origin, first parallel and second parallel. Notice that depending on the projection some parameters are not required, so these parameters will not be present, but their commas should be kept.
  • BOX: Project involving rectangle.
  • UNITS: Unit system for data and parameters.
  • SCALE: Data scale.
  • GRIDDEF: Parameters definition in a regular grid.
  • SEPARATOR: Option to control the way entity data is stored TABLE, POINTS or POINT2D.
  • FORMATED: Defines the fields formatting for an entity TABLE (NOT IMPLEMENTED).
  • UNFORMATED: Option to control the way a TABLE entity data is stored. It is used with the SEPARATOR item.
  • DATABASE: Name for the database that has the original data
  • CATEGORY_OBJ: Name for the objects category in the database, used for tables.
  • CATEGORY_NOSPATIAL: Name for the Non_Spatial category in the database, used for descriptive tables.
  • T_KEY: Object label definition in an attributes' table.
  • T_NAME: Object name definition in an attributes' table.

General comments about the data can be inserted in this section, just initialize the line using two bars (//). There is no limitations related to the size a comment might have.

    Example:

      TABLE
      INFO
      // Attributes table
      // ASCII file generated by SPRING System
      // Project: Brasilia - Information Layer: Blocks_Map
      // Category: Urban_cadastre - Model: CADASTRALMODEL
      DATUM SAD69, 6378160.000000, 0.003353, 0.000000, 0.000000, 0.000000
      PROJECTION UTM/SAD69, 1, 0.000000, -0.785398, 0.000000, 0.000000
      BOX 183557.000000, 8246273.000000, 195009.000000, 8258937.000000
      UNITS Meters
      SCALE 25000.000000
      SEPARATOR ,
      UNFORMATED
      DATABASE DF
      CATEGORY_OBJ Blocks
      T_KEY , TEXT , 32 , 0
      T_NAME , TEXT , 32 , 0
      ASA , TEXT , 7 , 0
      USO , TEXT , 15 , 0
      NUM_IMOVEL , INTEGER , 10 , 0
      POPULATION , INTEGER , 10 , 0
      RENDA , REAL , 17 , 8
      INFO_END
      SQN-102 , SQN-102 , NORTH , Hotels , 12 , 3500 , 17000.000000
      SQN-103 , SQN-103 , NORTH , Public , 15 , 250 , 20000.000000
      SQN-104 , SQN-104 , NORTH , Public , 18 , 300 , 25000.000000
      SQN-105 , SQN-105 , NORTH , Public , 100 , 400 , 30000.000000
      END


NOTE: This section can be formatted only by comments, comments plus some keywords or comments plus all keywords available for this section.


Data

This section starts after the keyword INFO_END and it is composed by one or more entity instances defined in the section Identification. At the end of each entity, in case of lines or contour lines it is delimited by the keyword END, and the end of the data in the file by the sequence END END. The other entities (points, samples, grid, table and texts) use only an END at the end of file.

The data can be declared in plane coordinates (meters, kilometers, millimeters, feet or inches), or geographic coordinates (decimal degree, decimal second or latitude/longitude).


When the file is in geographic coordinates; latitude and longitude, the following conventions are used:

  • In front of the latitude values the letters S, s, N or n should appear.
  • In front of the longitude values one of the letters W, w, E or e should appear.

Example:   s 23 13 38.6 w 45 53 51.0 or w 45 53 51.0 s 23 13 38.6

IMPORTANT: The Spring exports in geographic coordinates, always in the Longitude / Latitude order. However, when importing, the system recognizes also the coordinates pair in the inverted form (Latitude / Longitude) as shown in the example above.

When the file is in geographic coordinates; decimal degree or second degree, the following conventions are used:

  • In front of the longitude/latitude value (in this order), use a negative symbol (-) to indicate to the left of the 0 degrees meridian and in the south hemisphere.

Example -63.47887039 2.18374274

For alphanumerical data, that is, attributes' table, each line represents a register and each field is separated by the character defined in the information section, followed by the keyword SEPARATOR.

See the formats for each type of ASCII file defined in the identification section, that is; LINES (lines without topology), POINTS (Identifiers), POINT2D (thematic or cadastral points), SAMPLE (terrain models), GRIDREG (regular grids), TABLE (descriptive attributes tables), TEXT (texts), POLYGONS (polygons as islands), NETWORK (oriented lines), NETWORK_OBJECTS lines and networks nodes identification). Notice that the file sections are always in the sequence:Identification, Information, Data, where the Information section is optional, in most files.


ASCII Files and Models

To better understand the utility for each one of the ASCII file types and the data model they belong to in SPRING, see the table below.

MODEL
FILES/ EXTENSIONS
NOTE
Thematic

Points
POINT2D/ *_P2D.spr Points representation (coord. X/Y) and class identification in the same file.
Thematic

Lines and Polygons
LINES / *_L2D.spr POINTS / *_LAB.spr POLYGONS/ *_POL.spr To get a thematic map in SPRING the LINES and POINTS files are enough, because the first represents the lines/polygons and the second thematic classes identifications. Remember to adjust and make polygons before importing a file POINTS, when the map has polygons. The file POLYGONS is created only when exported, in case it has to be imported it is recommended to remove duplicated lines among neighbor polygons.
Cadastral

Points
POINT2D/ *_P2D.spr Points representation (coord. X/Y), object identification (Label and Name) and corresponding object category.
Cadastral

Lines and Polygons
LINES / *_L2D.spr

POINTS / *_LAB.spr

POLYGONS/ *_POL.spr
To have a cadastral map in SPRING it is enough to have the LINES and POINTS files. The first represent the lines/polygons and the second objects identifications. Remember to adjust and make polygons before importing a POINTS file, if the map has polygons. The file POLYGONS is created only when exported, in case it has to be imported it is recommended to remove duplicated lines among neighbor polygons.
Numerical

Samples, Rectangular Grids, and Breaking Lines
SAMPLE / *_L3D.spr

GRIDREG / *_GRR.spr

LINES / *_L2D.spr
The files SAMPLE and GRIDREG are imported and exported independently one from another. The breaking lines, which are 2D lines, are exported as LINES, in case they are in the same sample file. However, a LINES file, can only be imported for a thematic or cadastral if it will be used as breaking lines.
Networks

Lines and Nodes
NETWORK / *_NET.spr NETWORK_OBJECTS / *_NETOBJ.spr Both files have always to be together, but must be imported separately.
All

Texts
TEXT / *_TEX.spr A TEXT file can be used by any data model in SPRING, including images.
Objects

Attributes
TABLE / *_TAB.spr An object table can be associated to an IL of any cadastral category (point entities, lines or polygons), or networks (oriented lines and nodes). Remember that internally the keyword CATEGORY_OBJ has to be present.
Non-spatial

Attributes
TABLE / *.TAB.spr A Non-spatial attributes table might exist in a database and at any time it can be connected to an object table for consulting. Remember that internally the keyword CATEGORY_NONSPATIAL has to be present.

See about Import/Export in SPRING


See also:
How to IMPORT data?
How to IMPORT data in the SGI?
How to IMPORT GRIB images?
How to EXPORT data?