Jorge,<br><br>I'm not aware much about the changes in the gdal2wktraster script, I can see a r4226 which may be related to the problem. Please consult with the author Mateusz Loskot about the possible reasons you've encountered with the script.<br>
<br>I'll be trying to reproduce your appcrash and gather further information abot the details soon.<br><br>Best regards,<br><br>Tamas<br><br><br><br><div class="gmail_quote">2009/7/4 Jorge Arévalo <span dir="ltr"><<a href="mailto:jorge.arevalo@gmail.com">jorge.arevalo@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello,<br><br>I have two versions of GDAL in my machine:<br><br>- GDAL 1.7.0 from SVN<br>- GDAL 1.7.0 with the WKT Raster driver I'm developing<br>
<br>Today, I've updated the wktraster code from svn. I have the revision 4256. The last one. With this revision, there is a new version of gdal2wktraster script. <br>
<br>I loaded this image <a href="ftp://ftp.remotesensing.org/geotiff/samples/gdal_eg/cea.tif" target="_blank">ftp://ftp.remotesensing.org/geotiff/samples/gdal_eg/cea.tif</a> with and old version of gdal2wktraster, that allowed GDAL to select the block size for the tiles. Then, I could load the image with default tiles of 514x15, 35 tiles. <br>
<br>But with the new version of the script, I have to specify the block size by hand. For example, 514x15 (or 100x100). When I try this:<br><br>gdal2wktraster.py -r cea.tif -t table_name -s 4267 -b 1 -k 514x15 -I -M -o output.sql -v<br>
<br>I get this error:<br><br>ERROR 7: Assertion `FALSE' failed<br>in file `gdaldrivermanager.cpp', line 309<br><br>Reviewing the code, I saw that the last script's instruction called is:<br><br>pixels = band.ReadAsArray(xoff, yoff, valid_read_block_size[0], valid_read_block_size[1],<br>
                                  target_block_size[0], target_block_size[1])<br><br>That, somehow, should call the method "GDALDriverManager::RegisterDriver( GDALDriver * poDriver )" from gdalmanager.cpp. The code of the method is this:<br>
<br>int GDALDriverManager::RegisterDriver( GDALDriver * poDriver )<br>{<br>    CPLMutexHolderD( &hDMMutex );<br><br>/* -------------------------------------------------------------------- */<br>/*      If it is already registered, just return the existing           */<br>
/*      index.                                                          */<br>/* -------------------------------------------------------------------- */<br>    if( GetDriverByName( poDriver->GetDescription() ) != NULL )<br>
    {<br>        int             i;<br><br>        for( i = 0; i < nDrivers; i++ )<br>        {<br>            if( papoDrivers[i] == poDriver )<br>            {<br>                return i;<br>            }<br>        }<br>
<br>        CPLAssert( FALSE ); // -------> THE LINE THAT CAUSES THE CRASH *******************************************<br>    }<br>    <br>/* -------------------------------------------------------------------- */<br>
/*      Otherwise grow the list to hold the new entry.                  */<br>
/* -------------------------------------------------------------------- */<br>    papoDrivers = (GDALDriver **)<br>        VSIRealloc(papoDrivers, sizeof(GDALDriver *) * (nDrivers+1));<br><br>    papoDrivers[nDrivers] = poDriver;<br>
    nDrivers++;<br><br>    if( poDriver->pfnCreate != NULL )<br>        poDriver->SetMetadataItem( GDAL_DCAP_CREATE, "YES" );<br>    <br>    if( poDriver->pfnCreateCopy != NULL )<br>        poDriver->SetMetadataItem( GDAL_DCAP_CREATECOPY, "YES" );<br>
<br>    int iResult = nDrivers - 1;<br><br>    return iResult;<br>}<br><br>So, basically, with the base 1.7.0 version of GDAL, I can load the TIFF file. With my version, crash in the previous method. Clearly, it's my driver's problem, but I don't know why. I have a test code to create a dataset using my driver and works... Why could the application crash when trying to list the registered drivers while loading a TIFF file? I have the TIFF driver loaded in my GDAL version.<br>
<br>Thanks in advance,<br><br>Best regards<br>Jorge<br clear="all"><br><a href="http://www.brainyquote.com/quotes/authors/p/paula_poundstone.html" target="_blank">Paula Poundstone</a>  - "I don't have a bank account because I don't know my mother's maiden name."
<br>_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br></blockquote></div><br>