Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t6upm-00GPg8-D3 for psycopg@arkaria.postgresql.org; Fri, 01 Nov 2024 16:49:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t6upk-00FTl5-OY for psycopg@arkaria.postgresql.org; Fri, 01 Nov 2024 16:49:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t6upk-00FTkx-I2 for psycopg@lists.postgresql.org; Fri, 01 Nov 2024 16:49:12 +0000 Received: from sm-r-008-dus.org-dns.com ([84.19.1.236]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t6uph-003zSp-C6 for psycopg@lists.postgresql.org; Fri, 01 Nov 2024 16:49:11 +0000 Received: from smarthost-dus.org-dns.com (localhost [127.0.0.1]) by smarthost-dus.org-dns.com (Postfix) with ESMTP id BFFA2A20AB for ; Fri, 1 Nov 2024 17:49:06 +0100 (CET) Received: by smarthost-dus.org-dns.com (Postfix, from userid 1001) id B3105A223E; Fri, 1 Nov 2024 17:49:06 +0100 (CET) X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,KAM_INFOUSMEBIZ, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 Received: from ha01s018.org-dns.com (ha01s018.org-dns.com [62.108.32.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smarthost-dus.org-dns.com (Postfix) with ESMTPS id 60EE3A225B for ; Fri, 1 Nov 2024 17:49:06 +0100 (CET) Authentication-Results: ha01s018.org-dns.com; spf=pass (sender IP is 127.0.0.1) smtp.mailfrom=thiemo@gelassene-pferde.biz smtp.helo=ha01s018.org-dns.com Received-SPF: pass (ha01s018.org-dns.com: connection is authenticated) Received: from [5.83.191.181] ([5.83.191.181]) by webmail.gelassene-pferde.biz (Horde Framework) with HTTPS; Fri, 01 Nov 2024 17:49:05 +0100 Date: Fri, 01 Nov 2024 17:49:05 +0100 Message-ID: <20241101174905.Horde.JW_MNbPlBgYSivspissyvPF@webmail.gelassene-pferde.biz> From: thiemo@gelassene-pferde.biz To: psycopg Subject: Re: TypeError: dict is not a sequence References: <20241101111747.Horde.GgVaeCJ_Ig6HsmcfjbNwguM@webmail.gelassene-pferde.biz> <20241101161113.Horde.0Bgt_EQ0glbsBmc_1YpZj90@webmail.gelassene-pferde.biz> <99a9cec1-09a0-41fb-91b2-d153c4ccf5a4@aklaver.com> In-Reply-To: <99a9cec1-09a0-41fb-91b2-d153c4ccf5a4@aklaver.com> Accept-Language: de Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-PPP-Message-ID: <173047974625.3645872.4281526215009176589@ha01s018.org-dns.com> X-PPP-Vhost: gelassene-pferde.biz X-POWERED-BY: wint.global - AV:CLEAN SPAM:OK List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Adrian Klaver escribió: >> psycopg2.errors.InternalError_: RASTER_fromGDALRaster: Could not >> open bytea with GDAL. Check that the bytea is of a GDAL supported >> format > > This looks to be on the PostGIS end related to the > ST_FromGDALRaster() function. Does: > > select ST_FromGDALRaster(the_field); > > work in psql? Thanks for looking into it. I am not sure, however, what you refer to with the_field. Be it as it may, the following might answer your question. thiemo @ hotrod ~ % psql -p 5447 -d treintaytres -U treintaytres psql (17.0 (Debian 17.0-1.pgdg120+1)) Type "help" for help. treintaytres=> set postgis.gdal_enabled_drivers = 'ENABLE_ALL'; SET treintaytres=> WITH foo AS ( SELECT ST_AsPNG(ST_AddBand(ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, 0, 0.1, -0.1, 0, 0, 4326), 1, '8BUI', 1, 0), 2, '8BUI', 2, 0), 3, '8BUI', 3, 0)) AS png ), bar AS ( SELECT 1 AS rid, ST_FromGDALRaster(png) AS rast FROM foo UNION ALL SELECT 2 AS rid, ST_FromGDALRaster(png, 3310) AS rast FROM foo ) SELECT rid, ST_Metadata(rast) AS metadata, ST_SummaryStats(rast, 1) AS stats1, ST_SummaryStats(rast, 2) AS stats2, ST_SummaryStats(rast, 3) AS stats3 FROM bar ORDER BY rid; WARNING: permission denied to set parameter "postgis.gdal_enabled_drivers" ERROR: rt_raster_to_gdal: Could not load the output GDAL driver CONTEXT: PL/pgSQL function st_aspng(raster,text[]) line 31 at RETURN Many thanks for your support.