Opened 11 years ago

Closed 11 years ago

#227 closed task (fixed)

[wktraster] Add out-db support in gdal2wktraster.py script

Reported by: jorgearevalo Owned by: jorgearevalo
Priority: high Milestone: WKTRaster 0.1.6
Component: raster Version: master
Keywords: Cc:

Description

Attached is a patch adding support for creating out-db rasters in gdal2wktraster.py script. Please review and correct it where needed.

Attachments (1)

gdal2wktraster_outdb_support.patch (15.6 KB) - added by jorgearevalo 11 years ago.

Download all attachments as: .zip

Change History (16)

comment:1 Changed 11 years ago by mloskot

Owner: changed from pracine to mloskot
Status: newassigned

Changed 11 years ago by jorgearevalo

comment:2 in reply to:  1 Changed 11 years ago by jorgearevalo

Replying to mloskot: I'm simplifying the patch. I'll post a new version ASAP

comment:3 Changed 11 years ago by mloskot

Jorge, that's great, thanks! So, I'm deferring review until the new version is attached. No rush!

comment:4 Changed 11 years ago by mloskot

Summary: Add out-db support in gdal2wktraster.py script[wktraster] Add out-db support in gdal2wktraster.py script

comment:5 Changed 11 years ago by pracine

Milestone: WKTRaster 0.1.6

comment:6 Changed 11 years ago by pracine

Priority: mediumhigh

comment:7 Changed 11 years ago by pracine

Owner: changed from mloskot to jorgearevalo
Status: assignednew

Now that Jorge has access to SVN he can apply the patch himself. If it's already done, please close the ticket.

comment:8 Changed 11 years ago by jorgearevalo

I've implemented this (function wkblify_band):

  • bandidx (band number) comes from caller method: wkblify_raster_level. 1-based index
  • the path to the external file is the same provided with the option "-r <raster_name>" when calling the loader

After this, I've commented these lines in rtpostgis.sql.in.c:

-- Verify out_db
-- TODO: Waiting for out-db rasters
--IF ( p_out_db = true ) THEN
-- RAISE EXCEPTION 'TODO: Outside database rasters not implemented yet';
-- RETURN 'fail';
--END IF;

Once re-compiled, I've correctly loaded a raster with outdb support doing this. Do you think the approximation is correct? If yes, I'll finish the out-db raster reading support in GDAL, and I'll test it (this is one of my GDAL tickets: http://trac.osgeo.org/gdal/ticket/3234

comment:9 Changed 11 years ago by jorgearevalo

Status: newassigned

comment:10 Changed 11 years ago by jorgearevalo

I've just committed this change (r5102). I'm testing it by WKT Raster GDAL driver (working on it). Waiting for comments to resolve the case.

comment:11 Changed 11 years ago by jorgearevalo

I forgot: I think this storage method only has sense if the raster table has 1 file, of size RasterXSize, RasterYSize. What do you think?

comment:12 Changed 11 years ago by pracine

This storage method makes sence mostly when a big raster dataset is cut into (JPEG) tiles for a web server. The web application first grab the path to the file list and then forward the tiles directly from the file system without reading the whole tiles from the database. This is supposed to be faster...

comment:13 in reply to:  11 Changed 11 years ago by jorgearevalo

Replying to jorgearevalo:

I forgot: I think this storage method only has sense if the raster table has 1 file, of size RasterXSize, RasterYSize. What do you think?

Sorry, I meant 1 row. Each out-db raster has to have 1 row, of RasterXSize, RasterYSize.

comment:14 Changed 11 years ago by mloskot

Jorge, I haven't tested but the commit looks good to me.

Just one note, I'd suggest to remove TODO comments when a feature is completed, instead of commenting out such comment. I mean the comment in rtpostgis.sql.in.c:539

comment:15 Changed 11 years ago by jorgearevalo

Resolution: fixed
Status: assignedclosed

Sure. I've deleted the commented code, TODO comment included (r5103). I close the ticket for now...

Note: See TracTickets for help on using tickets.