Questions tagged [postgis-raster]

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

42 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
0answers
485 views

PostGIS issue with ST_Clip?

I'm trying to clip a raster using a polygon but I end up with a result that doesn't seem right and where some raster pixels are outside the polygon used for the clip. See image below where polygon is ...
6
votes
0answers
1k views

PostGIS: Storing large gridded time series

I'm trying to store a large raster timeseries on PostGIS-2.2 / PostgreSQL 9.5. The data comes as a collection of HDF-EOS (basically HDF4) files. Each file contains 24 bands, representing hourly ...
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....
5
votes
0answers
433 views

Postgis load raster to DB running on AWS RDS with raster2pgsql

I want to perform very common task: I have Postgresql + Postgis running on Amazon Web Service cloud, using RDS service. I have there some vector layers and can execute SQL (Postgis) commands via ...
4
votes
0answers
94 views

Why do I get a memory allocation error when selecting rasters by ID in PostGIS?

The Problem I have about 256000 tiles in a table of GDEM v2 at 1 arcsecond resolution. I'm on an Ubuntu server running Postgres 9.5.5 and PostGIS 2.2. The table has a GIST index on the convex hull of ...
4
votes
0answers
320 views

Counting nodata and data pixels using PostGIS

I'm using PostgreSQL 9.2.4 and PostGIS 2.0.3. I have some raster layer and I'm trying to get the count of all pixels (including nodata), cliped by polygon. Raster was imported by raster2sql: ...
4
votes
0answers
2k views

How to IDW interpolation in PostGIS

I'm trying to find PostGIS Raster functions supports the Inverse Distance Weighted interpolation method (IDW) and Kriging interpolation method. I'm especially trying to generate a temperature map ...
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, ...
3
votes
0answers
101 views

How to insert raster and other columns using raster2pgsql?

I would like to have a table with a few more columns than just the raster data. Let's say I'd like to have anotherColumn. I tried raster2pgsql -s 3857 -R -a -k -f public.table.image -q -e -F -X ...
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, ...
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
0answers
175 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 ...
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
0answers
175 views

Error Quantifying Land Cover Classes by Polygon in PostGIS

I am trying to ultimately calculate proportion of land cover types by polygon in PostGIS, so starting using st_valuecount to get counts of pixels with different land cover types. The data are pretty ...
2
votes
0answers
117 views

Postgis ST_NearestValue() returns nothing

My query in (Dutch SRID, in meter): SELECT ST_NearestValue(ahn.rast, 1, ST_SetSRID(ST_Point(135742.6965165309,453864.2795337387), 28992) FROM ahn2.ahn WHERE ST_Intersects(ahn.rast, ST_SetSRID(...
2
votes
0answers
419 views

3d Intersect query compatible with GeoTIFF/DEM?

When researching this topic I haven't been able to verify if it's possible to make spatial 3D Intersect queries between a vector polygon with z-values and GeoTIFF/DEM file holding the elevation values?...
2
votes
0answers
72 views

ST_ColorMap wrongly loses 0.0 value when INTERPOLATE

I want apply a colormap to a monoband grey scale tiff from postgis calling ST_ColorMap. My query is something like "SELECT oid, lowrite(lo_open(oid, 131072), tiff) As num_bytes " + "FROM ( ...
2
votes
0answers
163 views

Add bands or new raster column in Postgis?

Would it be faster to work with a new band or a new raster column for a raster dataset in Postgres with new pixel values, assuming that the size, extent and everything else relevant remains constant? ...
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
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 ...
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. ...
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 '....
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
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
0answers
134 views

Query PostGIS raster table in QGIS

I would like to know if it is possible to query a PostGIS raster directly in QGIS in the same way one can use the query builder to filter a vector layer? I have successfully built database views of ...
1
vote
0answers
379 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 ...
1
vote
0answers
102 views

Stacking rasters of different resolutions in PostGIS

I have three rasters covering the same area but with different pixel sizes (Sentinel 2 tiles if it matters). My goal is to "stack" them, such that pixel[i,j] in the resulting raster contains [bands ...
1
vote
0answers
136 views

Using postgis to rasterize a set of points grouping by time

I have used postgis for vector operations for years, but have recently begun a project mixing vector and raster data and I am bit confused as to what is the best way to do what I want to do. I have ...
1
vote
0answers
145 views

Sample overlapping rasters in PostGIS

UPDATE: The SQL below works fine. My problem was a newbie mistake in using the Python psycopg2 functions to execute it. So I think I should just delete this question. ORIGINAL QUESTION: I have a ...
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
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\...
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 ...
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 ...
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 ...
0
votes
1answer
68 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 ...
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 ...
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 ...
0
votes
0answers
174 views

Different pixel values for a raster between QGIS and PostGIS

I have inserted a Landsat raster into PostGIS using the command : raster2pgsql -I -C -s 28356 -M -t 100x100 /data/LS7_20150425_B40.tif public.red | psql -d postgres -U postgres Using QGIS, I have ...