ArcGIS 9.1 and data format on import
#1
Posted 31 May 2006 - 11:46 AM
I have other census variables that I want to join to the shapefile so I can display census demographic data, but ArcGIS/ArcMap 9.1 only imports in DBF, CSV (comma delim), or TXT (tab delim), and since the census tract is a number, not text, it automatically imports it as such. Therefore, I cannot "join" to the CTLabel field in the census tract shapefile.
I am at a loss, I've tried encapsulating the number in quotations, but ArcMap just overrides that and imports it as an integer anyway.
#2
Posted 31 May 2006 - 12:01 PM
You could also try linking directly to an .xls document. I'm not sure if it will retain the text formatting or not. See link below on how to do this:
http://www.esri.com/news/arcuser/0104/file...n%20ArcGIS'
BTW ArcGIS 9.2 is supposed to support direct import of .xls files...no more cumbersome .dbf's or ODBC linking!
#3
Posted 31 May 2006 - 12:08 PM
#4
Posted 31 May 2006 - 12:14 PM
do you have Microsoft access? What you can do is import your table into Access and convert your data fields into whatever format you prefer, text, double, long, etc. Then you can export it as a DBF file and then import that into 9.1.
I do Mike, and I will try that, but I have tried the same thing in Excel, maybe it's not specific enough though.
#5
Posted 31 May 2006 - 01:47 PM
CTLabel = String (7)
NAME = String (255)
CTLabel might = 10.1, 63, 1, 4, etc.
NAME exactly the same.
#6
Posted 31 May 2006 - 02:38 PM
Getting joins to work can be frustrating...
If you want to upload or email me a subset of your shapefile and table, I wouldn't mind playing around with the data and see if I can get it to join.
#7
Posted 31 May 2006 - 02:50 PM
Census Tracts: http://www.nyc.gov/h...ricts.shtml#cbt
Attached is a tab delimited TXT file, no quotations. The board wouldn't let me upload a CSV.
Attached Files
#8
Posted 31 May 2006 - 03:15 PM
1) Convert .txt file to .dbf and add to arcmap
2) Find common fields to link
A) shapefile (nyct2000.shp): CTLabel (string, 7)
B) table (racnewyo.dbf): TRACT (long integer)
3) The TRACT field in the table needs to be divided by 100 in order to correspond with the CTLabel field, which contains decimals. For example, it appears that CTLabel "2.01" corresponds to TRACT "201". In the racnewyo.dbf table, I added two new blank fields: TractDbl (double) and TractTxt (string, 7). I then filled the TractDbl field with the field calculator expression: [TRACT] / 100, which converted the long integer to double-precision decimal. Next, I filled the TractTxt field with the filed calculator expression: [TractDbl], which converted the double-precision number to a text string. At this point it is ready to join.
4) Joining to the shapefile works, although some tracts are still null because the table does not appear to contain all of the CTLabel values. However, when joining the shapefile to the .dbf table, there are no nulls.
I think the key is to do all this in ArcMap rather than Excel.
Hope that helps.
--Paul
Attached Files
#9
Posted 31 May 2006 - 03:49 PM
Okay, got it to work (assuming I was looking at the right fields).
1) Convert .txt file to .dbf and add to arcmap
2) Find common fields to link
A) shapefile (nyct2000.shp): CTLabel (string, 7)
table (racnewyo.dbf): TRACT (long integer)
3) The TRACT field in the table needs to be divided by 100 in order to correspond with the CTLabel field, which contains decimals. For example, it appears that CTLabel "2.01" corresponds to TRACT "201". In the racnewyo.dbf table, I added two new blank fields: TractDbl (double) and TractTxt (string, 7). I then filled the TractDbl field with the field calculator expression: [TRACT] / 100, which converted the long integer to double-precision decimal. Next, I filled the TractTxt field with the filed calculator expression: [TractDbl], which converted the double-precision number to a text string. At this point it is ready to join.
4) Joining to the shapefile works, although some tracts are still null because the table does not appear to contain all of the CTLabel values. However, when joining the shapefile to the .dbf table, there are no nulls.
I think the key is to do all this in ArcMap rather than Excel.
Hope that helps.
--Paul
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users


Sign In
Create Account

United States
Back to top
Canada











