IDA LOADGEOSPATIALDATA command

The IDA LOADGEOSPATIALDATA CLPPlus command loads geospatial data to a table in your database.

A shapefile set contains all the data needed to precisely and unambiguously specify the position of an object in space. However, to store this data in the database, an additional database object called a spatial reference system (SRS) is needed. If you plan to use the loaded data in a query that uses geospatial data contained in other tables, it is recommended that you use the same SRS for all of these tables.

Invocation

You must run this command from the CLPPlus interface.

Authorization

None

Required connection

CLPPlus must be connected to the database.

Command syntax

IDA LOADGEOSPATIALDATA

Read syntax diagramSkip visual syntax diagramIDA LOADGEOSPATIALDATAFILEfile_nameTABLEtable_nameSRSNAMEsrs_nameSRSSCALEintegerMODEAPPENDCOLUMNcolumn_nameMODENEW

Parameters

FILE
The fully-qualified name of the compressed file that contains the shapefile set that is to be loaded. This file must be in the local file system, accessible to the CLPPlus user, and of one of the following types:
  • tar.gz
  • tar
  • zip
This file must include a shapefile set that contains the following files:
Format Extension Contents Required or Optional
Shape .shp The feature geometry Required
Attribute .dbf A columnar attribute for each shape Required
Index .shx A ositional index of the feature geometry Optional
Projection .prj The coordinate system and projection information Optional
Each file must have the same base name (for example, geodata.shp, geodata.dbf, geodata.shx, and geodata.prj,).
TABLE
The name of the table into which the geospatial data is to be loaded. This can be either an existing table to which the data is to be appended or a new table.
MODE
If a table with the specified name:
  • Already exists:
    NEW
    Cancel the load operation and do not change the existing table. This is the default.
    APPEND
    Append the data to be loaded to the existing data in the table.
  • Does not already exist:
    NEW
    Create the new table. This is the default.
    APPEND
    Cancel the operation.
COLUMN
The name of the column in the table to which the geospatial data is to be uploaded. If the table into which data is to be loaded is new, this parameter is mandatory; otherwise, this parameter is ignored and the spatial column of the existing table is used.
SRSNAME
The name of the spatial reference system (SRS) that is to be associated with the table. If the table into which data is to be loaded:
  • Is new or does not already have an SRS registered to it, specify this parameter if either:
    • Several of the SRSs registered in the database are compatible with the data being uploaded, and you want to specify which of these SRSs the new table is to use.
    • None of the SRSs registered in the database are compatible with the data being uploaded, and you want to create a new SRS for the data being uploaded and to associate this new SRS with the new table.
    If the specified SRS name matches a registered SRS, the spatial data is loaded using that SRS. Otherwise, a new SRS with the specified name is created and the spatial data is loaded using this new SRS.
  • Already exists and already has an SRS registered to it, this parameter is ignored and that SRS is used.
The default behavior depends on the number of compatible SRSs that are registered in the database:
  • If only one of the SRSs registered in the database is compatible with the data being uploaded, that SRS is used.
  • If more than one SRS is compatible with the data being uploaded, an error message is issued. The message lists all compatible SRSs and instructs the user to reenter the command and to use the SRSNAME parameter to specify which of the listed SRSs is to be used for the new table.
  • If none of the SRSs registered in the database are compatible, the SRSNAME parameter is mandatory. An error message instructs the user to reenter the command and to specify the SRSNAME parameter.
SRSSCALE
An integer value that is used to resolve the spatial coordinate information in the shape file to an integer value so as to avoid overlapping of spatial coordinates when they are converted to an internal representation for storage.
If the table into which data is to be loaded:
  • Is new or does not already have an SRS registered to it, this command calculates a default scale factor based on its analysis of the input data. Specify this parameter if you want to override that default, for example, because you know that data that will be loaded into the table later will have a higher precision than the data that is currently being loaded.
  • Already exists and already has an SRS registered to it, this parameter is ignored and the scale factor of the existing SRS is used.

Examples

The following command loads geospatial data into an existing table with the name gd1.
IDA LOADGEOSPATIALDATA FILE gsd5.zip TABLE gd1 MODE APPEND
The following command loads geospatial data into a new table with the name gd2. It uses an existing SRS with the name WGS84_SRS_1003.
IDA LOADGEOSPATIALDATA FILE gsd5.zip TABLE gd2 MODE NEW 
  COLUMN geodat SRSNAME WGS84_SRS_1003
The following command loads geospatial data into a new table with the name gd3. It creates a new SRS with the name MYSRS and sets the scale factor to 50000.
IDA LOADGEOSPATIALDATA FILE gsd5.zip TABLE gd3 MODE NEW 
  COLUMN geodat SRSNAME MYSRS SRSSCALE 50000