How to stop variable from being rounded when converting to shapefile

5326
15
Jump to solution
06-01-2015 11:02 AM
MichelConn
New Contributor II

I am trying to add X and Y data from a previously geocoded data set (excel file). The process is a success but the problem I am facing is for some reason ArcGIS is rounding to the tenth place a very important identifying variable. I am converting the original results to a shapefile because I need to run a spatial join with the data. It appears that when converting the original results to a shapefile ArcGIS is rounding the variable of interest. Is there any workaround or way to stop ArcGIS from rounding my data?

Tags (1)
0 Kudos
15 Replies
SepheFox
Frequent Contributor

I think, that since you've identified the shapfile as the step where your values change, you should create a geodatabase in ArcCatalog, and then after you create your data, export into the GDB as a feature class.

0 Kudos
MichelConn
New Contributor II

I finally got it to work. I converted the file to .dbf format in ArcCatalog and went into the properties of the variable and changed the type from double to long and it worked.

VinceAngelo
Esri Esteemed Contributor

This solution (to convert the datatype to 32-bit integer) is not available if the value will exceed 2^31-1 (~2.1 billion).

FYI: From a terminology standpoint, the columns in a dBase file are called "fields".  "Variables" are associated with programming languages.

VinceAngelo
Esri Esteemed Contributor

This is a limitation of the dBase-III+ format utilized by shapefiles.  It's not clear which application is causing the issue, but there are two possible encodings for large floating-point values, one of which uses scientific notation, in a format like "sN.NNNNNNNNesNNN".  If you were to inspect the contents of the .dbf file, you would find values like "+1.09377673e+009", which is why the least significant digit is lost.

You can find an example of a similar situation from the old Forums, ported to Geonet.

- V

DanPatterson_Retired
MVP Emeritus

ensure that the field was explicitly formatted in excel and that it does not contain blanks or other data types or an attempt will be made to find a 'common' data type and not necessarily the one you want

curtvprice
MVP Esteemed Contributor

The issue you are running into is that the precision (number of digits) that is saved in an output dbf defaults to 12 when copying data out.

The best way to copy the data is instead of right click/export the layer, use the Merge tool with your point layer as a single input. In the field map, specify the output field properties to have precision 15. If you do this, your data value will not be rounded in the shapefile. Here are the details on how to tweak the field map:

Using the field mapping control—Help | ArcGIS for Desktop

Dbf is pretty primitive -- what is stored are the ascii number characters (and the "."!):

1 0 9 3 7 7 6 7 3 4 . 0

1|2|3|4|5|6|7|8|9|0|1|2