[gdal-dev] mbtiles open failed

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] mbtiles open failed

weskerjiang
i download the gdal from osgeo4w,and i write a demo to open mbtiles file,my code is below

QString uri = "c:/test.mbtiles";
CPLErrorRest();
GDALDatasetH hDS = GDALOpen(uri.toUtf8().constData(),GA_ReadOnly);
if(!hDS)
{
    .......
}

the CPLGetLastErrorMsg() shows the error     "C:/test.mbtiles not recognized as a supported file format"
so what's wrong with it?  the mbtiles file is good ,i can open it in QGIS 3.0
why it saies not supported?

--------------------------------

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: mbtiles open failed

Even Rouault-2
On mercredi 4 avril 2018 11:03:34 CEST [hidden email] wrote:
> i download the gdal from osgeo4w,and i write a demo to open mbtiles file,my
> code is below
>
>
> QString uri = "c:/test.mbtiles";
>
> CPLErrorRest();

You probably lack a call  to GDALAllRegister(); here



--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev