2 Replies Latest reply: May 29, 2014 10:58 AM by Jeffrey Xie RSS

    Import GeoTIFF to GEORASTER, permission

    2682881

      Hello,

       

      I'm trying to import a GeoTIFF into Oracle Spatial. But it seems that I have rights problem.

       

      What I did :

      • I created the Georaster table (city_images, like in the Oracle documentation)
      • I created the raster data table (city_images_rdt)
      • I granted the permissions for my user (MDSYS) :

      call dbms_java.grant_permission('MDSYS','SYS:java.io.FilePermission', 'C:\test.tif', 'read' );

      • I created the procedure :

      create or replace

      procedure GEORASTERPROC(imgpath in varchar2) as

      geor SDO_GEORASTER;

      BEGIN

      INSERT INTO city_images values( 1, 'TIFF', sdo_geor.init('city_images_rdt') );

       

      SELECT image INTO geor FROM city_images WHERE image_id = 1 FOR UPDATE;

      sdo_geor.importFrom(geor, NULL, 'TIFF', 'file', "C:\test.tif");

      UPDATE city_images SET image = geor WHERE image_id = 1;

      COMMIT;

      END;


      And I have the following error :

      ORA-13464: error loading GeoRaster data : the Permission (java.io.FilePermission C:\test.tif read) has not been granted to MDSYS. The PL/SQL to grant this is dbms_java.grant_permission( 'MDSYS', 'SYS:java.io.FilePermission', 'C:\test.tif', 'read' )

      ORA-06512: at "MDSYS.MD", ligne 1723

      ORA-06512: at "MDSYS.MDERR", ligne 17

      ORA-06512: at "MDSYS.SDO_GEOR", ligne 5539

      ORA-06512: at line 12

      13464. 00000 -  "error loading GeoRaster data: %s"

      *Cause:    An internal error occurred while loading GeoRaster data into the database.

      *Action:   Check the error message for details.

       

       

      Thanks for your answers

      Best regards

        • 1. Re: Import GeoTIFF to GEORASTER, permission
          Ivan Lucena

          Hi there!

           

          I believe that your grant_permission call has the wrong parameter. I am not sure, but I usually have the folder name on the third parameter and 'read,write' on the forth.


          That is a lot of work to load an image but lucky there are some other easier way to load raster file formats into GeoRaster. You can, for example, download this ETL tool for free:  Oracle Spatial Sample Code . That has an UI where you can load tons of raster files simultaneously or individually.


          If you like command line tools there is also a full binary distribution of GDAL: GDAL - Geospatial Data Abstraction Library that comes with that. It works on Windows 32, 64 and Linux 64 on the ETL zip package. If you need it for OS X please let me know.


          Good luck.




          • 2. Re: Import GeoTIFF to GEORASTER, permission
            Jeffrey Xie

            MDSYS is system user for oracle spatial. You should/want to load images into another user schema, for example SCOTT. try the following:

             

            connect system/manager;

            call dbms_java.grant_permission('SCOTT','SYS:java.io.FilePermission',

              'C:\test.tif', 'read' );

            call dbms_java.grant_permission('MDSYS','SYS:java.io.FilePermission',

              'C:\test.tif', 'read' );

            or simply,

            call dbms_java.grant_permission('PUBLIC','SYS:java.io.FilePermission',

              'C:\*', 'read' );