NoiseMap Forums

NoiseMap Software => Support => Topic started by: roger on May 22, 2018, 11:07:41 AM

Title: I cannot import some fields of my shapefile - they are always blank
Post by: roger on May 22, 2018, 11:07:41 AM
This is caused by an issue with data 'conversion'.  Computers can store data in many different ways: to be able to import it into NoiseMap, each field (i.e. column) of data must be store in a particular way.  NoiseMap uses one of three ways to store each field.  These are:

Very often, when you print a set of data, you have no idea what internal format the computer is using to store the information as it will be converted to printable characters before it can be shown on your screen or printer.

In the present case, the problem is caused because you want to import a column of data (a field), which has been stored by your GIS as an integer number, into the description field of the object, for which NoiseMap requires a character string.  Unfortunately, NoiseMap doesn't convert data from one format into another, and since it can't read integer numbers as if they are characters, it ignores the problem and leave the field blank. It doesn't report the problem either. 

The same problem would occur if you try to read a number stored in numerical format as if it were a character string.  However, it may be able to read integers as if they are floating point, although it would not normally read a floating point number as if it were an integer. 

For safety, you must always ensure that your Shapefile attribute data is in the format that NoiseMap requires - as listed in Chapter 21 of the User Manual. 

How can you do this?
The 'attribute' data of a Shapefile is stored in the database component (file type .dbf).  You can open this in Excel.  It will appear as an ordinary spreadsheet with column headings and columns of numbers. It will be obvious if a column contains non-numerical values that this is Character format. But if it contains numbers, you can't tell because Excel does its best to put them into printable character format on-screen.  There is quite an easy way to tell, though, if you open the dbf file in Notepad.  You will see the column headings as the first line of the file.  Each heading is followed by a letter N, F or C.  These stand for integer number, floating point number and character. 

If you open the file in Excel, you can convert any number to character format by using the formula =TEXT(A2,"#") This says, take the contents of cell A2 and convert it into a number in character format.  The "#" just tells Excel to display the number in general number format.  You can use different formats in place of the "#" to get the number displayed with different numbers of decimal places, etc. 

A small glitch is that although you can open dbf files in Excel, Microsoft has removed the ability to save files back into dbf format. You can buy add-ins to restore this ability.
Alternatively, go back to the GIS and export the field in the correct format.