The following articles mainly introduce the initialization of the actual operations of Oracle spatial Space Data Tables. when the project is completed, we plan to summarize the experiences of Oracle spatial, first, we will describe it in the simplest way. The following is the specific content analysis of the article.
Oracle spatial Space Data Table Initialization
SQL code
1. Modify the table structure
- ALTER TABLE Dev_Acrossbox
- ADD (
- LOCATION MDSYS.SDO_GEOMETRY default null ,
- MI_STYLE VARCHAR2(254) default null ,
- MI_PRINX NUMBER(10) default null
- );
2. Insert METADATA attribute data
- INSERT INTO USER_SDO_GEOM_METADATA
- VALUES(
- 'DEV_TOWER_ACTL',
- 'location',
- MDSYS.SDO_DIM_ARRAY(
- MDSYS.SDO_DIM_ELEMENT('X',-180,180,0.0011119487),
- MDSYS.SDO_DIM_ELEMENT('Y',-90,90,0.0011119487)
- ),
- 8307
- );
3. Create a spatial index
- CREATE INDEX IDX_SPATIAL_Dev_Acrossbox
- ON Dev_Acrossbox (location)
- INDEXTYPE IS MDSYS.SPATIAL_INDEX;
4. Oracle spatial Space Data Table initialization: Execute PL/SQL
Line
- declare
- v_type MAPINFO_MAPCATALOG%rowtype;
- begin
- select * into v_type from mapinfo_mapcatalog m where m.tablename='LINE_INFO' and m.ownername='POSTGIS' ;
- v_type.tablename:=&new_tableName;
- insert into MAPINFO_MAPCATALOG values v_type ;
- commit;
- dbms_output.put_line(v_type.tablename);
- end;
Point
- declare
- v_type MAPINFO_MAPCATALOG%rowtype;
- begin
- select * into v_type from mapinfo_mapcatalog m where m.tablename='DEV_TRANSTATION' and m.ownername='POSTGIS' ;
- v_type.tablename:=&new_tableName;
- insert into MAPINFO_MAPCATALOG values v_type ;
- commit;
- dbms_output.put_line(v_type.tablename);
- end;
1. Modify the table structure
- ALTER TABLE Dev_Acrossbox
- ADD (
- LOCATION MDSYS.SDO_GEOMETRY default null ,
- MI_STYLE VARCHAR2(254) default null ,
- MI_PRINX NUMBER(10) default null
- );
The above content is an introduction to the initialization of Oracle spatial Space Data Tables.