<div dir="ltr">Hello,<div><br></div><div><div>After Create() exists, SetProjection is called. For my given input, the variable pszProjectionRef has a value :</div><div>PROJCS["WGS 84 / UTM zone 44N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4326"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",81],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","32644"]]<br>

</div><div><br></div><div>This value is different from the value present in the PostGIS spatial_ref_sys table which is: </div><div>PROJCS["WGS 84 / UTM zone 44N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",81],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],AUTHORITY["EPSG","32644"],AXIS["Easting",EAST],AXIS["Northing",NORTH]]<br>

</div><div><br></div><div>I found the below solution [1] to get proj4text from srtext which can be converted to srid. Any alternate suggestions?</div></div><div><br></div><div>[1]  <a href="http://gis.stackexchange.com/questions/95831/how-can-i-get-proj4text-from-srtext">http://gis.stackexchange.com/questions/95831/how-can-i-get-proj4text-from-srtext</a></div>

<div><br></div><div>Regards,</div><div>Varun Saraf</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 5, 2014 at 2:32 AM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@mines-paris.org" target="_blank">even.rouault@mines-paris.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Le lundi 04 août 2014 22:53:03, Varun Saraf a écrit :<br>
> Hello,<br>
><br>
<div class="">> Commenting poDriver->pfnCreateCopy doesn't seem to work. It is still<br>
> calling the CreateCopy() method.<br>
<br>
</div>Check twice... How could GDAL call PostgisRasterDataset::CreateCopy() is<br>
nothing points to it ?<br>
<div class="HOEnZb"><div class="h5"><br>
> I will try doing the testing with a script<br>
> and get back to you.<br>
><br>
> Regards,<br>
> Varun Saraf<br>
><br>
><br>
> On Tue, Aug 5, 2014 at 2:12 AM, Even Rouault <<a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a>><br>
><br>
> wrote:<br>
> > Le lundi 04 août 2014 22:38:20, Varun Saraf a écrit :<br>
> > > Hello,<br>
> > ><br>
> > > Thank you for this information. I will explicitly call Create() using a<br>
> > > script. Is the IWriteBlock method to be tested in a similar manner?<br>
> > > Note that pData buffer is passed to this method as an argument, which<br>
> > > I will have to generate and pass to it. Any suggestions how I should<br>
> > > generate<br>
> ><br>
> > this<br>
> ><br>
> > > pData buffer?<br>
> ><br>
> > Well, any data might do.<br>
> > But based on my previous note regarding the generic GDAL core<br>
> > CreateCopy() implementation, another possibility for your testing is to<br>
> > temporarily comment<br>
> > poDriver->pfnCreateCopy = .... and use gdal_translate.<br>
> ><br>
> > > Regards,<br>
> > > Varun Saraf<br>
> > ><br>
> > ><br>
> > > On Tue, Aug 5, 2014 at 1:44 AM, Even Rouault <<br>
> ><br>
> > <a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a>><br>
> ><br>
> > > wrote:<br>
> > > > Le lundi 04 août 2014 21:38:36, Varun Saraf a écrit :<br>
> > > > > Hello,<br>
> > > > ><br>
> > > > > Yes, the code on the github repository is the latest state. I was<br>
> > > > > trying the following input queries :<br>
> > > > ><br>
> > > > > (1) Assuming that my Create() will be called.<br>
> > > > > gdal_translate --debug ON -of PostGISRaster ~/GSoC/ap_clip5x5.tif<br>
> > > > ><br>
> > > > >  PG:"host=localhost port=5432 user=postgres password=postgres<br>
> > > > ><br>
> > > > > dbname=test123 table=newtable"<br>
> > > > ><br>
> > > > > (2) When that did not work, I tried the following (suggested by my<br>
> > > ><br>
> > > > mentor,<br>
> > > ><br>
> > > > > Jorge Arevalo) which didn't work either.<br>
> > > > > gdal_translate --debug ON -of PostGISRaster -outsize 50% 50%<br>
> > > > > ~/GSoC/ap_clip5x5.tif  PG:"host=localhost port=5432 user=postgres<br>
> > > > > password=postgres dbname=test123 table=newtable"<br>
> > > ><br>
> > > > gdal_translate will never call Create(), but only CreateCopy().<br>
> > > ><br>
> > > > You might want to call Create() directly with a Python script for<br>
> > > > example, or<br>
> > > > a sample C/C++ code. gdalwarp will call Create() too, but gdalwarp<br>
> > > > can potentially rewrite existing tiles, which can complicate your<br>
> > > > initial coding.<br>
> > > ><br>
> > > > > QuiteDelete() method is called in both cases and the following<br>
> > > > > error messages are shown<br>
> > > > > ERROR 1: Couldn't drop the table public.newtable: ERROR:  table<br>
> > > ><br>
> > > > "newtable"<br>
> > > ><br>
> > > > > does not exist<br>
> > > > > ERROR 6: PostGISRasterDataset::CreateCopy() only works on source<br>
> > > > > datasets that are PostGISRaster<br>
> > > ><br>
> > > > Yes, as the message implies, the current CreateCopy() implementation<br>
> ><br>
> > only<br>
> ><br>
> > > > works when the source dataset is a postgisraster dataset itself.<br>
> > > > As far as the error message "Couldn't drop ...",<br>
> > > > PostGISRasterDataset::Delete() should probably be more silent in case<br>
> ><br>
> > the<br>
> ><br>
> > > > dataset doesn't exist.<br>
> > > ><br>
> > > > Note that once you have a full feature Create() implementation (with<br>
> > > > working<br>
> > > > IWriteBlock() of course), CreateCopy() is no longer strictly needed,<br>
> > > > since there is generic implementation in GDAL core that will emulate<br>
> > > > CreateCopy() with Create() + IWriteBlock()<br>
> > > ><br>
> > > > > I even tried calling the Create() method directly from<br>
> > > > > CreateCopy(),<br>
> > > ><br>
> > > > since<br>
> > > ><br>
> > > > > that is being called, but again the same error message is being<br>
> > > > > printed.<br>
> > > > ><br>
> > > > > Regards,<br>
> > > > > Varun Saraf<br>
> > > > ><br>
> > > > > On Mon, Aug 4, 2014 at 11:33 PM, Even Rouault<br>
> > > > > <<a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a>><br>
> > > > ><br>
> > > > > wrote:<br>
> > > > > > Le lundi 04 août 2014 14:39:52, Varun Saraf a écrit :<br>
> > > > > > >  Hi,<br>
> > > > > > ><br>
> > > > > > > Below is my eleventh weekly report.<br>
> > > > > > ><br>
> > > > > > > *What did I do this week?*<br>
> > > > > > ><br>
> > > > > > >    - There are some issues with the calling of different<br>
> > > > > > >    methods. My<br>
> > > > > ><br>
> > > > > > method<br>
> > > > > ><br>
> > > > > > >    PostGISRasterDataset::Create() is not being called. Tried to<br>
> > > ><br>
> > > > resolve<br>
> > > ><br>
> > > > > > > that.<br>
> > > > > ><br>
> > > > > > Varun,<br>
> > > > > ><br>
> > > > > > If the code at<br>
> ><br>
> > <a href="https://github.com/varunsaraf/postgis_raster/blob/master/postgisrasterdat" target="_blank">https://github.com/varunsaraf/postgis_raster/blob/master/postgisrasterdat</a><br>
> ><br>
> > > > > > aset.cpp is the latest state, I don't see any reason why your<br>
> > > > > > Create() method wouldn't<br>
> > > > > > be called. Do you try to trigger it directly by calling Create()<br>
> > > > > > explicetely<br>
> > > > > > or through other more high level operations ?<br>
> > > > > ><br>
> > > > > > Even<br>
> > > > > ><br>
> > > > > > > - Fixed some small bugs and removed unnecessary variables that<br>
> ><br>
> > were<br>
> ><br>
> > > > > > > being used.<br>
> > > > > > ><br>
> > > > > > > *What do I plan on doing next week?*<br>
> > > > > > ><br>
> > > > > > >    - Continue with testing and bug fixing.<br>
> > > > > > ><br>
> > > > > > > *Am I blocked on anything?*<br>
> > > > > > ><br>
> > > > > > >    - No.<br>
> > > > > > ><br>
> > > > > > > Link to weekly report :<br>
> > > > > > > <a href="https://github.com/varunsaraf/postgis_raster/wiki/Report-11" target="_blank">https://github.com/varunsaraf/postgis_raster/wiki/Report-11</a><br>
> > > ><br>
> > > > > > > Link to code repository :<br>
> > > > <a href="https://github.com/varunsaraf/postgis_raster" target="_blank">https://github.com/varunsaraf/postgis_raster</a><br>
> > > ><br>
> > > > > > > More details at :<br>
> > > > <a href="http://trac.osgeo.org/gdal/wiki/PostGIS_raster_driver" target="_blank">http://trac.osgeo.org/gdal/wiki/PostGIS_raster_driver</a><br>
> > > ><br>
> > > > > > > Regards,<br>
> > > > > > > Varun Saraf<br>
> > > > > > > Lab for Spatial Informatics<br>
> > > > > > > IIIT Hyderabad, India<br>
> > > > > ><br>
> > > > > > --<br>
> > > > > > Geospatial professional services<br>
> > > > > > <a href="http://even.rouault.free.fr/services.html" target="_blank">http://even.rouault.free.fr/services.html</a><br>
> > > ><br>
> > > > --<br>
> > > > Geospatial professional services<br>
> > > > <a href="http://even.rouault.free.fr/services.html" target="_blank">http://even.rouault.free.fr/services.html</a><br>
> ><br>
> > --<br>
> > Geospatial professional services<br>
> > <a href="http://even.rouault.free.fr/services.html" target="_blank">http://even.rouault.free.fr/services.html</a><br>
<br>
--<br>
Geospatial professional services<br>
<a href="http://even.rouault.free.fr/services.html" target="_blank">http://even.rouault.free.fr/services.html</a><br>
</div></div></blockquote></div><br></div>