I am working on a Django project that uses Django ORM to export raster data into PostGIS database. Here is the Django model:

from django.contrib.gis.db import models
class RasterWithName(models.Model):
    rast = models.RasterField()
    name = models.TextField()

Currently, in the database, I have 3 rows of data. The picture below shows this:

enter image description here

Then, I go to Django's shell using python manage.py shell. What should I write (other than RasterWithName.objects.raw() in the shell to perform a query on the rasters and get raster values for, let's say, a point with the location of (lat=10, lon=10) in a list ?

I could not find an equivalent for ST_Value in GeoDjango.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.