Questions tagged [postgis-raster]

To store and analyze raster data in PostGIS, use the raster data type.

20 questions
5
votes
1 answer

GeoDjango tif import with "Raster needs to be opened in write mode to change values error"

I am trying to import raster file to PostGIS via Django Shell. I create a class in my model, looks like that: class MaxentModel(gismodels.Model): birdname = models.ForeignKey('BirdName', null=True) model_probability =…
Bulva
  • 1,208
  • 14
  • 28
4
votes
3 answers

django.db.utils.ProgrammingError: type "raster" does not exist

my models: I have created 3 models here and When I migrate then I get the error. from django.contrib.gis.db import models from django.contrib.gis.db.models.fields import RasterField class WorldBorder(models.Model): # Regular Django fields…
manish
  • 302
  • 2
  • 15
4
votes
1 answer

how to deal with raster2pgsql tiles?

I imported raster file into PostGIS using raster2pgsql, I set the -t 50x50 and it generated about 500 rows. I know these -t divides the raster into small tiles and the rid can index them. I saw many examples using rid=2 in the where clause to…
user2146141
  • 155
  • 1
  • 14
3
votes
0 answers

PostGIS Raster compute min, max altitude value and slope from a DEM

I have a DEM dataset and some polygons that represents parcels. For each parcels I would like to compute the maximum/minimum altitude and the average slope. Based on the PostGIS documentation and several example on Internet, two functions could be…
Arnaud Geotribu
  • 919
  • 4
  • 11
  • 22
2
votes
1 answer

How to export raster from PostGIS in one go?

In the simplified canonical example (which I often see on forums and in the books) of a raster exporting script the OID (returned by lo_create(0), here is 9585208) has to be known before the penultimate script line (lo_export 9585208…
Evgeny
  • 305
  • 3
  • 16
2
votes
1 answer

Raster ST_Clip fails when a geometry barely intersects

I am trying to perform spatial statistics using postgis. Once in a while I have ST_Clip crushes and halt the query. I figure that this occurs when polygon barely intersects with raster. Please see the sample below. SELECT ST_Summary( …
yosukesabai
  • 6,184
  • 4
  • 30
  • 42
2
votes
0 answers

How to publish additional postgis raster layer attributes in geoserver?

i was wondering if any of You can help me with my problem. I'm storing some rasters in Postgis database. Each raster is in its own table and besides 'rid' and 'rast' columns, I manualy added other columns to store raster attributes such as…
2
votes
1 answer

catch errors of postgis st_clip, and fix "Could not get band from working raster"

I have millions of polygons, and one larger table of raster (tiled). I want to st_clip(raster, polygon), then apply st_summarystatsagg() on the clipped raster. Code looks like below. with pieces as ( select d.pid, st_clip(r.rast, d.geom)…
yosukesabai
  • 6,184
  • 4
  • 30
  • 42
2
votes
1 answer

lower resolution of raster in PostGIS

how can I lower the resolution of my raster image in PostGIS? And does someone has an example for that operation? I am trying to import raster images with raster2pgsql, I suppose that there is a tag, that manages that problem but I am not sure about…
user5558121
1
vote
1 answer

rt_raster_to_gdal: Could not load the output GDAL driver

I have a postgresql remote database where all postgis and raster features have been enabled. I am trying to execute a query of a raster table within a schema but the system returns the following error rt_raster_to_gdal: Could not load the output…
1
vote
1 answer

raster2pgsql - free(): invalid pointer Aborted (core dumped)

I've installed on my CentOS 8 server Postgres12 with Postgis30_12 and when I run the command raster2pgsql I get : free(): invalid pointer Aborted (core dumped) When reading the coredump with: coredumpctl --debugger=lldb debug 685510 the result…
1
vote
1 answer

Getting the aspect from a raster at a specified lat/long in PostGIS

I am looking for a simple example of using ST_Aspect() to find the aspect at a specified lat/long pair.
Craeft
  • 227
  • 1
  • 11
0
votes
0 answers

Making slices through postgis raster tables

I have an existing python script that i am trying to "translate" into postgres sql. The reason for this is that the server im using for this is not running python. The objective is to slice through several postgis raster tabels intersecting a…
0
votes
1 answer

Permission denied for postgis options

I'm thinking of how I can implement out-DB rasters in pgAdmin. When I went over the documentation provided here, I was stumped at the part where it tells me to SET postgis.enable_outdb_rasters = true; SET postgis.gdal_enabled_drivers TO…
huski1018
  • 11
  • 2
0
votes
0 answers

Is postgis.enable_outdb_rasters allowed in Serverless Postgresql Aurora Cluster on AWS

I am trying to activate postgis.enable_outdb_rasters in an Aurora V2 Postgresql Serverless Cluster. I have enabled postgis.gdal_enabled_drivers succesfully (with SET postgis.gdal_enabled_drivers = 'ENABLE_ALL'), and the out of db drivers are present…
1
2