Viewing database data in ArcGIS
You can view the data in your database tables by dragging them from the Catalog window in ArcMap to the table of contents or previewing them in ArcCatalog.
When you drag a feature class (spatial table) or table into ArcMap, it creates a query layer. To define the query layer, ArcMap does the following:
- It queries the database for information about the table, such as dimensionality, spatial reference, and geometry type.
- If that information is not defined for the table as a whole, ArcMap reads the first row in the table and uses the information from that feature.
- If the spatial reference, geometry type, or dimensionality cannot be determined by looking at the first row—for example, if the table doesn't contain data or the row is using a custom spatial reference—you will be prompted to supply this information to use for the layer definition.
- ArcMap queries the database to find a not null column that can be used as a unique identifier (ObjectID) for the rows in the specific table. If a qualifying row cannot be found, you will be prompted to define an ObjectID for the table.
- Lastly, ArcMap calculates the extent of the layer when you add it to the map.
A query layer is defined to allow ArcGIS to work with your data. There are some rules ArcGIS has for working with data:
- Data types that do not map to an ArcGIS data type will not appear in ArcGIS. (In other words, they are not included in the query definition.)
- Feature classes must contain one type of geometry: either points, lines, or polygons. As mentioned, ArcMap determines the geometry type from the table metadata or from the first row. Only features of that type will be displayed.
- Feature classes must use one spatial reference. ArcMap either determines that from the table metadata, the first row in the table, or uses the information you provided.
- Feature classes can contain only one spatial column. The first spatial column that ArcMap comes to is the one that will be used.
However, because what gets displayed in ArcMap is based on a query layer, you can open the query layer definition and change it. For example, if your feature class contains both points and polygons, you can open the query layer definition and choose which geometry type to display. Similarly, if your feature class contains multiple spatial columns, you can open the query layer definition and change the query to include one of the other spatial columns instead. Be aware, though, that the query cannot be altered to display unsupported data types.
The following steps describe how you can view your data in ArcMap.
Start ArcMap, open the Catalog window, then connect to your database.
You see a list of tables to which you have access in the database. Tables that contain a spatial column (feature classes) have a table icon with a square at the bottom .
- Click the table in the Catalog tree to select it.
If the data contains a spatial column, double-click the table to connect to it. The icon changes to reflect the geometry type that ArcMap has determined is stored in the table.
- To view the data, drag the table from the Catalog window in ArcMap to the table of contents.
- As described previously, if ArcMap cannot determine some of the information necessary to define the query layer, the New Query Layer dialog box will open to allow you to define the missing information. Click Finish when you have provided the required information.
- If you dragged in a feature class, ArcMap calculates the spatial extent of the data.
- In many cases, you can let ArcMap complete its calculation; it likely will not take long and will be more accurate.
- If you are adding a feature class that contains a lot of features, though, extent calculation can take a while. If you know the extent of the data or want to use the extent of your spatial reference instead of waiting for the extent to be calculated, you can do so. Click the appropriate button on the Calculate Extent dialog box. If you click Input Extent, you must type a valid extent that includes all the features in the table. If you click Use Spatial Reference Extent, the data extent is set to the full extent of the spatial reference you are using.
The feature class (or table) is listed in the table of contents and spatial data is rendered on the map.
- To see the attribute data in both feature classes and tables, right-click the table in the table of contents and click Open.
If you need to change what data is displayed, open the query layer definition and change the properties or query. See Modifying a query layer for information on changing the properties and definition of a query layer.