Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#20718 closed Bug (worksforme)

Geoqueryset method do not return a value

Reported by: burton449geo@… Owned by: nobody
Component: GIS Version: 1.5-rc-1
Severity: Normal Keywords: geodjango
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Im trying to get values from geoqueryset methods but they do not return values. I use spatialite 4.0.0 as db.


bounds = Feature.objects.filter(
print bounds.perimeter

<bound method GeoQuerySet.perimeter of [<Feature: 43>]>

other example:

bounds = Feature.objects.filter(
print bounds.geojson(bbox=True)

[<Feature: 43>]

other example:

bounds = Feature.objects.filter(
print bounds.geojson(bbox=True)

<bound method GeoQuerySet.area of [<Feature: 38>]>

Change History (3)

comment:1 Changed 5 years ago by Claude Paroz

Resolution: worksforme
Status: newclosed

As documented here:, envelope is adding an envelope property for each element in the queryset.

So I'm not sure exactly what you expected. But envelope() is not meant to return a special result, it only adds an attribute on result objects.

Seeing that envelope is currently untested, I'll commit a test soon.

comment:2 Changed 5 years ago by Claude Paroz <claude@…>

In 6157192b6e15ca94734e56be6c71a4154c6015bd:

Added a test for the envelope() GeoQuerySet method

Refs #20718.

comment:3 Changed 5 years ago by burton449geo@…

Ok, I understand that the methods do not return values but something seems to be wrong anyway

bounds = Feature.objects.filter(

<bound method GeoQuerySet.geojson of [<Feature: 17>]>

With Spatialite 4.0.0 the area() method just not work:

bounds = Feature.objects.filter(

no such table: spatial_ref_sys

But the table spatial_ref_sys do exists in the db

Note: See TracTickets for help on using tickets.
Back to Top