Questions tagged [postgis-raster]

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

Filter by
Sorted by
Tagged with
3
votes
1answer
297 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, ...
0
votes
1answer
69 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 ...
2
votes
2answers
58 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 ...
0
votes
1answer
48 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 ...
6
votes
1answer
2k views

Uploading raster format (*.tif) to PostGIS through raster2pgsql

I'm new to PostGIS and raster file format. I'm currently working on NetCDF files and I want to import them into PostGIS through curl command line tool but its failed for me. So I jumped on to GDAL v1....
2
votes
1answer
334 views

How to use custom PostgreSQL schema with GeoServer ImageMosaic JDBC?

I have already created a raster layer in the postgres default 'public' schema and published it in GeoServer through the ImageMosaic JDBC. This is working fine but I would like to use a new custom ...
2
votes
1answer
33 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 ...
0
votes
0answers
21 views

Could not list layers for this store, an error occurred retrieving them: Failed to create reader from file mosaicpgraster.pgraster.xml in GeoServer

While creating new database in ImageMosaicJDBC store, I am getting the error below while connecting the mosaicpgraster.pgraster.xml file in URL as file://C:\Program Files\Apache Software Foundation\...
1
vote
0answers
37 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 ...
3
votes
1answer
165 views

Loading raster to R from PostgreSQL via pgGetRast takes a lot of time

I wrote R code in R Studio to load a raster (stored in PostgreSQL) to R. The database is stored here: C:\Program Files\PostgreSQL\ The following versions are installed on the computer: R version 3.4....
2
votes
0answers
74 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 ...
2
votes
0answers
65 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 ...
2
votes
0answers
26 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, ...
0
votes
0answers
36 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['...
0
votes
1answer
26 views

Extracting a subset of pixels from a large raster in PostGIS/ST_Clip result missing values

PostgreSQL: 12.4 (running on Amazon Aurora) PostGIS: 3.0.2 I'm attempting to clip a much larger raster (global meteorological data on a 0.25 degree resolution grid, split into 64x64 tiles, with 9 ...
1
vote
0answers
189 views

Is there PostGIS equivalent to arcpy.sa.Slice() function?

I have an existing system built on an 8.3 PostgreSQL database which uses a ArcGIS - Spatial Analyst for a couple of raster operations. The system is moving to PostgreSQL 9.2 and I'm evaluating if the ...
0
votes
0answers
82 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 ...
1
vote
0answers
13 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. ...
0
votes
0answers
26 views

PostGIS Rasters now loading differently with QGIS 3.14+

In QGIS version 3.10 when loading in a raster from my PostGIS DB it worked fine and when hoovering over for info gave this message Now with version 3.16(anything over 3.14) I am getting this when on ...
1
vote
1answer
734 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 ...
7
votes
1answer
1k views

Set Z value to a linestring from a postgis raster

I have a table with multilinestring geometries that can be updated or inserted by external users, and a raster table with elevation values. I want to write a trigger that sets the z value of each ...
4
votes
1answer
272 views

Group raster data by values in a second raster

I am looking for a PostGIS equivalent to the ArcGIS Zonal Statistics by Table function. I have two rasters. I would like to group the data in the second raster by the values in the first raster, and ...
1
vote
0answers
26 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 '....
0
votes
1answer
98 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, ...
2
votes
1answer
57 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 ...
1
vote
1answer
329 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 ...
0
votes
1answer
108 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/...
0
votes
0answers
11 views

Raster ST_UNION Losing Cells with Zero as Value

I am encountering a bit of frustration in trying to get 3 rasters to merge through the use of ST_UNION(rast, 'MAX'). It appears as though it is removing anything with a value of zero from the final ...
1
vote
0answers
72 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:...
1
vote
0answers
56 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 ...
1
vote
1answer
74 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\...
1
vote
1answer
37 views

Show 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 here, but it seems as this gives only ...
1
vote
1answer
520 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 ...
1
vote
1answer
106 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 ...
2
votes
0answers
55 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'...
2
votes
1answer
115 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 ...
1
vote
1answer
308 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....
3
votes
1answer
1k 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 ...
3
votes
1answer
200 views

PostGIS raster calculate average slope of 3x3 neighborhood around a geometry point

I have two tables corners_final (vector point data) dem_slope (1ft slope DEM, calculated in degrees) With this simple query I am able to extract the slope value that intersects a given point SELECT ...
3
votes
1answer
3k views

Connecting PostGIS raster data to GeoServer

The data I have used is DEM. It creates a table and has 2 columns in PostGIS. Is it necessary to create a new table again and follow the configuration process as mentioned in the Image Mosaic JDBC ...
4
votes
1answer
598 views

PostGIS resampling two rasters to common grid system

I am testing the PostGIS map algebra (ST_MapAlgebra) on two different raster tables. Each table contains a single image/row. They have the same SRID but different, overlapping extents and different ...
1
vote
0answers
77 views

raster2pgsql fail with JPEG encoded image

The problem I have one JPEG encoded raster that works in GDAL and QGIS. The original file 05-D Braga.jpg is available online. The CRS is EPSG:20790. To upload it to Postgis, I use: raster2pgsql -s ...
1
vote
2answers
471 views

Average of multiple rasters in PostGIS raster?

I am trying to calculate the average of multiple rasters stored as raster datatype in PostGIS enabled database. The rasters are stored in three different tables (spi3, sri3, and smdi) and have date as ...
2
votes
0answers
176 views

PostGIS Rasters not aligned even after calling ST_Resample() or ST_SnapToGrid()

I am trying to compute certain statistics from an elevation (DEM) raster column but at certain points the raster tiles are not aligned, and continue to not be aligned even though ST_SnapToGrid() or ...
0
votes
0answers
39 views

Permissions are blank when trying to load satellite images from Planet API

I am trying to download the map of Melbourne using Planet API. I have given AOI coordinates of Melbourne. When I run the code the permissions are returning blank ("_permissions": []). I cannot able to ...
1
vote
1answer
462 views

Importing raster data automatically to GeoServer

I'mtrying to make an automatic raster data import to GeoServer for later use in an OpenLayers web application in which i need to add raster files frequently, so I added Image Mosaic JDBC Plugin and ...
3
votes
1answer
336 views

Creating a raster with point count as cell value?

I have a PostGIS table with Point geometries in it. I want to create a raster object where each cell value is the number of points within a given raster cell. Cells with zero points in it can be 0, ...
3
votes
1answer
819 views

Replacing pixel value by lookup table using PostGIS?

I was wondering if it is possible to write a PostgreSQL statement to replace the value of each pixel in an input PostGIS-raster with a value obtained from a look up table. For example, suppose I have ...
1
vote
0answers
110 views

Storing raster imagery in PostgreSQL [duplicate]

I have a number of raster files saved locally which I use for basemapping in QGIS. I have built virtual raster fields to load these in one go but I'm looking to store them within my PostgreSQL ...
3
votes
1answer
2k views

Importing GeoTIFF into PostGIS without raster2pgsql?

I know that one can import GeoTIFF into PostGIS via raster2pgsql. I was wondering if there is any easy way (as a sequence of SQL statements) to do the same without resorting to the command line tool? ...