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
1answer
24 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
40 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
41 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
25 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'...
1
vote
0answers
37 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
57 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\...
0
votes
1answer
28 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, ...
1
vote
1answer
117 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 ...
2
votes
1answer
33 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 ...
0
votes
0answers
23 views

Are there annual or monthly NDVI high res datasets? [duplicate]

I'm looking for a source of high res (250 meter seems the highest res available for MODIS?) NDVI composite datasets for either an entire year (or monthly snapshots) if not, in a format I can import as ...
1
vote
1answer
108 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....
1
vote
1answer
331 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 ...
2
votes
1answer
117 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 ...
0
votes
0answers
12 views

New raster derived from existing raster values in PostGIS

Using PostGIS I want to create a new raster, same size and dimensions as an existing one but with the values slightly adjusted from the existing one. This seems so simple yet I have failed to find an ...
1
vote
0answers
47 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
69 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
25 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
239 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
156 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, ...
1
vote
0answers
106 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
0answers
71 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
100 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: ...
2
votes
1answer
180 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
27 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
118 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
112 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
136 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
317 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
98 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
311 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
2answers
335 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
77 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
283 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
228 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 ...
3
votes
0answers
124 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
100 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
403 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
121 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
181 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=<...
3
votes
1answer
206 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
66 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
564 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
218 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 ...
7
votes
1answer
879 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
145 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
454 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
291 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
443 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
279 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
432 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 house ...