Data must be imported into the current project file that was created or selected in the Project window before it can be used by DatMapR.
The user should first select the required source data file. This will generally be a '.txt' or '.csv' ('Comma Separated Variable') file, but can be a any other file type that contains text data in the required format. The contents of the file will be shown in the box below the button.
The file could be produced from Excel by 'Save As', as an 'Export' from Access, or from many other data handling and recording packages.
Data can be imported from ...
a Delimited file (*) in which the data fields are separated by Commas (as in the example above), or Semi-colons, Colons, Hashes (#), Spaces or Tabs,
or a Fixed Format file in which the fields are at defined character positions within the record (see notes later in this page).
* Note that in Delimited files, double-quotes (" ") can be used around data values (as seen in CSV files saved
from Excel, as in the above example) to avoid characters within the values being taken as field delimiters (e.g. "Sheffield,UK" will be treated as a
single value even if comma is the chosen delimiter).
If the project uses OS NGR format, the Coordinate Format needs to be defined – by default this is OS NGR (e.g. SK123456 **), but can be Eastings/Northings (which need to be provided as 1km values within the full OS NGR grid (SK123456 would therefore need to be provided as 412.3, 345.6). One (NGR) or two (E/N) fields then need to be defined to provide this data.
** For OS NGR strings, internal spaces will be ignored (i.e. "SK 123 456" will be accepted) and the NGR can be at any precision from 100km (SK) to 1m (SK1234567890). Whatever the precision of the incoming data, the NGR will be held within DatMapR in 1km units (e.g. SK123456 will be stored as 412.3,345.6).
The 'Precision' of NGR strings will be noted within the data stored in the project file and will be one of the following values (expressed in kilometres):
100 |
e.g. SK |
10 |
e.g. SK12 |
5 |
e.g. SK12NE i.e. as used in defining 1:10000 maps |
2 |
e.g. SK12A i.e. 2km tetrads using a 'DINTY' suffix |
1 |
e.g. SK1234 |
0.1 |
e.g. SK123456 |
0.01 |
e.g. SK12345678 |
0.001 |
e.g. SK1234567890 |
Each record will provide up to 10 data fields as required by the project. Any sub-set of the 10 fields can be imported, any not imported will be held as ‘null’ and will not be available for aggregation and mapping. If no data fields are defined (i.e. just the location is defined), DatMapR will load a dummy value of ‘1’ into the first field. This can then be used for aggregation and mapping, effectively indicating the existence of a record.
In the case of a Delimited file, the fields will be specified by their ordinal position across the record (1 to 999) (as seen above).
In a Fixed Format file (as ahown above), the window layout will change to allow the entry of a Start position for each field (character positions 1 to 9999) and the field Length.
The Field Short Names, Content and Descriptions as defined in the Project window are shown for information, but can also be changed here as required. Any changes will be reflected in the Project window.
Having entered the required details, the user should click on the Parse Data before Import button so that the parameters and data can be validated. If the data included a header record, e.g. holding column headings or field names, this can be ignored by ticking the Ignore First (Header) Record box.
Records containing invalid location data will generate a warning, and the user can choose whether to Skip the single record, Skip All such invalid records (supressing further warnings), or to Include the record in the parsed data with its invalid location data.
The ‘parsed’ data records will then be shown in the box below the button and can be checked before finally being imported. The columns can be resized by resizing the window and by dragging the separators in the heading line.
Having successfully parsed the source data, the Import Parsed Data button will be enabled. Clicking the button will first check for existing data in the project file - the data can optionally be deleted before the import, or the new data can be appended.
As noted above, any fields not included in the Parse will be treated as 'null', but it is also possible that blank values within the parsed data may be more correctly
treated as 'null'. By default, the Treat blank data as valid data box will be ticked, and blank values in text boxes will be treated as genuine blank values and will be
included in 'Count' and 'Count Distinct' aggregations (see Main window), while blank values in a Numeric field will be treated as 0 (zero) and therefore
included in 'Count' and 'Average' aggregations, and plotted as valid data if using Exact mode'. By 'unticking' the box, these values will be treated as 'null' and omitted from aggregations
and other processing.
On completion of the Import, the Import window can be closed by clicking the Done button, which will return control to the Project
window.