Questions tagged [postgis-raster]

PostGIS Raster is a PostGIS data type for storing and analyzing raster data.

Filter by
Sorted by
Tagged with
0 votes
0 answers
16 views

Making slices through postgis raster tables

I have an existing python script that i am trying to "translate" into postgres sql. The reason for this is that the server im using for this is not running python. The objective is to slice ...
onetrickpony11's user avatar
0 votes
2 answers
38 views

How to test if a PostGIS table is a raster table or vector table?

Given a postgres table, is there a reliable way to test if it is a raster table? I am planning on importing many rasters into PostGIS and then using pgraster and geometry interoperability. As a first ...
tinlyx's user avatar
  • 11k
0 votes
1 answer
51 views

How to get the extent of a PostGIS raster table?

For vector data, it is possible to get the extent of an entire table using either ST_Extent or ST_EstimatedExtent. How does one get the total extent of all rasters in a raster table?
tinlyx's user avatar
  • 11k
0 votes
0 answers
24 views

Export each raster in a PostGIS raster table as a separate image using gdal_translate

I read from this SO question that one can export an entire PostGIS raster table into one image, as follows: gdal_translate PG:"host=localhost port=5432 dbname=landslide user=postgres password=...
tinlyx's user avatar
  • 11k
1 vote
0 answers
34 views

Why are overviews of an out-db postgis raster not out-db?

I'm working on out-db postgis raster and have generated overviews, but why are the overviews generated of an out-db rasters stored in-db? I have tried creating overviews both manually using ...
Hardik Natani's user avatar
0 votes
0 answers
47 views

Transform raster of unknown SRID using proj4 in PostGIS

In PostGIS is there any way to transform raster of unknown SRID using proj4 to EPSG:3857 without dumping polygons?
user218181's user avatar
0 votes
0 answers
30 views

How to add new band to existing raster with distinct ephoc times as each pixel decimal precession value?

I am new to PostGIS and geospatial data processing. The input we have are bunch of geometry values in the form of Polygons and the ephoc time when this polygon data was captured. Ask is to create a ...
Lovababu Padala's user avatar
4 votes
2 answers
181 views

Convert datum of elevation data in PostGIS

Is there any specific feature to convert raster values (representing elevation) between basis systems, or do I just have to make do with manually adding the mean offset having looked it up from ...
OrangeDog's user avatar
  • 231
0 votes
0 answers
47 views

ST_PixelAsPolygons returning incorrect results

I stored sentinel 2 images as a tiled raster in my DB. The tile size is 244x244. So I want to extract data from those rasters. Currently I am trying to export the data by giving a point and number of ...
Manap Shymyr's user avatar
0 votes
1 answer
64 views

ST_Transform in PostGIS not working on Linux, GDAL 3.5.1, but working on MacOS, GDAL 3.5.3

I have a raster in PostGIS that has a non-standard projection, namely select srid,proj4text from spatial_ref_sys where srid=9822; srid | proj4text ...
Jon Riecke's user avatar
2 votes
1 answer
94 views

ST_SummaryStats gives unknown values (infinity and different values) when clipping raster with buffer

I am loading a raster to postgis (see postgis version and command below) raster2pgsql /path_to_raster/temp-221025_12.tif -d icon_test -F -n name | PGPASSWORD=<PASS> psql -d <myDB> -h <...
neavilag's user avatar
  • 219
1 vote
0 answers
126 views

How can I get the raster cell values for a set of rasters in PostGIS, for each cell that intersects an arbitrary, user-provided polygon?

In PostGIS, I have a set of (large, U.S.-wide) rasters at high (30m) resolution. For my application, I need to take an arbitrary area of interest provided by the user, likely ranging in size from ...
M. Andersen's user avatar
1 vote
0 answers
37 views

Coverage concept and PostGIS [closed]

I'm trying to understand the implementation of the interplay of raster and vector data in PostGIS. In this article Coverage Concepts and PostGIS on the PostGIS wiki page the concept of vector and ...
The dude's user avatar
2 votes
0 answers
84 views

ST_Rotate in geometry Vs ST_SetRotation in raster

I have one polygon geometry (Square to be precise). I tried to rotate that geometry via ST_Rotate(). Then I stored that same geometry in a raster and tried to rotate the raster with ST_SetRotation(). ...
Prasanth Tootcat's user avatar
2 votes
1 answer
286 views

Proj pipeline support in PostGIS

I would like to use proj pipeline in PostGIS ST_Transform function. My sample SRS is as follows: +proj=pipeline +step +inv +proj=unitconvert +xy_in=m +xy_out=us-ft +z_in=m +z_out=us-ft +step +inv +...
arun thatham's user avatar
1 vote
0 answers
80 views

Horizontal coordinate adjustment using EPSG 9621 operation method in PostGIS

We have some Cartesian coordinates which needs to be applied with similarity transformation. The transformation operation method describing how to do the same is explained in EPSG 9621 method. How to ...
arun thatham's user avatar
1 vote
0 answers
123 views

Addition of two rasters in PostGIS

I have two rasters (prast and frast) in PostGIS each with 1 band and with the similar extent and pixel characteristics (They were originally different bands of the same raster before I did some ...
rm167's user avatar
  • 459
3 votes
0 answers
260 views

PostGIS breaks after upgrade

I was running PostgreSQL 12 with PostGIS 3.1.1 extension. More than a week ago, I accidentally performed a PostGIS upgrade by running this query SELECT PostGIS_Extensions_Upgrade(); which returned &...
CHOWY's user avatar
  • 31
1 vote
1 answer
486 views

How to install raster2pgsql on centos7

I am running a postgis database on a server at work. The os is centos7, I can do more or less anything on the server, except for installing another os. I want to upload some raster files to my ...
MortenSickel's user avatar
  • 3,492
0 votes
0 answers
210 views

Raster not loading to PostgreSQL database

I am trying to load rasters to my PostgreSQL database with PostGIS enabled. I am following the tutorial from here for using raster2pgsql: https://postgis.net/docs/using_raster_dataman.html#...
DotPi's user avatar
  • 779
3 votes
1 answer
170 views

How to store historical value of a raster pixel in postgis raster datatype?

I have a postgres table to store rasters having elevation value in each pixels. the raster size on average is around 100x100 with scale of 1. The elevation value is historic and I store timestamp in ...
arun thatham's user avatar
0 votes
0 answers
238 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
2 votes
1 answer
165 views

GiST indexing on constantly updating PostGIS Raster table best practice

I have a single PostGIS raster (3.x) table that holds multiple dates tiled up. I am constantly adding to this table via raster2pgsql. I want to keep the GiST index updated so I attach the -I flag but ...
Ben's user avatar
  • 727
1 vote
1 answer
149 views

Error in URL connection of PostGIS Raster community module plugin in GeoServer

I have a raster named MODIS_All_India_NDVI_2001_01_01.tif in the database named agro_dss in PostGIS, in the public.modis_all_india_ndvi_2001_01_01 table. The import was done using: raster2pgsql -s ...
Abhilash Singh Chauhan's user avatar
2 votes
0 answers
98 views

Clip PostGIS raster to region that crosses 180 meridian

I am using postgis 2.5's raster to store global geographical data (weather forecast) in EPSG:4326 projection, using 0.25° resolution. I use tiling. I created queries to clip the global data to given ...
Honza Dejdar's user avatar
2 votes
0 answers
327 views

Should TOAST compression be disabled for PostGIS?

From this post about Binary data performance in PostgreSQL, I read that storing (large) binary data can be very slow in PostgreSQL (compared to storing the same data in file systems). This seems to ...
tinlyx's user avatar
  • 11k
2 votes
0 answers
182 views

Converting a PostGIS grid back to raster

This is a follow-up question (or inverse) of the question Converting a PostGIS raster back to vector. I am trying to create a workflow that converts a PostGIS raster into a regular grid of polygons, ...
tinlyx's user avatar
  • 11k
1 vote
0 answers
122 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
2 votes
2 answers
394 views

How to efficiently fetch multiple ST_Value from PostGIS raster(s)

I have a raster table with index created by raster2pgsql CREATE TABLE tbl (rid serial PRIMARY KEY, rast raster); CREATE INDEX ON tbl USING gist (st_convexhull(rast)); I can see the best way to fetch ...
OrangeDog's user avatar
  • 231
0 votes
0 answers
422 views

raster2pgsql command line issue (Windows 10) - ERROR: syntax error at or near "raster2pgsql"

I'm using the OsGeo4W64 shell that comes with QGIS (I'm using Windows 10) and have managed to log into my postgres database. However I'm looking to import a raster into a new table, and all roads seem ...
Matt Canada's user avatar
1 vote
0 answers
43 views

Is a PostGIS raster column more efficient than a geometry column in this scenario?

We have several different PostGIS tables that have a timestamp column and a geometry column. The geometry column contains polygons that are queried by a GeoServer instance to be served for display. ...
georgesdoe's user avatar
1 vote
1 answer
2k views

How to write docker-compose.yml after enabling postgis_raster for PostGIS Docker Image

I'm using the docker image of https://github.com/postgis/docker-postgis and it works fine with the commands below which is also defined in README file. docker run --name some-postgis -e ...
Berke Şentürk's user avatar
0 votes
1 answer
163 views

Creating raster with cell value counts from another raster in buffer around each cell using PostGIS

Main objective My main objective is to compute 1) the proportion of a given type of land cover around every raster cell in a radius of 500 m at the scale of an island (e.g.: there is 40 % of ...
psavary's user avatar
0 votes
1 answer
139 views

Multiplying rasters by rasters within PostGIS

I have a situation where I have to multiply sets of rasters by each other. Currently I have subfolders of rasters on my machine and am looping through them and multiplying them with rasterio. Is there ...
Craicerjack's user avatar
5 votes
1 answer
783 views

Slow retrieve PostGIS raster value through ST_Value

I have a PostGIS DB containing a set of daily raster data from 1981 up to 2021. The inserted raster tile size is 83x90. Problem: I wanna query the data through ST_Value for a specified Lat Lon, ...
mkdev's user avatar
  • 121
1 vote
0 answers
50 views

Can't upload raster file on PostGIS

I've been trying to upload my satellite imagery which is 1.5 GB to my PostgreSQL database, using the code below, the error for each command is stated below; raster2pgsql -s 4326 -t auto -F -I -C -Y '....
Kishan Kumar's user avatar
2 votes
1 answer
125 views

Get majority value of raster data inside polygon using PostGIS

We have imported a tiff with landcover data into PostGIS as a raster table. We also have a polygon table with provinces. I'm trying to get the majority of the landcover in each province. But can't get ...
Paul Meems's user avatar
1 vote
0 answers
204 views

GeoServer pgraster - Unable to convert coverage URL to a URI, attempting to use it as a path [closed]

I'm trying to configure an ImageMosaicJDBC using pgraster but I get the error in the screenshot. As I'm really new on GeoServer, I guess I did something wrong. From the log I can see this: Aug 20 08:...
Davide Raro's user avatar
0 votes
1 answer
221 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
1 vote
1 answer
46 views

Showing number of added satellite images in PostGIS

I want to check how many bands of a satellite image have been added to a PostGIS raster table. I know that you can get information by \d raster_columns (as told at PostGIS raster maximum number of ...
soph's user avatar
  • 310
1 vote
1 answer
2k views

Problems enabling the postgis_raster extension, postgis_raster.control seems to be missing

I am a student and to learn more about PostGIS. I installed it to my Raspberry Pi, so that I can remotely access it via my laptop. The installation worked with the exception of the raster module. When ...
raphael's user avatar
  • 11
2 votes
1 answer
348 views

Clip raster with postgis outputting result in clipping geometry extent

I want postgis st_clip to output clipped result in extent of initial clipping geometry. Currently, it's crop option can be set to output either in initial raster extent or in extent of intersection ...
nextstopsun's user avatar
  • 1,129
2 votes
0 answers
166 views

Optimization of multi-band raster clip by polygon

I have tiled (50x50), 365 band, rasters in my postgis database. Each band represents a day in a year. I want to return the raster pixels which intersect with an input geometry, including all bands. I'...
Daniel Vignoles's user avatar
1 vote
0 answers
91 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
1 vote
1 answer
219 views

Loading raster in PostGIS

I am trying to load raster in PostGIS from my Windows cmd using: C:\Program Files\PostgreSQL\9.6\bin>raster2pgsql.exe -s 4326 -I -C -M "D:\9.Taji\data\1_Admin Boundary-20200211T030329Z-001\check\...
Pratichhya's user avatar
0 votes
1 answer
138 views

Zonal stats for raster in PostGIS

I am trying to do zonal stat in PostGIS with the following command. SELECT (ST_SummaryStats(ST_Clip(agri_final_proj.rast, district.geom, TRUE))).*, district.district_1 AS district_1, ...
Pratichhya's user avatar
1 vote
1 answer
584 views

Load all SRTM data into PostGIS

I am trying to load all the SRTM data into a PostGIS database. I tried the process described here: https://postgis.net/docs/using_raster_dataman.html It created a giant SQL file. When I tried ...
Craeft's user avatar
  • 197
2 votes
1 answer
437 views

Connecting MapServer to a raster table in PostGIS

I am new in MapServer and I want to visualize some raster tables in MapServer. My mapfile is: MAP CONFIG "MS_ERRORFILE" "error.log" DEBUG 5 NAME "milad" STATUS on SIZE 600 600 EXTENT -8321547 ...
milad's user avatar
  • 649
1 vote
1 answer
605 views

Insert QGIS processed raster image (e.g. GeoTIFF) to PostgreSQL/PostGIS database by pyqgis

I've already connected to my database by a script, and loaded a vector a layer to QGIS. Is there a way to upload a raster layer back to the database? tablename = "***" geometrycol = "***" from qgis....
poetyi's user avatar
  • 1,519
8 votes
1 answer
4k views

How install postgis_raster extention on PostgreSQL 11.5?

I want install postgis_raster extension on PostreSQL 11.5 + PostGIS 2.5.3 + MacOS 10.14.6 There is a install script on https://postgis.net/install/. All installations of extensions work fine, except ...
Gerd's user avatar
  • 721