Skip to main content

Questions tagged [raster2pgsql]

The raster2pgsql is a raster loader executable that loads GDAL supported raster formats into sql suitable for loading into a PostGIS raster table.

Filter by
Sorted by
Tagged with
1 vote
0 answers
34 views

Loading large Rasters into PostGIS

I've been trying to load large Rasters into PostGIS using raster2pgsql command, however since it executes under one process, it always seems to be bound by the CPU of the vCore it's scheduled under. ...
Nishant Sondhi's user avatar
0 votes
0 answers
56 views

Import time when converting NetCDF to PostGIS

I have a series of NetCDF file (from Copernicus, and some calculation) and the info from gdalinfo are: gdalinfo nc/2021-12-01_preprocessed.nc Driver: netCDF/Network Common Data Format Files: nc/...
lsir's user avatar
  • 1
0 votes
0 answers
94 views

Debugging import of cloud optimized GeoTIFFs into PostGIS

I have a fairly basic setup where an Apache web server is sitting alongside a PostGIS instance, all run and created together using docker compose. I have a number of cloud optimized GeoTIFFs (COGs) ...
rumski20's user avatar
  • 588
1 vote
0 answers
128 views

Error adding raster to PostGIS: relation "<schema>.<table>" does not exist

I just started using postgresql and PostGIS This error doesn't seem to occur for anybody. I tried running the command to add a raster: raster2pgsql -s 27700 -I -C -M -t 256x256 path/to/my/raster.tif -...
barbedorafael's user avatar
2 votes
1 answer
88 views

raster2pgsql excessive memory usage

I'm attempting to upload a raster to a PostgreSQL (PostGIS) database using raster2pgsql and I have noticed that it is using an excessive amount of RAM, over 25GB worth. The file I'm trying to upload ...
Francis's user avatar
  • 947
0 votes
0 answers
29 views

raster2pqsql error while importing raster

I am trying to import tif image into PostgreSQL using the raster2pgsql and I am getting this error LINE 1: INSERT INTO "public"."test" ("rast") VALUES ('01000008000000... ...
Miko's user avatar
  • 39
1 vote
0 answers
63 views

Raster functions for PostgreSQL and PostGIS on Mac

I am in a class on spatial databases. I have PostgreSQL and PostGIS on my MacBook Pro and have successfully completed several assignments involving shapefiles and other data, so I know both programs ...
ASC's user avatar
  • 11
2 votes
0 answers
328 views

PostGIS S3 Out-DB raster: Cannot open offline raster

I want to import and query a GeoTIFF stored in an Amazon S3 bucket via PostGIS as an out-DB raster. The file was imported via raster2pgsql using GDAL's Virtual File Systems interface, i.e. ...
user18171348's user avatar
0 votes
0 answers
44 views

raster2pgsql -C generates incorrect extent constraint

I am trying to load multiple rasters into the same table with the raster2pgsql. I verified via rasterio's dataset.profile that all of my rasters have the same bounds, centroid, and dimensions. Using ...
user216224's user avatar
0 votes
0 answers
209 views

Raster issues: raster2pgsql constraints fail

I am having an issue when loading the data in to postgis with this command: raster2pgsql -s 3020 -d -I -Y -C -R -N 0 -t auto -r -l 2 -F data.tiff table_rast_test | psql -U postgres -d db. I get ...
Arun.R's user avatar
  • 1
1 vote
1 answer
76 views

raster2pgsql no more INSERT/COPY statement in the log

I use raster2pgsql every day with Windows command tools, and I'm searching a command to not prompt the INSERT or COPY statement on the terminal because I've got a lot, like an inverse verbose. Is it ...
Monsieur_J42's user avatar
3 votes
0 answers
131 views

raster2pgsql: Argument list too long

trying to insert rasters into my database. In sum, its about 870,000 files. Trying to do so with the following command raster2pgsql -s 4326 -I -C -M -F -l 8,16,32 *.jp2 public.sat| psql -d imagery -h ...
skynet1010's user avatar
1 vote
0 answers
73 views

raster2pgsql creates black and white tiles

im trying to build a tile from a geotiff however for some reason the output is black and white can anyone point out why and hopefully how to correct here is a sample of the tiff the import command ...
MikeT's user avatar
  • 111
0 votes
0 answers
346 views

raster2pgsql with GDAL Virtual File System /vsis3/

I cannot succeed to upload an out db cloud raster from AWS to a PostGIS db using raster2pgsql. I'm working on Windows 10, using PowerShell. I've set the appropriate environment variables and I can ...
Anton Hammarström's user avatar
1 vote
0 answers
215 views

Add geometry to XYZ-tiles in .JPG format to serve in PostGIS

I have a WMS service from a governmental website of my state. Using the QGIS plugin QuickMapServices and its function Generate XYZ Tiles (Directory) in the "Processing toolbox" I downloaded ...
JoeBe's user avatar
  • 1,230
1 vote
0 answers
139 views

Schema error while uploading raster in PostgreSQL

Tried many ways A. import os import subprocess from subprocess import PIPE, run db_name = 'agro_dss' db_host = 'localhost' db_port = '5432' db_user = 'postgres' db_password = 'imd123#' os.environ['...
Abhilash Singh Chauhan's user avatar
0 votes
0 answers
267 views

Upload raster to PostGIS problem: ERROR: unterminated quoted string at or near

I used this command: raster2pgsql -s 4326 -I -C -M T31TEJ_20210216T104019_B01.tif -F -t 100x100 public.testraster | PGPASSWORD=1122 psql -d ter -h localhost -U dtn -p 5432 On MacOS Bigsur 11.2.3 it ...
Nguyen Duc Tien's user avatar
1 vote
0 answers
349 views

raster2pgsql with the -R flag (remote dataset) results in invalid table

I'm trying to setup a PostGIS table with NED raster tiles stored remotely. My raster2pgsql command works fine and results in a valid table without the -R flag, but when I use the -R flag (for an 'out-...
jamierob's user avatar
  • 1,559
8 votes
2 answers
6k views

PostGIS: type "raster" does not exist

I'm new to PostgreSQL and PostGIS. I'm adding a raster to a newly created PostGIS schema and table with the raster2pgsql command: sudo raster2pgsql -I -C -s 3577 -t 50x60 /path/to/raster.tif schema....
Simigant's user avatar
  • 141
0 votes
1 answer
216 views

How to get the file location of rasters registered with the PostGIS extension?

Using raster2pgsql I am able to load a NetCDF file into PostgreSQL using the PostGIS 3.1 extension. And looking at the documentation I can see that it's possible to register a raster file instead of ...
Zach Smith's user avatar
1 vote
0 answers
349 views

raster2pgsql: "Could not allocate memory for INSERT statement"

I'm very new to raster2pgsql so please bear with me. I'm trying to load a 60mb .tif into my postgis-enabled database via raster2pgsql using the following command: raster2pgsql -s 5235 -C -F *.tif ...
grg's user avatar
  • 73
1 vote
0 answers
369 views

Using large rasters in PostGIS?

I successfully imported a 7 gb raster into my PostGIS database using the following script raster2pgsql.exe -I -c -d -t 100x100 -s <SRID> <file_path> public.<table_name> | <...
Ismail's user avatar
  • 113
1 vote
1 answer
727 views

Error loading GeoTIFF using raster2pgsql: “Error 1: PROJ: Cannot find proj.db”

I am attempting to load a GeoTiff into a PostgreSQL database using the PostGIS extension raster2pgsql. When running the executable, I receive the following error: Error 1: PROJ: Cannot find proj.db. ...
Tony's user avatar
  • 11
0 votes
1 answer
234 views

raster2pgsql - invalid pointer

I get the following error each time I run the raster2pgsql: [postgres@li1959-236 ~]$ raster2pgsql -I -C -s 4326 -M -F /home/temp/wrf_d02_202005010000.tif grib_test | psql -d cep Processing 1/1: /home/...
Davide Raro's user avatar
3 votes
1 answer
191 views

ST_AsPNG query has wrong position on Mapbox

I am trying to import GeoTIFF files into a PostgreSQL database using raster2pgsql. I use the following query to import the data into my database: raster2pgsql -s 4326 -c -P -I -C -t 256x256 *.tif ...
Kawada's user avatar
  • 31
2 votes
0 answers
461 views

How to save each band in a new row with it's name, in PostGIS?

I have used PostGIS's raster2pgsql to import my multi-band raster data into my PostGIS database. Here is the code that can do this operation: raster2pgsql -I -C -e -Y -F /home/jj_user/input.tif ...
Muser's user avatar
  • 225
1 vote
0 answers
101 views

Uploading m/analysing raster vector data in PostGIS

I am trying to build a web-GIS platform where user can upload their data (raster & vector) and do some kind of analysis, like calculate zonal statistics. I read lots of articles and blogs about ...
dhiraj's user avatar
  • 249
2 votes
1 answer
815 views

How to add more parameters to the sql file created by raster2pgsql

I'm using raster2pgsql to upload rasters to a postgres database I execute the following command in cmd to create a sql that will add the raster "C:/Program Files/PostgreSQL/9.5/bin/raster2pgsql" -s ...
scf's user avatar
  • 63
0 votes
0 answers
153 views

Loading raster on PostgreSQL/PostGIS Linux server not working

I used the following raster2pgsql.exe to upload an SRTM mosaic to my Linux database server (working fine for vector data): raster2pgsql.exe -I -t auto e:\data\Sinai\SRTM90V41b\SRTM41M90.tif SRTM90c | ...
ahmed 's user avatar
  • 57
7 votes
2 answers
3k views

Getting all the Raster pixel value from PostGIS

I just uploaded the raster using following code, raster2pgsql -s 4326 -I -C -M raster.tif -F -t 100x100 public.raster_table | psql -U postgres -p 5432 -h localhost -d raster It takes around 15 min ...
Tek Kshetri's user avatar
5 votes
1 answer
921 views

raster2pgsql not in C:\Program Files\PostgreSQL\12\bin

After adding both C:\Program Files\PostgreSQL\12\bin C:\Program Files\PostgreSQL\12\lib to my windows environmental variables PATH thing, I can't access raster2pgsql: 'raster2pgsql' is not ...
MaartenVL's user avatar
3 votes
1 answer
2k views

Unable to read TIFF file with raster2pgsql

I am having some trouble with the raster2pgsql function (on a Windows 7 in the OSGeo4W shell). I am receiving the error "Unable to read raster file". I can import shapefiles, ok using org2org so I ...
CarlaBirdy's user avatar
1 vote
0 answers
294 views

is there a way find all coordinates inside a polygon and use each points to get their value (radiance)

I have this GeoTIFF file that I acquired in NOAA ( Tarball contains the TIFF file VIIRS ) that has a light intensity in each area in the world. Its categorize per tile. I used the one that covers ...
Carl Dennis Alingalan's user avatar
2 votes
0 answers
189 views

Querying / seting up PostGIS (raster) table to efficiently get all bands at once?

I have created a PostGIS raster table from raster2psql. I have use cases where I might have bands sizes of 114 to 670 bands inside a raster (The number is consistent across a given dataset.) My ...
user3559247's user avatar
0 votes
1 answer
194 views

Load GeoTIFF band value into PostGIS

I am trying to upload a geoTIFF file into my PostGIS database. Using raster2psql, it works. raster2pgsql -I -C -M *.tif -F -t auto mytablename > mytable.sql psql -d mydatabase -f mytable.sql ...
William Abma's user avatar
2 votes
1 answer
217 views

PostgreSQL- query a raster by XY

Windows 10, PostgreSQL 11 I successfully managed to export a .tif raster into PostgreSQL using raster2pgsql: raster2pgsql -s 27700 -I -C -M -Y "D:\Data_Location\country.tif" -F -t 50x50 public....
Theo F's user avatar
  • 1,839
2 votes
1 answer
433 views

raster2pgsql: queries on imported raster are NULL

I loaded a tif-file of some soil data into postgres with: raster2pgsql -c -I -F -C -r -M -s 31467 -t 200x200 soil_file.tif gis.soil_map | psql -U user -d database -h localhost -p 5432 which worked ...
Julius Diel's user avatar
4 votes
1 answer
2k views

Very slow loading of PostGIS raster layer in qGIS

I'm trying to use big raster dataset with PostGIS 2.5 on PostgreSQL 11 on Linux for the purpose of serving a base map organization-wide. My dataset is 2TB of TIFFs. I created 8GB test table (including ...
Sabin Kolarov's user avatar
5 votes
1 answer
2k views

Optimum raster tile size

I am wondering if there is an optimum raster tile size when using -t in raster2pgsql. I am setting -t auto and it creates thousands of tiles and takes hours to load. I am working with very large ...
D_C's user avatar
  • 1,359
2 votes
1 answer
327 views

GDAL processing of GRIB2 raster prints hundreds of unsuppressable warnings

I am processing some GRIB2 raster files from NCEP (weather model stuff). An example file would be: http://nomads.ncep.noaa.gov/pub/data/nccf/com/hiresw/prod/href.20180906/ensprod/href.t00z.conus.mean....
Thomas's user avatar
  • 1,477
-1 votes
1 answer
933 views

raster2pgsql error: "ERROR: malformed record literal: DETAIL: Missing left parenthesis."

This is a command I use to upload dem.tiff into PostGIS database: $ raster2pgsql -a "/path/to/dem.tiff" -F test_schema.raster2 | psql -h localhost -d pisl -U postgres However, I get the following ...
Jan Pisl's user avatar
  • 726
2 votes
0 answers
738 views

Piping data between PostGIS 'raster2pgsql' and PostgreSQL using Python subprocess?

My goal is to create a system that will take a GeoTIFF format raster image and programmatically import it into a Postgres table using PostGIS raster2pgsql. In order to get this done with minimal ...
Evan McCoy's user avatar
0 votes
1 answer
640 views

raster2pgsql error required password

i'm trying to import raster to postgis using this command ; raster2pgsql -I -C -s 4326 -t 100x100 -M "C:\DATA TRIAL APOLLO\mosaik129_130.ecw" -F public.mosaik129_130 | psql -d apollo_db but then ...
Lia's user avatar
  • 1
1 vote
1 answer
1k views

While importing *.tif in PostGIS db using raster2pgsql command i am facing issue "ERROR: invalid memory alloc request size 1073741824"

I just need to import a .tif file into my PostGIS db. the TIFF file I have is 430 MB. While using this command following error is thrown: raster2pgsql -I -C -c *.ndvi.tif public.gistest1 | psql -U ...
Suhal Vemu's user avatar
1 vote
0 answers
456 views

GUI for raster uploads to PostGIS/PostgreSQL

We can currently upload raster data with raster2pgsql to our PostgreSQL db. I am wondering if anyone is working on a GUI or plugin, maybe even through QGIS, that would make the raster upload ...
Dan B's user avatar
  • 128
1 vote
0 answers
521 views

raster2pgsql error while loading

I have done that many times and it usually works but I'm facing a problem now that I do not understand. I'm trying to load a raster (.tif) with a EPSG4326 and it is a one band file in my database from ...
user3016665's user avatar
3 votes
1 answer
439 views

PostGIS raster query "out of range raster coordinates"

I have a large raster (national scale) that I have loaded into PostGIS using raster2pgsql and a 100x100 tile size: raster2pgsql -I -C -s 27700 my.tif -t 100x100. I am now trying to query a large ...
Mark V's user avatar
  • 83
2 votes
1 answer
1k views

raster2pgsql loads raster into a single column

I would like to load a raster (.asc) into my PostgreSQL Database. In order to demonstrate the problem I chose the raster downloaded from this homepage: https://shop.swisstopo.admin.ch/de/products/...
Li Ku's user avatar
  • 85
3 votes
2 answers
3k views

Adding raster to PostgreSQL database using raster2pgsql?

I added a raster to my PG database using the raster2pgsql and when I try to load it from QGIS it says that I need to specify it's geometry. Is that a common problem, and if so, how can I solve it? ...
Ka_Papa's user avatar
  • 447
3 votes
0 answers
372 views

postgis raster to postgres database

hi Im trying to access my raster file in QGIS by connecting postgresql database. I can see my raster in qgis but I get this error : Geçersiz Katman: GDAL provider Cannot open GDAL dataset PG: ...
oztuncbilek's user avatar