Creating spatial columns
Create spatial columns to store and retrieve spatial data.
Before you begin
- Ensure that your user ID holds the authorizations that are needed for the CREATE TABLE or ALTER TABLE statement.
- Choose a coordinate system and determine which spatial reference system to use for your data
About this task
You can create a spatial column into a new or an existing table. You can also create a spatial column when you import spatial data into a new or existing table.
Procedure
To create spatial columns:
Choose one of the following ways to create spatial columns:
- Use the Geospatial Load page to create a table with a spatial column. This process also populate the table with data from the shape files provided by you and automatically registers the spacial column. For more details, see Loading geospatial data.
- If you are importing spatial data from a shape file, use Db2® Spatial Extender to create a table and to provide this table with a column to hold the data. For more details, see Importing shape data to a new or existing table.
- Use the CREATE TABLE SQL statement to create a table with a spatial column.
- Use the ALTER TABLE SQL statement to add a spatial column to an existing table.
What to do next
If you use the CREATE TABLE or the ALTER TABLE statement to create your spatial columns, you must register them to ensure that all geometries use the specified spatial reference system.
After creating your spatial columns, register them to ensure that all geometries use the specified spatial reference system.