[gdal-dev] GSoC 2014 Weekly Report 11 : GDAL PostGIS Raster driver

Even Rouault even.rouault at mines-paris.org
Mon Aug 4 13:14:45 PDT 2014


Le lundi 04 août 2014 21:38:36, Varun Saraf a écrit :
> Hello,
> 
> Yes, the code on the github repository is the latest state. I was trying
> the following input queries :
> 
> (1) Assuming that my Create() will be called.
> gdal_translate --debug ON -of PostGISRaster ~/GSoC/ap_clip5x5.tif
>  PG:"host=localhost port=5432 user=postgres password=postgres
> dbname=test123 table=newtable"
> 
> (2) When that did not work, I tried the following (suggested by my mentor,
> Jorge Arevalo) which didn't work either.
> gdal_translate --debug ON -of PostGISRaster -outsize 50% 50%
> ~/GSoC/ap_clip5x5.tif  PG:"host=localhost port=5432 user=postgres
> password=postgres dbname=test123 table=newtable"

gdal_translate will never call Create(), but only CreateCopy().

You might want to call Create() directly with a Python script for example, or 
a sample C/C++ code. gdalwarp will call Create() too, but gdalwarp can 
potentially rewrite existing tiles, which can complicate your initial coding.

> 
> QuiteDelete() method is called in both cases and the following error
> messages are shown
> ERROR 1: Couldn't drop the table public.newtable: ERROR:  table "newtable"
> does not exist
> ERROR 6: PostGISRasterDataset::CreateCopy() only works on source datasets
> that are PostGISRaster

Yes, as the message implies, the current CreateCopy() implementation only 
works when the source dataset is a postgisraster dataset itself.
As far as the error message "Couldn't drop ...",  
PostGISRasterDataset::Delete() should probably be more silent in case the 
dataset doesn't exist.

Note that once you have a full feature Create() implementation (with working 
IWriteBlock() of course), CreateCopy() is no longer strictly needed, since 
there is generic implementation in GDAL core that will emulate CreateCopy() 
with Create() + IWriteBlock()

> 
> I even tried calling the Create() method directly from CreateCopy(), since
> that is being called, but again the same error message is being printed.
> 
> Regards,
> Varun Saraf
> 
> On Mon, Aug 4, 2014 at 11:33 PM, Even Rouault
> <even.rouault at mines-paris.org>
> 
> wrote:
> > Le lundi 04 août 2014 14:39:52, Varun Saraf a écrit :
> > >  Hi,
> > > 
> > > Below is my eleventh weekly report.
> > > 
> > > *What did I do this week?*
> > > 
> > >    - There are some issues with the calling of different methods. My
> > 
> > method
> > 
> > >    PostGISRasterDataset::Create() is not being called. Tried to resolve
> > > 
> > > that.
> > 
> > Varun,
> > 
> > If the code at
> > 
> > https://github.com/varunsaraf/postgis_raster/blob/master/postgisrasterdat
> > aset.cpp is the latest state, I don't see any reason why your Create()
> > method wouldn't
> > be called. Do you try to trigger it directly by calling Create()
> > explicetely
> > or through other more high level operations ?
> > 
> > Even
> > 
> > > - Fixed some small bugs and removed unnecessary variables that were
> > > being used.
> > > 
> > > *What do I plan on doing next week?*
> > > 
> > >    - Continue with testing and bug fixing.
> > > 
> > > *Am I blocked on anything?*
> > > 
> > >    - No.
> > > 
> > > Link to weekly report :
> > > https://github.com/varunsaraf/postgis_raster/wiki/Report-11
> > > Link to code repository : https://github.com/varunsaraf/postgis_raster
> > > More details at : http://trac.osgeo.org/gdal/wiki/PostGIS_raster_driver
> > > 
> > > Regards,
> > > Varun Saraf
> > > Lab for Spatial Informatics
> > > IIIT Hyderabad, India
> > 
> > --
> > Geospatial professional services
> > http://even.rouault.free.fr/services.html

-- 
Geospatial professional services
http://even.rouault.free.fr/services.html


More information about the gdal-dev mailing list