Questions tagged [postgis-raster]

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

Filter by
Sorted by
Tagged with
2
votes
1answer
181 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
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, ...
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
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 ...
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 ...
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 ...
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'...
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 ...
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 ...
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....
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
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 ...
2
votes
1answer
2k 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 ...
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 ...
4
votes
1answer
543 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
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
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
70 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, ...
3
votes
1answer
758 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
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
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? ...
26
votes
3answers
9k views

Poor performance with storing large rasters in PostGIS and visualising in QGIS

my question concerns the use and performance of several software tools in conjunction, namely PostgreSQL, PostGIS, QGIS, and GDAL. I'm a long-time ArcGIS, Python, and R user who is interested in ...
0
votes
0answers
169 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 ...
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
246 views

Display simple raster file in openlayers

I have raster files (one sample can download from here) just have values for points and in beside i have top-left and bottom-right geo data and pixel size of file. so i want to just simply display ...
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 ...
14
votes
1answer
490 views

PostGIS raster summation (map algebra)

I have a table of polygons representing travel time isochrones on particular days. For each origin point, there are five isochrone geometries (stored in separate rows). For each origin point, I want ...
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 ...
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 ...
4
votes
1answer
571 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 ...
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....
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 ...
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(...
6
votes
0answers
2k views

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

I'm new to postgis and raster file format. i currently working on netcdf files and i want to import it into postgis through curl command line tool but its failed for me.so i jump on to GDAL v1.9.2 ...
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 ...
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
1answer
556 views

How to speed up raster/map algebra in PostGIS?

I am testing map algebra with PostGIS (2.1 with PostgreSQL 9.3) on two images, and found it to be rather slow. For example, dividing two images of 7200 * 3600 pixels took 110 ~ 120s on a desktop with ...
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?...
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 ...