Re: Importing tiles with raster2pgsql

Andreas B <[email protected]>
Newsgroups gmane.comp.gis.postgis
Message-ID <CAL2+-iXX-5yxnV862nN8jXry-RF5iMg6+3y6POMojeU=HE87Og@mail.gmail.com>
Regina,

I'm using Debian 12 (bookworm).
PostgreSQL and PostGIS installed with apt:

# SELECT version();
                                                       version

---------------------------------------------------------------------------------------------------------------------
 PostgreSQL 15.10 (Debian 15.10-0+deb12u1) on x86_64-pc-linux-gnu, compiled
by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
(1 row)

# SELECT PostGIS_full_version();

postgis_full_version

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
 POSTGIS="3.3.2 4975da8" [EXTENSION] PGSQL="150" GEOS="3.11.1-CAPI-1.17.1"
PROJ="9.1.1" LIBXML="2.9.14" LIBJSON="0.16" LIBPROTOBUF="1.4.1"
WAGYU="0.5.0 (Internal)"
(1 row)

raster2pgsql version:

$ raster2pgsql
RELEASE: 3.3.2 GDAL_VERSION=36 (4975da8)

The tiles are available; I'll try my workflow again, document, and share
the tiles.

Thanks!

Best,
Andreas

On Thu, Dec 12, 2024 at 3:26 PM Regina Obe <[email protected]> wrote:

> Andreas,
>
>
>
> Yes I would expect them to give the same result.
>
>
>
> What version of raster2pgsql are you running?  It should tell you if you
> run raster2pgsql without any args.
>
>
>
> Also what platform are you on?  Any chance you have some of those tiles
> available so we can check it out?
>
>
>
> *From:* Andreas B <[email protected]>
> *Sent:* Thursday, December 12, 2024 6:17 AM
> *To:* [email protected]
> *Subject:* Importing tiles with raster2pgsql
>
>
>
> Hi all,
>
> I have a dataset with several hundred tiles (GeoTIFFs) that make up a
> digital terrain model.
> Each tile is 0.5d x 0.5d.
>
> I tried to load these GeoTIFFs to PostGIS with:
>
> $ raster2pgsql -s 32631 -I -M -F -C -t auto -d -l 2,4,8,16,32 tif/*.tif (1)
>
> The data was loaded, but when viewing in QGIS, it looked like jagged lines
> with areas of white overlain by pieces of neighboring tiles, etc.
> This didn't look right.
> I also noticed that for each tif, the constraints were printed.
> I expected this to be done once, after the last tile was loaded.
>
> I then created a virtual raster with gdalbuildvrt:
>
> $ gdalbuildvrt merge.vrt tif/*.tif (2)
>
> And then used raster2pgsql to load in the vrt:
>
> $ raster2pgsql -s 32631 -I -M -F -C -t auto -d -l 2,4,8,16,32 merge.vrt |
> psql (3)
>
> The data was loaded, and looked good in QGIS.
>
> Shouldn't commands (1) and (3) give the same results, or am I
> misunderstanding?
>
> Best, Andreas
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.