Opened 6 years ago

Closed 6 years ago

#6412 closed defect (invalid)

Unable to read/load mbtiles in GDAL 2.0 in Anaconda 2.7 on Ubuntu EC2 instance

Reported by: edjansing Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: unspecified
Severity: normal Keywords:


Have Anaconda running Python 2.7 on Ubuntu EC2 instance. For this, I have the following packages installed:

# packages in environment at /home/ubuntu/anaconda2:
abstract-rendering        0.5.1               np110py27_0    defaults
affine                    1.2.0                    py27_0    defaults
alabaster                 0.7.7                    py27_0    defaults
anaconda                  2.5.0               np110py27_0    defaults
anaconda-client           1.2.2                    py27_0    defaults
argcomplete               1.0.0                    py27_1    defaults
astropy                   1.1.1               np110py27_0    defaults
babel                     2.2.0                    py27_0    defaults
backports-abc             0.4                       <pip>
backports.ssl-match-hostname                   <pip>
backports_abc             0.4                      py27_0    defaults
beautifulsoup4            4.4.1                    py27_0    defaults
bitarray                  0.8.1                    py27_0    defaults
blaze                     0.9.0                     <pip>
blaze-core                0.9.0                    py27_0    defaults
bokeh                     0.11.0                   py27_0    defaults
boto                      2.39.0                   py27_0    defaults
bottleneck                1.0.0               np110py27_0    defaults
cairo                     1.12.18                       6    defaults
cdecimal                  2.3                      py27_0    defaults
cffi                      1.2.1                    py27_0    defaults
click                     4.1                      py27_0    defaults
click-plugins             1.0.3                     <pip>
cligj                     0.2.0                    py27_0    defaults
clyent                    1.2.0                    py27_0    defaults
colorama                  0.3.6                    py27_0    defaults
conda                     4.0.2                    py27_0    defaults
conda-build               1.19.0                   py27_0    defaults
conda-env                 2.4.5                    py27_0    defaults
configobj                 5.0.6                    py27_0    defaults
cryptography              1.0.2                    py27_0    defaults
curl                      7.45.0                        0    defaults
cycler                    0.9.0                    py27_0    defaults
cython                    0.23.4                   py27_0    defaults
cytoolz                   0.7.5                    py27_0    defaults
datashape                 0.5.0                    py27_0    defaults
decorator                 4.0.6                    py27_0    defaults
descartes                 1.0.2                    py27_0    ioos
docutils                  0.12                     py27_0    defaults
dynd                      f641248                   <pip>
dynd-python               0.7.1                    py27_0    defaults
enum34                    1.1.2                    py27_0    defaults
et-xmlfile                1.0.1                     <pip>
et_xmlfile                1.0.1                    py27_0    defaults
fastcache                 1.0.2                    py27_0    defaults
fiona                     1.6.0               np110py27_0    defaults
flask                     0.10.1                   py27_1    defaults
fontconfig                2.11.1                        5    defaults
freetype                  2.5.5                         0    defaults
funcsigs                  0.4                      py27_0    defaults
futures                   3.0.3                    py27_0    defaults
gdal                      2.0.0                    py27_1    defaults
geopandas                 0.1.1                    py27_2    ioos
geopy                     1.10.0                   py27_0    ioos
geos                      3.4.2                         0    defaults
gevent                    1.0.2                    py27_0    defaults
gevent-websocket          0.9.5                    py27_0    defaults
greenlet                  0.4.9                    py27_0    defaults
grin                      1.2.1                    py27_1    defaults
h5py                      2.5.0               np110py27_4    defaults
hdf4                      4.2.11                        0    defaults
hdf5                                  2    defaults
idna                      2.0                      py27_0    defaults
ipaddress                 1.0.14                   py27_0    defaults
ipykernel                 4.2.2                    py27_0    defaults
ipython                   4.1.1                    py27_0    defaults
ipython-genutils          0.1.0                     <pip>
ipython-qtconsole         4.0.1                    py27_0    defaults
ipython_genutils          0.1.0                    py27_0    defaults
ipywidgets                4.1.1                    py27_0    defaults
itsdangerous              0.24                     py27_0    defaults
jbig                      2.1                           0    defaults
jdcal                     1.2                      py27_0    defaults
jedi                      0.9.0                    py27_0    defaults
jinja2                    2.8                      py27_0    defaults
jpeg                      8d                            0    defaults
jsonschema                2.4.0                    py27_0    defaults
jupyter                   1.0.0                    py27_1    defaults
jupyter-client            4.1.1                     <pip>
jupyter-console           4.1.0                     <pip>
jupyter-core              4.0.6                     <pip>
jupyter_client            4.1.1                    py27_0    defaults
jupyter_console           4.1.0                    py27_0    defaults
jupyter_core              4.0.6                    py27_0    defaults
kealib                    1.4.5                         0    defaults
krb5                      1.13.2                        0    defaults
libdynd                   0.7.1                         0    defaults
libffi                    3.0.13                        0    defaults
libgdal                   2.0.0                         2    defaults
libgfortran               1.0                           0    defaults
libnetcdf                              3    defaults
libpng                    1.6.17                        0    defaults
libsodium                 1.0.3                         0    defaults
libspatialindex           1.8.5                         1    ioos
libtiff                   4.0.6                         1    defaults
libxml2                   2.9.2                         0    defaults
libxslt                   1.1.28                        0    defaults
llvmlite                  0.8.0                    py27_0    defaults
lxml                      3.5.0                    py27_0    defaults
markupsafe                0.23                     py27_0    defaults
matplotlib                1.5.1               np110py27_0    defaults
mistune                   0.7.1                    py27_0    defaults
mkl                       11.3.1                        0    defaults
mkl-service               1.1.2                    py27_0    defaults
multipledispatch          0.4.8                    py27_0    defaults
nbconvert                 4.1.0                    py27_0    defaults
nbformat                  4.0.1                    py27_0    defaults
networkx                  1.11                     py27_0    defaults
nltk                      3.1                      py27_0    defaults
nose                      1.3.7                    py27_0    defaults
notebook                  4.1.0                    py27_0    defaults
numba                     0.23.1              np110py27_0    defaults
numexpr                   2.4.6               np110py27_1    defaults
numpy                     1.10.4                   py27_1    defaults
odo                       0.4.0                    py27_0    defaults
opencv                    2.4.10              np110py27_1    defaults
openjpeg                  2.1.0                         0    osgeo
openpyxl                  2.3.2                    py27_0    defaults
openssl                   1.0.2g                        0    defaults
pandas                    0.17.1              np110py27_0    defaults
patchelf                  0.8                           0    defaults                   8.1.2                    py27_1    defaults
patsy                     0.4.0               np110py27_0    defaults
pep8                      1.7.0                    py27_0    defaults
pexpect                   3.3                      py27_0    defaults
pickleshare               0.5                      py27_0    defaults
pillow                    3.1.0                    py27_0    defaults
pip                       8.1.0                    py27_0    defaults
pixman                    0.32.6                        0    defaults
ply                       3.8                      py27_0    defaults
postgresql                9.1.4                         1    defaults
proj4                     4.9.1                         0    defaults
protobuf                  3.0.0b2                  py27_0    jjhelmus
psutil                    3.4.2                    py27_0    defaults
psycopg2                  2.6.1                    py27_1    defaults
ptyprocess                0.5                      py27_0    defaults
py                        1.4.31                   py27_0    defaults
pyasn1                    0.1.9                    py27_0    defaults
pycairo                   1.10.0                   py27_0    defaults
pycosat                   0.6.1                    py27_0    defaults
pycparser                 2.14                     py27_0    defaults
pycrypto                  2.6.1                    py27_0    defaults
pycurl                           py27_0    defaults
pyflakes                  1.0.0                    py27_0    defaults
pygments                  2.1                      py27_0    defaults
pyopenssl                 0.15.1                   py27_1    defaults
pyparsing                 2.0.3                    py27_0    defaults
pyproj                            py27_0    ioos
pyqt                      4.11.4                   py27_1    defaults
pysal                     1.11.0                   py27_0    defaults
pytables                  3.2.2               np110py27_0    defaults
pytest                    2.8.5                    py27_0    defaults
python                    2.7.11                        0    defaults
python-dateutil           2.4.2                    py27_0    defaults
pytz                      2015.7                   py27_0    defaults
pyyaml                    3.11                     py27_1    defaults
pyzmq                     15.2.0                   py27_0    defaults
qt                        4.8.7                         1    defaults
qtconsole                 4.1.1                    py27_0    defaults
rasterio                  0.25.0              np110py27_0    defaults
readline                  6.2                           2    defaults
redis                     2.6.9                         0    defaults
redis-py                  2.10.3                   py27_0    defaults
requests                  2.9.1                    py27_0    defaults
rope                      0.9.4                    py27_1    defaults
rtree                     0.8.2                    py27_2    ioos
scikit-image              0.11.3              np110py27_0    defaults
scikit-learn              0.17                np110py27_2    defaults
scipy                     0.17.0              np110py27_1    defaults
seaborn                   0.7.0                    py27_0    defaults
setuptools                20.2.2                   py27_0    defaults
shapely                   1.5.13              np110py27_1    ioos
simplegeneric             0.8.1                    py27_0    defaults
singledispatch                    py27_0    defaults
sip                       4.16.9                   py27_0    defaults
six                       1.10.0                   py27_0    defaults
snowballstemmer           1.2.1                    py27_0    defaults
snuggs                    1.3.1               np110py27_0    defaults
sockjs-tornado            1.0.1                    py27_0    defaults
sphinx                    1.3.5                    py27_0    defaults
sphinx-rtd-theme          0.1.9                     <pip>
sphinx_rtd_theme          0.1.9                    py27_0    defaults
spyder                    2.3.8                    py27_0    defaults
spyder-app                2.3.8                    py27_0    defaults
sqlalchemy                1.0.11                   py27_0    defaults
sqlite                    3.9.2                         0    defaults
ssl_match_hostname                  py27_0    defaults
statsmodels               0.6.1               np110py27_0    defaults
sympy                             py27_0    defaults
tables                    3.2.2                     <pip>
tensorflow                0.7.1                    py27_1    jjhelmus
terminado                 0.5                      py27_1    defaults
tk                        8.5.18                        0    defaults
toolz                     0.7.4                    py27_0    defaults
tornado                   4.3                      py27_0    defaults
traitlets                 4.1.0                    py27_0    defaults
unicodecsv                0.14.1                   py27_0    defaults
util-linux                2.21                          0    defaults
werkzeug                  0.11.3                   py27_0    defaults
wheel                     0.29.0                   py27_0    defaults
xerces-c                  3.1.2                         0    defaults
xlrd                      0.9.4                    py27_0    defaults
xlsxwriter                0.8.4                    py27_0    defaults
xlwt                      1.0.0                    py27_0    defaults
xz                        5.0.5                         0    defaults
yaml                      0.1.6                         0    defaults
zeromq                    4.1.3                         0    defaults
zlib                      1.2.8                         0    defaults

When I try to read in an mbtiles file (using Rasterio as the front-end), I get the following error:

$ cat

import rasterio

with'/data/AmFam/nearmap20_20151123.mbtiles', 'r') as src:
	p1 = src.profile
$ python

Traceback (most recent call last):
  File "", line 3, in <module>
    with'/data/AmFam/nearmap20_20151123.mbtiles', 'r') as src:
  File "/home/ubuntu/anaconda2/lib/python2.7/site-packages/rasterio/", line 118, in open
  File "rasterio/_base.pyx", line 67, in rasterio._base.DatasetReader.start (rasterio/_base.c:2307)
  File "rasterio/_err.pyx", line 67, in rasterio._err.GDALErrCtxManager.__exit__ (rasterio/_err.c:944)
IOError: `/data/AmFam/nearmap20_20151123.mbtiles' not recognised as a supported file format.

Have a similar setup on OS X Macbook Pro, which leverages the Rasterio and GDAL packages to read in mbtile without difficulty.

Internet searches provide no useful information.

Change History (3)

comment:1 Changed 6 years ago by Even Rouault

Does "gdalinfo --format mbtiles" report the mbtiles driver in the EC2 instance ?

comment:2 Changed 6 years ago by edjansing

These are the formats that GDAL recognizes:

Supported Formats:
  VRT -raster- (rw+v): Virtual Raster
  GTiff -raster- (rw+vs): GeoTIFF
  NITF -raster- (rw+vs): National Imagery Transmission Format
  RPFTOC -raster- (rovs): Raster Product Format TOC format
  ECRGTOC -raster- (rovs): ECRG TOC format
  HFA -raster- (rw+v): Erdas Imagine Images (.img)
  SAR_CEOS -raster- (rov): CEOS SAR Image
  CEOS -raster- (rov): CEOS Image
  JAXAPALSAR -raster- (rov): JAXA PALSAR Product Reader (Level 1.1/1.5)
  GFF -raster- (rov): Ground-based SAR Applications Testbed File Format (.gff)
  ELAS -raster- (rw+v): ELAS
  AIG -raster- (rov): Arc/Info Binary Grid
  AAIGrid -raster- (rwv): Arc/Info ASCII Grid
  GRASSASCIIGrid -raster- (rov): GRASS ASCII Grid
  SDTS -raster- (rov): SDTS Raster
  DTED -raster- (rwv): DTED Elevation Raster
  PNG -raster- (rwv): Portable Network Graphics
  JPEG -raster- (rwv): JPEG JFIF
  MEM -raster- (rw+): In Memory Raster
  JDEM -raster- (rov): Japanese DEM (.mem)
  GIF -raster- (rwv): Graphics Interchange Format (.gif)
  BIGGIF -raster- (rov): Graphics Interchange Format (.gif)
  ESAT -raster- (rov): Envisat Image Format
  BSB -raster- (rov): Maptech BSB Nautical Charts
  XPM -raster- (rwv): X11 PixMap Format
  BMP -raster- (rw+v): MS Windows Device Independent Bitmap
  DIMAP -raster- (rov): SPOT DIMAP
  AirSAR -raster- (rov): AirSAR Polarimetric Image
  RS2 -raster- (ros): RadarSat 2 XML Product
  PCIDSK -raster,vector- (rw+v): PCIDSK Database File
  PCRaster -raster- (rw+): PCRaster Raster File
  ILWIS -raster- (rw+v): ILWIS Raster Map
  SGI -raster- (rw+): SGI Image File Format 1.0
  SRTMHGT -raster- (rwv): SRTMHGT File Format
  Leveller -raster- (rw+): Leveller heightfield
  Terragen -raster- (rw+): Terragen heightfield
  GMT -raster- (rw): GMT NetCDF Grid Format
  netCDF -raster- (rw+s): Network Common Data Format
  HDF4 -raster- (ros): Hierarchical Data Format Release 4
  HDF4Image -raster- (rw+): HDF4 Dataset
  ISIS3 -raster- (rov): USGS Astrogeology ISIS cube (Version 3)
  ISIS2 -raster- (rw+v): USGS Astrogeology ISIS cube (Version 2)
  PDS -raster- (rov): NASA Planetary Data System
  VICAR -raster- (rov): MIPL VICAR file
  TIL -raster- (rov): EarthWatch .TIL
  ERS -raster- (rw+v): ERMapper .ers Labelled
  L1B -raster- (rovs): NOAA Polar Orbiter Level 1b Data Set
  FIT -raster- (rwv): FIT Image
  GRIB -raster- (rov): GRIdded Binary (.grb)
  RMF -raster- (rw+v): Raster Matrix Format
  WCS -raster- (rovs): OGC Web Coverage Service
  WMS -raster- (rwvs): OGC Web Map Service
  MSGN -raster- (ro): EUMETSAT Archive native (.nat)
  RST -raster- (rw+v): Idrisi Raster A.1
  INGR -raster- (rw+v): Intergraph Raster
  GSAG -raster- (rwv): Golden Software ASCII Grid (.grd)
  GSBG -raster- (rw+v): Golden Software Binary Grid (.grd)
  GS7BG -raster- (rw+v): Golden Software 7 Binary Grid (.grd)
  COSAR -raster- (rov): COSAR Annotated Binary Matrix (TerraSAR-X)
  TSX -raster- (rov): TerraSAR-X Product
  COASP -raster- (ro): DRDC COASP SAR Processor Raster
  R -raster- (rwv): R Object Data Store
  MAP -raster- (rov): OziExplorer .MAP
  PNM -raster- (rw+v): Portable Pixmap Format (netpbm)
  DOQ1 -raster- (rov): USGS DOQ (Old Style)
  DOQ2 -raster- (rov): USGS DOQ (New Style)
  ENVI -raster- (rw+v): ENVI .hdr Labelled
  EHdr -raster- (rw+v): ESRI .hdr Labelled
  GenBin -raster- (rov): Generic Binary (.hdr Labelled)
  PAux -raster- (rw+): PCI .aux Labelled
  MFF -raster- (rw+v): Vexcel MFF Raster
  MFF2 -raster- (rw+): Vexcel MFF2 (HKV) Raster
  FujiBAS -raster- (ro): Fuji BAS Scanner Image
  GSC -raster- (rov): GSC Geogrid
  FAST -raster- (rov): EOSAT FAST Format
  BT -raster- (rw+v): VTP .bt (Binary Terrain) 1.3 Format
  LAN -raster- (rw+v): Erdas .LAN/.GIS
  CPG -raster- (ro): Convair PolGASP
  IDA -raster- (rw+v): Image Data and Analysis
  NDF -raster- (rov): NLAPS Data Format
  EIR -raster- (rov): Erdas Imagine Raw
  DIPEx -raster- (rov): DIPEx
  LCP -raster- (rwv): FARSITE v.4 Landscape File (.lcp)
  GTX -raster- (rw+v): NOAA Vertical Datum .GTX
  LOSLAS -raster- (rov): NADCON .los/.las Datum Grid Shift
  NTv2 -raster- (rw+vs): NTv2 Datum Grid Shift
  CTable2 -raster- (rw+v): CTable2 Datum Grid Shift
  ACE2 -raster- (rov): ACE2
  SNODAS -raster- (rov): Snow Data Assimilation System
  KRO -raster- (rw+v): KOLOR Raw
  ROI_PAC -raster- (rw+v): ROI_PAC raster
  ARG -raster- (rwv): Azavea Raster Grid format
  RIK -raster- (rov): Swedish Grid RIK (.rik)
  USGSDEM -raster- (rwv): USGS Optional ASCII DEM (and CDED)
  GXF -raster- (ro): GeoSoft Grid Exchange Format
  KEA -raster- (rw+): KEA Image Format (.kea)
  BAG -raster- (ro): Bathymetry Attributed Grid
  HDF5 -raster- (ros): Hierarchical Data Format Release 5
  HDF5Image -raster- (ro): HDF5 Dataset
  NWT_GRD -raster- (rov): Northwood Numeric Grid Format .grd/.tab
  NWT_GRC -raster- (rov): Northwood Classified Grid Format .grc/.tab
  ADRG -raster- (rw+vs): ARC Digitized Raster Graphics
  SRP -raster- (rovs): Standard Raster Product (ASRP/USRP)
  BLX -raster- (rw): Magellan topo (.blx)
  SAGA -raster- (rw+v): SAGA GIS Binary Grid (.sdat)
  KMLSUPEROVERLAY -raster- (rwv): Kml Super Overlay
  XYZ -raster- (rwv): ASCII Gridded XYZ
  HF2 -raster- (rwv): HF2/HFZ heightfield raster
  PDF -raster,vector- (w+): Geospatial PDF
  OZI -raster- (rov): OziExplorer Image File
  CTG -raster- (rov): USGS LULC Composite Theme Grid
  E00GRID -raster- (rov): Arc/Info Export E00 GRID
  ZMap -raster- (rwv): ZMap Plus Grid
  NGSGEOID -raster- (rov): NOAA NGS Geoid Height Grids
  IRIS -raster- (rov): IRIS data (.PPI, .CAPPi etc)
  PLMOSAIC -raster- (ro): Planet Labs Mosaics API
  PLSCENES -raster,vector- (ro): Planet Labs Scenes API
  HTTP -raster,vector- (ro): HTTP Fetching Wrapper

mbtiles does not seem to be in there. How do I get the format driver for mbtiles installed? Can it be done through conda?

comment:3 Changed 6 years ago by Even Rouault

Resolution: invalid
Status: newclosed

This means that GDAL in conda has been built without sqlite3 support. That should be reported to the people that package GDAL in conda.

Closing here as it is not a bug in GDAL itself, but a packaging issue out of GDAL project control.

Note: See TracTickets for help on using tickets.