Creating a Spatial Table for a Read/Write Connection
If a spatial table is to be used with OpenCities Map using a read/write connection, the primary key and sequence requirements need to be met.
The following is an example of a CREATE TABLE statement with a primary key followed by a CREATE SEQUENCE:
CREATE TABLE "PARCELS" (Owner VARCHAR2(20), Market_Value VARCHAR2(10), Parcel_ID NUMBER PRIMARY KEY, Geometry MDSYS.SDO_GEOMETRY); CREATE SEQUENCE PARCELS_SEQ START WITH 1001 INCREMENT BY 1;
This table has a numeric unique identifier (Parcel_ID). Note that the primary key here is explicitly named using the <table name>_pk naming convention, where pk is the acronym for "primary key".
In dealing with OpenCities Map in a read/write setting, Oracle will be in control of assigning unique identifiers to the table’s rows. For new entries into the table it will use the sequence to generate a unique identifier. The <table name>_seq naming convention is used for sequences, with seq representing "sequence". This is not compulsory, but it helps in understanding the connection between the different entities in the database.
If a table with spatial data fits the extraction and read/write requirements, it should be possible to either:
- 'Discover' this
table and define it as a feature and store it as part of a XFM schema using
OpenCities Geospatial Administrator.
OpenCities Map can then be loaded with
this schema to extract/modify/post data from/to the table.
OR
- Interactively connect to the Oracle database, and extract/modify/post data from/to the table on-the-fly.