public inbox for [email protected]
help / color / mirror / Atom feedFrom: [email protected]
To: psycopg <[email protected]>
Subject: Re: TypeError: dict is not a sequence
Date: Fri, 01 Nov 2024 17:49:05 +0100
Message-ID: <20241101174905.Horde.JW_MNbPlBgYSivspissyvPF@webmail.gelassene-pferde.biz> (raw)
In-Reply-To: <[email protected]>
References: <20241101111747.Horde.GgVaeCJ_Ig6HsmcfjbNwguM@webmail.gelassene-pferde.biz>
<CAG18HBwZ6piGnEY6D_2Dv3F=6kujhmL_X2aJo=baOf7kMD9Axw@mail.gmail.com>
<20241101161113.Horde.0Bgt_EQ0glbsBmc_1YpZj90@webmail.gelassene-pferde.biz>
<[email protected]>
Adrian Klaver <[email protected]> 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.
view thread (8+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: TypeError: dict is not a sequence
In-Reply-To: <20241101174905.Horde.JW_MNbPlBgYSivspissyvPF@webmail.gelassene-pferde.biz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox