Using spatial views on tables with an ST_Geometry column

Spatial views are database views that include a spatial column.

One use for spatial views is to eliminate extra spatial columns so you can view the data in ArcGIS. Since you cannot register spatial tables that consist of more than one spatial column, using a spatial view of the table is your only option if you want to interact with the data through ArcGIS client applications.

When you define the view, you select only one of the spatial columns to include in the view.

The following is are examples of creating spatial views using SQL:

Creating a view with one spatial column

CREATE VIEW quake_v 
AS SELECT objectid,shape 
FROM quakes4;

In this example, a spatial view is created, and a spatial join is created on that view.

CREATE VIEW san_berdoo_quakes_v 
AS SELECT a.objectid, a.location, b.name
FROM quakes4 a, st_counties b
WHERE b.name = 'San Bernardino'
AND st_intersects(a.location,b.boundary)=1;

The following is the same example for a geodatabase in Informix:

CREATE VIEW san_berdoo_quakes_v 
AS SELECT a.objectid, a.location, b.name
FROM quakes4 a, st_counties b
WHERE b.name = 'San Bernardino'
AND st_intersects(a.location,b.boundary);

Related Topics

6/19/2015