GEOG 868
Spatial Database Management

Feature Class Creation: Via Import


Feature Class Creation: Via Import

In the previous lesson, we saw how to import vector data into new geodatabase feature classes as part of our experimentation of logins, users and roles. Most of this section of Lesson 7 will be reviewed as we import more data, though the process is outlined in greater detail here.

A. Transferring data from your computer to your enterprise geodatabase instance

We are going to transfer four shapefile datasets from your computer to your Amazon cloud enterprise geodatabase instance. The shapefiles are data you worked with back in Lessons 3 and 4: the States, counties, and us_cities shapefiles that we used in Lesson 3, and also the cities shapefile that you used in Project 4 in the Jen and Berry's site selection exercise. I gave you copies of them in the archive that you downloaded in the Checklist section, above.

  1. Restart your instance.

    You are next going to open a Remote Desktop Connection to your geodatabase instance.  If you allocated an Elastic IP for your instance as instructed in Lesson 6, then you can connect using that same address.  Otherwise, you'll need to connect using the new Public IP assigned to your re-started instance.

    Also, if the IP address you're connecting from has changed, then you'll need to refresh the RDP Security setting by going to your instance's security group and updating the Inbound RDP rule.
  2. Open a Remote Desktop Connection to your geodatabase instance through the appropriate IP address.
  3. In doing so, make certain that the box for Drives is checked via Options > Local Resources > More button.
  4. In your remote desktop connection window, open Windows Explorer (This OS version calls it File Explorer). There should be an icon for it on the taskbar along the bottom of the remote connection window. If not, wend your way via the Start button to it.
    Click This PC to display the drives that are attached to the Windows operating system.
    Under Devices and drives, you will see listed a set of drives (Local Disk C and possibly also Local Disk D) for your EC2 instance.
    You will also see the drives that reside on the computer you are remote-connecting from. They will have names like C on <the name of your computer>.

    In the next steps, you are going to Copy-Paste the files making up the four shapefiles from your computer to the Local Disk (C:) drive on your instance.
    So, you might want to open a second File Explorer window.

    To open another File Explorer window, right-click on the File Explorer icon on the taskbar, and choose File Explorer.
  5. Copy the archive from your local machine to the virtual machine in your remote instance.
    • Browse to the folder on your local computer that contains the archive.
      Highlight it, and click Copy.
    • Now (via your second File Explorer window), navigate into the Local Disk (C:) drive on your remote desktop connection.  Create a new folder named data on the C: drive. 
      Browse to within the data folder, and Paste the shapefile zip archive file there.
      The copy/paste process may take several seconds.
  6. Un-zip the archive.
    Leave the uncompressed file destination the name of the zip archive: DataFromLessons3and4, so that the data ends up in a folder by that name.
  7. In your remote connection, you may choose to open your ArcGIS Pro project from Lesson 6 to re-use the Folder connection to the Local Disk (C:) drive.  Otherwise, you can re-create it in a new project.  
  8. Expand the folder connection to the C:\ drive, and make certain that in your DataFromLessons3and4 folder you have four shapefile datasets — Statescounties, and us_cities from Lesson 3, and cities from Project 4.

    To learn more about issues concerning moving data into the cloud, go to the Moving data to the cloud section of our Cloud and Server GIS course, and read from the beginning of that section through the Techniques for data transfer subsection.

B. Importing to your database from a shapefile or file/personal geodatabase

A common workflow for organizations that are migrating their data to an enterprise geodatabase is to import data that already exist in other formats. Let's walk through that process.

  1. You should already have opened ArcGIS Pro. In the Catalog pane, you should have some connections under the Databases heading left over from the previous lesson, including:


    Recall that the latter two connections were through database users we created for the specific purpose of loading data.

    We're going to import the States, counties, and us_cities shapefiles as feature classes.

    We'll first create a feature dataset to house the new feature classes.
  2. Right-click on the census_egdb.sde connection heading, and select New > Feature Dataset.
  3. Assign a name of usa_L7.
  4. For the Coordinate System parameter, perhaps the easiest way to set it is to import the coordinate system definition from one of the feature classes you plan to house in the dataset.
  5. Click the globe icon to open the Coordinate System dialog.  Select Import Coordinate System from the Add Coordinate System dropdown list on the right side of the dialog (Screen capture of the Add Coordinate System dropdown list), then browse to and select the C:\data\DataFromLessons3and4 States shapefile and click OK.

    Click OK again to dismiss the Coordinate System dialog. 

    After a few moments, you should see the new usa_L7 feature dataset listed beneath your census_egdb connection. Note that the full name listed in the Catalog window is egdb.CENSUS.usa_L7, indicating that census is the owner of the feature dataset.
  6. Right-click on the usa_L7 feature dataset, and select Import > Feature Class. We'll use the multiple feature class option in a moment. The single option provides slightly different functionality.
  7. For the Input Features browse to the location of the States shapefile.

    The Output Location should already be filled in with the usa_L7 feature dataset accessed through the census_egdb connection.
  8. For the Output Feature Class, assign the name states.

    Though we won't use them, the next two optional settings are worth a brief mention. The first, Expression, allows for specifying a subset of the input dataset to import through an SQL Where clause. The second, Field Map, allows for some control over the fields that will be imported to the GDB feature class. For example, you might choose not to import certain fields. The Field Map parameter also makes it possible to produce an output field based on values from multiple input fields (e.g., the concatenation of two text values or the sum of two numeric values).
  9. Click Run to begin the import process. After a few moments, you should see the states feature class listed in the Catalog pane and added to the map.

    Now, let's use the multiple feature class import option to import the counties and us_cities shapefiles.
  10. Right-click on the usa_L7 feature dataset, and select Import > Feature Class(es). As the name implies, this tool makes it possible to import a list of shapefiles, coverages, or feature classes. It doesn't provide the flexibility of importing a subset of records or customizing the output fields, so you'd use this tool only if you have no need for those options.
  11. For the Input Features, browse to and select the counties and us_cities shapefiles – you can hold the Ctrl key to select them both at the same time..

    The Output Geodatabase should already be defined correctly, as your usa_L7 feature dataset.
  12. Click Run to begin the import process.

    This import is likely to take a bit of time because of the volume of vertices in the counties shapefile.

    Unlike the single feature class tool, it will not automatically add the new feature classes to the map.  

    Also, because you already added a us_cities feature class in Lesson 6, ‘_1’  will be added to the us_cities feature class you're importing now.  Regardless of the fact that this feature class is in a different feature dataset, it is being stored as a table in the same SQL Server schema, so it must have a different name.

    Of course, it's also possible to import stand-alone (non-spatial) attribute data tables to your geodatabase. We didn't see options for that above because we had right-clicked on a feature dataset, which is designed to store only feature classes (tables with geometry).
  13. Right-click on your census_egdb connection (made back in Lesson 6), and hover your mouse over the Import menu. You should now see options for importing a single or multiple tables.

Recall from the last lesson that users created using the Create Database User tool are able to load data and create new feature classes from scratch, and that it's considered a best practice to limit these capabilities to administrative staff.  We used SQL Server Management Studio to create users who we didn't want to grant data loading ability.

Speaking of creating new tables from scratch, let's take a look at that workflow in the next section.

Always remember to Stop your EC2 Instance when you finish or when you take a long break.