[postgis-users] raster2pgsql fail with JPEG encoded image

Jorge Gustavo Rocha jgr at di.uminho.pt
Fri Sep 27 15:17:51 PDT 2019


Hi Postgisers,

I'm trying to find out why a particular JPEG image does not work with
raster2pgsql.

I've described the problem as a question in gis.stackexchange:

https://gis.stackexchange.com/questions/337127/raster2pgsql-fail-with-jpeg-encoded-image

There are no errors when inserting the raster in the database.
gdalinfo works fine, both with the original image and the Postgis raster.

The only error I got is if I try to save the Postgis raster back to a
file system image, like:

gdal_translate -of JPEG PG:"service=pg_geotuga dbname=geotuga
schema=raster table=geologica mode=2" 05.jpg

When I do this, I get the error: "GDAL PostGIS Raster driver can not
work with rotated rasters yet." (but the image is written, but I'm not
able to render it).

I suspect that the encoding/compression of this specific image is not
supported.

identify '05-D Braga.jpg'
05-D Braga.jpg JPEG 10614x7739 10614x7739+0+0 8-bit sRGB 11.1453MiB
0.000u 0:00.000

This is just one of the many geological rasters of the country. I would
like to upload them all to Postgis. I can recode the images, if
necessary, but even changing them from JPEG to GTiff is not enough.

Preferably, I would like to identify and maybe fix the issue in
raster2pgsql.

The GDAL version reported by Postgis is 2.3.2 (does it use static
libs?). The GDAL version on the system is 3.0.1.

raster2pgsql -?
RELEASE: 2.5.2 GDAL_VERSION=23 (r17328)

gdalinfo --version
GDAL 3.0.1, released 2019/06/28

select postgis_full_version();
POSTGIS="2.5.2 r17328" [EXTENSION] PGSQL="110" GEOS="3.7.0-CAPI-1.11.0
673b9939" PROJ="Rel. 5.2.0, September 15th, 2018" GDAL="GDAL 2.3.2,
released 2018/09/21" LIBXML="2.9.4" LIBJSON="0.12.1" LIBPROTOBUF="1.3.1"
RASTER

The database has raster support enabled and I can upload other rasters
to the database without any issues.

Best regards,

Jorge Gustavo
-- 
Jorge Gustavo Rocha
Departamento de Informática
Universidade do Minho
4710-057 Braga
Gabinete 3.29 (Piso 3)
Tel: +351 253604480
Fax: +351 253604471
Móvel: +351 910333888
skype: nabocudnosor


More information about the postgis-users mailing list