I'm trying to get a large number of GeoTiff files into a geopackage for a project we'll be using QField for. Ideally, I'd like to batch the process, but in testing small samples out I'm running into problems with single images from the original data. Here's an example of the problem:
The command:
C:\OSGeo4W64\bin>gdal_translate --config OGR_SQLITE_SYNCHRONOUS OFF
-co APPEND_SUBDATASET=YES -co TILE_FORMAT=PNG_JPEG -a_srs EPSG:26917
-of GPKG "C:[Path]\ORTH175670482202017FBS.tif" "C:[Path]\ORTH175670482202017FBS.gpkg"
The result:
Input file size is 10020, 10020
0ERROR 1: RASTER_TABLE must be set to a non empty value
I am fairly certain that the rasters have data tables - the output for gdalinfo on the file looks legitimate (see below), but I really wouldn't know any different since this is a new level of GIS data manipulation for me.
What is this problem, and is there any way to fix it?
I'm running in a Windows environment (Windows 7), using OSGeo4W/QGIS 2.18.13.
gdalinfo output:
C:\OSGeo4W64\bin>gdalinfo "C:[Path]\ORTH175670482202017FBS.tif
"
Driver: GTiff/GeoTIFF
Files: C:\Users\James\Milton_Tiff\ORTH175670482202017FBS.tif
Size is 10020, 10020
Coordinate System is:
PROJCS["NAD83 / UTM zone 17N",
GEOGCS["NAD83",
DATUM["North_American_Datum_1983",
SPHEROID["GRS 1980",6378137,298.257222101,
AUTHORITY["EPSG","7019"]],
TOWGS84[0,0,0,0,0,0,0],
AUTHORITY["EPSG","6269"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.0174532925199433,
AUTHORITY["EPSG","9122"]],
AUTHORITY["EPSG","4269"]],
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"]],
AXIS["Easting",EAST],
AXIS["Northing",NORTH],
AUTHORITY["EPSG","26917"]]
Origin = (566999.000000000000000,4823001.000000000000000)
Pixel Size = (0.100000000000000,-0.100000000000000)
Metadata:
AREA_OR_POINT=Area
TIFFTAG_RESOLUTIONUNIT=1 (unitless)
TIFFTAG_XRESOLUTION=0
TIFFTAG_YRESOLUTION=0
Image Structure Metadata:
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left ( 566999.000, 4823001.000) ( 80d10'13.73"W, 43d33'25.04"N)
Lower Left ( 566999.000, 4821999.000) ( 80d10'14.18"W, 43d32'52.56"N)
Upper Right ( 568001.000, 4823001.000) ( 80d 9'29.07"W, 43d33'24.71"N)
Lower Right ( 568001.000, 4821999.000) ( 80d 9'29.53"W, 43d32'52.24"N)
Center ( 567500.000, 4822500.000) ( 80d 9'51.63"W, 43d33' 8.64"N)
Band 1 Block=10020x1 Type=Byte, ColorInterp=Red
Band 2 Block=10020x1 Type=Byte, ColorInterp=Green
Band 3 Block=10020x1 Type=Byte, ColorInterp=Blue
Band 4 Block=10020x1 Type=Byte, ColorInterp=Undefined
gdal_translate -of GPKG new.tif existing.gpkg -co APPEND_SUBDATASET=YES -co RASTER_TABLE=new_table
. If it fails with your full image name, try a simple name likefoo
. What is your GDAL version?C:[Path]\ORTH175670482202017FBS
as a table name?