Questions tagged [postgis-raster]

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

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

Storing raster imagery in PostgreSQL

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 ...
1
vote
0answers
23 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 ...
2
votes
1answer
44 views

return only one value per point from ST_Value() - currently returning 2 values for some points

I'm testing a point sample query with a subset of 5 points on a single band elevation raster. Using my usual approach (which I've previously not noticed this behavior), I get six records returned: ...
1
vote
0answers
60 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 ...
1
vote
1answer
25 views

Why does rescaling by 1.0 speed up this PostGIS query

To preface, I'm not sure if it matters, but I'm using PostgreSQL 11 with PostGIS 2.5 (through Docker on Windows) and accessing it with Python through PsycoPG2. My raster has the recommended index on ...
1
vote
0answers
83 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 ...
0
votes
1answer
48 views

PostGIS ST_RECLASS using Lookup Table not working properly

Link to question/answer similar to what I am trying to do I am trying to run ST_RECLASS on a raster to retain certain pixel values while setting others to NoData(0). I have a function that creates a ...
2
votes
0answers
107 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 ...
3
votes
1answer
161 views

ST_Clip tiled raster using geometry results in out of geometry pixels

I'm trying to run an ST_Clip for a simple AOI geometry. I'm using this WGS84 raster, imported into PostGIS like so: raster2pgsql -t 100x100 -C -M -F -I -s 4326 Hansen_GFC-2016-v1.4_lossyear_20S_070W....
2
votes
0answers
80 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(...
1
vote
0answers
222 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
1answer
214 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 ...
1
vote
0answers
60 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 ...
0
votes
0answers
168 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?...
0
votes
1answer
181 views

PostGIS intersect query: Raster footprints of multiple high resolution GeoTIFF's or not? [closed]

I have multiple (381) high resolution GeoTIFF's (2x2 meter resolution, 1 band, 700 MB each) that I somehow want to upload to a PostGIS-server to be able to run ST_intersects or ST_3Dintersects queries ...
2
votes
0answers
89 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....
1
vote
0answers
73 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 ...
6
votes
0answers
319 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 ...
1
vote
0answers
75 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 ...
2
votes
1answer
161 views

How to write quotes in PG connection string in where clause when open Postgis Raster?

I have some rasters in PostGIS and I want to open just those which match to where clause. How can I do that? I have tried: ds = gdal.Open("PG:host=<host> dbname=<dbname> table=<...
2
votes
1answer
135 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 ...
4
votes
0answers
54 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 ...
5
votes
2answers
440 views

Calculating Slope for the Whole World in PostGIS

The Challenge I have a PostGIS Database which contains all of SRTM v4.1. I need to calculate slope for the entire globe as part of an error modeling process. The DEM is tiled at 100x100. Whenever I ...
0
votes
1answer
165 views

Error while importing geotiff file into postgresql database in linux platform

I am trying to import GeoTIFF file into spatially enabled PostgreSQL database. Using command: raster2pgsql -s 4326 -C -F -a path/to/geotiff/file public.table_name | psql -d database_name -U ...
6
votes
1answer
511 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 ...
1
vote
1answer
105 views

R Script for Computing Image Means and Raster Value Subtractions

I have a very specific script I am trying to make which computes image flatfields. Basically, I am computing a Master Dark Frame (MD) by averaging a set of Dark Photos. I have a set of light photos ...
2
votes
1answer
347 views

Color of extent in OpenLayers 3

I'm very new to OpenLayers and all the GIS world. I'm working with rasters (tiff that are converted to postgis sql) I have this code: var feature; $.ajax({ method: "POST"...
1
vote
1answer
226 views

Why is pgraster much slower?

This is a follow up question to my other question: How to speed up raster/map algebra in PostGIS? I am much attracted to the way how PostGIS handle vectors and rasters in an interoperable manner. A ...
1
vote
0answers
291 views

504 Gateway Timeout only with 1 kind of mapserver request (TileWMS in OpenLayers 3) [closed]

I'm very new to GIS. With MapServer, I'm calling four kinds of data, but only with this one am I having some HTTP 504 error message randomly. The other three never have that error, but only with this ...
1
vote
1answer
190 views

Can rasters in same CONSTRAINED table have different alignments in PostGIS?

Context I have a table filled with ASTER GDEM data for the state of Colorado tiled at 100x100 pixels. I want to query the table and return a single raster that covers all of the supplied bounding box ...
3
votes
2answers
341 views

Rasterizing vector layer with PostGIS?

I have a vector layer with 2498 features (houses) that I want to rasterize/produce a raster image from but can't figure out how: Column MARK_Z = is Meters above see-level for the base of each ...
0
votes
1answer
187 views

ST_Value, multiple rasters - need unique columns for rast values

I have a grid of cells that I am converting to centroids to 'sample' raster values in the same locations as the centroids. All rasters (4) are in the same table with same resolution and SRID. I want ...
3
votes
1answer
234 views

PostGIS ST_AsPNG faster than ST_PixelAsCentroids

I'm hoping to export a PostGIS raster into a non-GIS enabled database. Ideally, I'd like to be able to have three columns in the output: latitude, longitude, raster_value. Easy enough. Ideally, I'd ...
0
votes
1answer
140 views

postgis SRTM3 different raster scale in same column

SRTM3 elevation data are stored in HGT files each containing 1201x1201 values. I want to store this information in a PostGIS raster column with a single band. To optimize my queries, I wanted to ...
6
votes
0answers
582 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 ...
1
vote
1answer
261 views

PostGIS: ST_Clip problem with area which oversteps the raster

Hello all the PostGIS wizards! I want to programmatically clip raster with bounding box which is overstepping the border of raster. Ok, i can do it with ST_Clip, but the problem is that ST_Clip only ...
1
vote
1answer
422 views

How to query with stored PostGIS time series raster data

I have time series raster data in PostGIS and I can't find a way to get the info as a time series from an XY point. For example: I would like to get the vale of the XY point in raster for the 13/08/...
1
vote
1answer
571 views

ST_AsRaster for polygon

Having a hard time to get a raster from a polygon ST_AsRaster(ST_Buffer(ST_GeomFromText('POLYGON((-30 40, -20 30, -25 20, -23 10, -30 40))', 4326), 50),ARRAY['8BUI'],ARRAY[118]); This line is giving ...
4
votes
0answers
230 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: ...
1
vote
0answers
51 views

Interative raster with PostGIS [closed]

I'm searching some solution to show raster layers from PostGIS on a Web Page. I need a solution to build a interactive map showing the values of my raster data when the user to click on pixel of the ...
1
vote
0answers
227 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
1answer
402 views

unable to render/view a postgis raster in qgis 2.14.1

I have successfully added a raster to postgis using the following: raster2pgsql -s 4326 -I -C -M 00N_030E.tif -F -t 250x250 -a test.00N_030E | psql -U postgres -d raster -h localhost -p 5432 I tried ...
2
votes
0answers
62 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
1answer
574 views

Issues with raster data on postgresql / error:Attempting to get pixel value with out of range raster coordinates

So here is the issue, i am trying to extract values from a big raster divided in 200 or so tiles and applying them to a selection. The points are startpoints, endpoints and midpoints from vector items,...
1
vote
1answer
555 views

Is there a tool to shrink/grow raster data edge by n pixels

Looking for an open source tool to grow/shrink raster edge by n pixels. I noticed Grass has r.grow but hoping there might be a way to do it with GDAL, PostGIS or python library. More information: I ...
3
votes
1answer
434 views

PostGIS raster - sum of rasters

I have raster data stored in a PostgreSQL/PostGIS database. I need to create a summed raster from certain rasters. Something like: select sum(raw_data) as image from data where rid > 2 AND rid &...
3
votes
0answers
1k 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 ...
2
votes
1answer
320 views

Storing and updating large amount of raster data

Large amount of data = ~10TB of rasters (multiple projections) with the possibility of this data growing. The basic architecture I'm planning at the moment is having 2 clusters of GeoServer--one ...
2
votes
1answer
2k views

How to connect 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 ...
1
vote
1answer
179 views

What does skew X/Y do in PostGIS?

I am just wondering what the exact function of skewX and skewY in raster constructors is. According to the documentation linked: ST_MakeEmptyRaster — Returns an empty raster (having no bands) of ...