1

I have a number of TIF files provided by Ordnance Survey (OS OpenMap Local) that I am trying to add to a sqlite database. The first line in my code creates the sqlite database and adds the first TIF but then then all the following lines produce the error below:

ERROR 6: New data has not the same SRS as existing data

These are the command lines I'm running within the SDKShell command window for GDAL release-1928-x64-gdal-3-3-1-mapserver-7-6-4:

gdal_translate -of Rasterlite -co "DRIVER=PNG" "c:\os\OS Open Map - Local (Raster)\se\se80se.tif" RASTERLITE:"C:\ConnectDBs\OpenMapLocal.sqlite",table=OpenMapLocal -expand RGB
gdal_translate -of Rasterlite -co "DRIVER=PNG" "c:\os\OS Open Map - Local (Raster)\se\se80sw.tif" RASTERLITE:"C:\ConnectDBs\OpenMapLocal.sqlite",table=OpenMapLocal -expand RGB
gdal_translate -of Rasterlite -co "DRIVER=PNG" "c:\os\OS Open Map - Local (Raster)\se\se90sw.tif" RASTERLITE:"C:\ConnectDBs\OpenMapLocal.sqlite",table=OpenMapLocal -expand RGB
gdal_translate -of Rasterlite -co "DRIVER=PNG" "c:\os\OS Open Map - Local (Raster)\sk\sk99sw.tif" RASTERLITE:"C:\ConnectDBs\OpenMapLocal.sqlite",table=OpenMapLocal -expand RGB

I have used similar command lines to convert other OS products that has been successful. I have tried specifying the SRS in the command line but still get the same error. I have searched online and can't find anything about this error.

Does anyone know how I can get these TIF files into the sqlite database?

Shev
  • 43
  • 4

2 Answers2

0

OS have a bad habit of assuming that everyone (including GDAL) knows that their data is shipped as EPSG:27700 - but you actually need to tell GDAL (and most everyone else) so add -s_srs epsg:277000 to your command line.

Ian Turton
  • 81,417
  • 6
  • 84
  • 185
0

I don't understand why this works but I have found that by first building a virtual table from the TIF files using gdalbuildvrt I am then able to successfully build a sqlite database from the vrt using gdal_translate.

Shev
  • 43
  • 4