Opened 15 years ago

Closed 15 years ago

#3098 closed enhancement (fixed)

georaster - cross schema data access

Reported by: ilucena Owned by: ilucena
Priority: normal Milestone: 1.7.0
Component: default Version: svn-trunk
Severity: normal Keywords: georaster
Cc:

Description

As a user pointed out, the GeoRaster identification string only allow access to a user's own data. But sometime a DBA grants permission to one user to at least read data from others. In that case a simple solution would be entering the schema name into the table_name field separated by a period "." , ex:

$ gdalinfo georaster:scott/tiger@orcl,spock.planets,globe,id=102

In that case, user scott could read the data from user spock's schema.

Change History (3)

comment:1 by ilucena, 15 years ago

Resolution: fixed
Status: newclosed

Implemented on r17526

Details:

  1. In order to access GeoRaster from other users/schema the name of the schema should be added to the table_name separated by a period "." on the GeoRaster identification string.
  1. That only applies for reading, not for writing
  1. For identification string based on RTD+RID it is not necessary to inform the other schema but it doesn't hurt if someone does it
  1. The implication on the SUB_DATASETS query is that in order to list all tables from others users the table_name should contain only the schema + "."

Examples:

List all the GeoRaster tables from schema "spock":

$ gdalinfo geor:scott/tiger@orcl,spock.
Driver: GeoRaster/Oracle Spatial GeoRaster
Files: none associated
Size is 512, 512
Coordinate System is `'
Subdatasets:
  SUBDATASET_1_NAME=georaster:scott,tiger,orcl,scott.PLANETS
  SUBDATASET_1_DESC=Table:scott.PLANETS 
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,  512.0)
Upper Right (  512.0,    0.0)
Lower Right (  512.0,  512.0)
Center      (  256.0,  256.0)

List all the GeoRaster rows on table planets column scene from schema "spock":

$ gdalinfo geor:scott/tiger@orcl,spock.planets,scene
Driver: GeoRaster/Oracle Spatial GeoRaster
Files: none associated
Size is 512, 512
Coordinate System is `'
Subdatasets:
  SUBDATASET_1_NAME=georaster:scott,tiger,orcl,scott.PLANETS_RDT,1
  SUBDATASET_1_DESC=DataTable:scott.PLANETS_RDT RasterId:1
  SUBDATASET_2_NAME=georaster:scott,tiger,orcl,scott.PLANETS_RDT,2
  SUBDATASET_2_DESC=DataTable:scott.PLANETS_RDT RasterId:2
  SUBDATASET_3_NAME=georaster:scott,tiger,orcl,scott.PLANETS_RDT,11
  SUBDATASET_3_DESC=DataTable:scott.PLANETS_RDT RasterId:11
  SUBDATASET_4_NAME=georaster:scott,tiger,orcl,scott.PLANETS_RDT,21
  SUBDATASET_4_DESC=DataTable:scott.PLANETS_RDT RasterId:21
  SUBDATASET_5_NAME=georaster:scott,tiger,orcl,scott.PLANETS_RDT,22
  SUBDATASET_5_DESC=DataTable:scott.PLANETS_RDT RasterId:22
  SUBDATASET_6_NAME=georaster:scott,tiger,orcl,scott.PLANETS_RDT,23
  SUBDATASET_6_DESC=DataTable:scott.PLANETS_RDT RasterId:23
  SUBDATASET_7_NAME=georaster:scott,tiger,orcl,scott.PLANETS_RDT,37
  SUBDATASET_7_DESC=DataTable:scott.PLANETS_RDT RasterId:37
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,  512.0)
Upper Right (  512.0,    0.0)
Lower Right (  512.0,  512.0)
Center      (  256.0,  256.0)

Convert the GeoRaster identified by Raster Data Table PLANETS_RDT and RasterId = 37 to a Geotiff file

$ gdal_translate georaster:scott,tiger,orcl,scott.PLANETS_RDT,37 output.tif
Input file size is 14336, 14336
0...10...20...30...40...50...60...70...80...90...100 - done.

Convert the GeoRaster identified a where clause:

$ gdal_translate georaster:scott,tiger,orcl,scott.planets,scene,id=102
Input file size is 14336, 14336
0...10...20...30...40...50...60...70...80...90...100 - done.

TODO: Add it to the documentation

comment:2 by ilucena, 15 years ago

Cc: warmerdam hobu removed
Resolution: fixed
Status: closedreopened

There are some erros on r17526 and we decided that the driver should also allow updating and inserting GeoRaster across different schema/users.

comment:3 by ilucena, 15 years ago

Resolution: fixed
Status: reopenedclosed

Committed revision 17533.

Examples of use:

Create table in a single schema (scott) and insert a new GeoRaster:

gdal_translate -of georaster 10.tif geor:scott/tiger@orcl,cities,view \
-co DESCRIPTION="(ID NUMBER, VIEW SDO_GEORASTER)" \
-co INSERT="(1,SDO_GEOR.INIT('cities_rdt',1))"

Grant permission to another user:

SQL> grant select,insert,update,delete on cities to spock;
SQL> grant select,insert,update,delete on cities_rdt to spock;

Insert a second GeoRaster in a single schema:

gdal_translate -of georaster 20.tif geor:scott/tiger@orcl,cities,view \
-co INSERT="(2,SDO_GEOR.INIT('cities_rdt',2))"

Insert a third GeoRaster as another user:

gdal_translate -of georaster 30.tif geor:spock/lion@orcl,scott.cities,scene \
-co INSERT="(3,SDO_GEOR.INIT('cities_rdt',3))"

Update one GeoRaster as another user:

gdal_translate -of georaster 101.tif geor:spock/lion@orcl,scott.cities,scene,id=1

Update one GeoRaster as another user using RDT/RID as identification:

gdal_translate -of georaster 102.tif geor:spock/lion@orcl,cities_rdt,2

I will update the documentation shortly.

Note: See TracTickets for help on using tickets.