Importing .csv into a feature layer

Here are the instructions on how to import .csv data into a point feature class by using ArcGIS Desktop and MS Excel 2007.

1.      Open a .csv file in Microsoft Excel 2007 by double-clicking it in the Windows Explorer.

2.      Right-click the first row and choose Insert>Entire row, if your .csv file does not have fields defined in the first row. Then add the string with the delimited field names, which have a symbol with which your data is delimited, as a first row. Note that you do not have split the field names row into the cells).

So you can get a row like this:

ID,Street,Address,X,Y

1,StreetA,24,5645645,97644355

2,StreetB,42,5675848,97546633

3323,StreetX,54,5743534,97454355

 

3.      Keep in mind that MS Excel has some limitations, including the maximum number of rows that a worksheet may contain – 1,048,576 rows. So, if your .csv file is larger you will have to split this file into several smaller ones or use some other software to prepare the delimited text file for import into ArcGIS. You may find it useful to use such applications as Notepad++ or Notepad2, which are capable of dealing with text delimited files.

4.      Save the file as a new .csv file, for example, Processed_<Filename>.csv and then close Excel without saving the newly created .csv file (click No in the coming dialog box).

5.      Create a new blank workbook in Excel. Click Data > Get External Data > From Text. Choose the file created in the previous step, for example, Processed_<Filename>.csv.

6.      Choose the Windows (ANSI) encoding or as appropriate. Start importing at row 1. As a delimiter, use the symbol your data is delimited with. Accept defaults for other options or specify what data type your fields shall get. Click Finish and import data in a first cell, as suggested by default.

7.      Save the file as an .xlsx file, for instance, ExcelDataFile_<number>.xslx, and then close Excel.

8.      Start ArcCatalog. Navigate to the folder where the newly created .xlsx file was created. Select the .xlsx file and expand it in the Catalog tree. Right-click the spreadsheet where the data reside, and choose Create feature class > From XY table. NB: if you have Data Interoperability extension enabled in ArcCatalog then ArcGIS treats an MS Excel file as an Interoperability dataset and you will not be able to convert your table to a feature class.

9.      Keep in mind that pretty often your X and Y fields should be used inversely. That is, in the dialog box, as X field, choose Y column of the .xlsx workbook. Similarly, as Y field, choose X column. Optionally, choose the coordinate system in which you want to define your features. Be aware, though, that you can leave the coordinate system undefined and specify a coordinate system after your feature class will be created. Choose the name for the feature class as required.

10.   Depending on how large the .csv file is and what hardware resources you have at your disposal, the processing may take from some seconds with several rows in the file to several hours when having a huge number of rows. When having the ArcCatalog processing the data, the application can go to the Not Responding state, which is a very common occurrence. Do not try to accelerate the process of data processing by moving ArcCatalog window or clicking Alt-Tab to see the job window, since it may slow down the process. If you are unsure whether the application is already hanged up, you can check the Memory use of the ArcCatalog in the Windows Task Manager. If this value is changing over time, then you can be nearly sure that the application is still working and you should not end this process.

11.   After the data load is done, start ArcMap and add the feature layer in order to check that the data has been imported properly.

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s