Actual operations on Oracle spatial Space Data Table Initialization

Source: Internet
Author: User

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

 
 
  1. ALTER TABLE Dev_Acrossbox  
  2. ADD (  
  3. LOCATION MDSYS.SDO_GEOMETRY default null ,  
  4. MI_STYLE VARCHAR2(254) default null ,  
  5. MI_PRINX NUMBER(10) default null  
  6. );  

2. Insert METADATA attribute data

 
 
  1. INSERT INTO USER_SDO_GEOM_METADATA  
  2. VALUES(  
  3. 'DEV_TOWER_ACTL',  
  4. 'location',  
  5. MDSYS.SDO_DIM_ARRAY(  
  6. MDSYS.SDO_DIM_ELEMENT('X',-180,180,0.0011119487),  
  7. MDSYS.SDO_DIM_ELEMENT('Y',-90,90,0.0011119487)  
  8. ),  
  9. 8307  
  10. );  

3. Create a spatial index

 
 
  1. CREATE INDEX IDX_SPATIAL_Dev_Acrossbox  
  2. ON Dev_Acrossbox (location)  
  3. INDEXTYPE IS MDSYS.SPATIAL_INDEX;  

4. Oracle spatial Space Data Table initialization: Execute PL/SQL

Line

 
 
  1. declare  
  2. v_type MAPINFO_MAPCATALOG%rowtype;  
  3. begin  
  4. select * into v_type from mapinfo_mapcatalog m where m.tablename='LINE_INFO' and m.ownername='POSTGIS' ;  
  5. v_type.tablename:=&new_tableName;  
  6. insert into MAPINFO_MAPCATALOG values v_type ;  
  7. commit;  
  8. dbms_output.put_line(v_type.tablename);  
  9. end;  

Point

 
 
  1. declare  
  2. v_type MAPINFO_MAPCATALOG%rowtype;  
  3. begin  
  4. select * into v_type from mapinfo_mapcatalog m where m.tablename='DEV_TRANSTATION' and m.ownername='POSTGIS' ;  
  5. v_type.tablename:=&new_tableName;  
  6. insert into MAPINFO_MAPCATALOG values v_type ;  
  7. commit;  
  8. dbms_output.put_line(v_type.tablename);  
  9. end;  

1. Modify the table structure

 
 
  1. ALTER TABLE Dev_Acrossbox  
  2. ADD (  
  3. LOCATION MDSYS.SDO_GEOMETRY default null ,  
  4. MI_STYLE VARCHAR2(254) default null ,  
  5. MI_PRINX NUMBER(10) default null  
  6. );   

The above content is an introduction to the initialization of Oracle spatial Space Data Tables.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.