GeoQuerySet methods should filter out NULL values by default
|Reported by:||Nathaniel Whiteinge||Owned by:||jbronn|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Given the following GIS model:
class SomeModel(models.Model): location = models.PointField(null=True) <snip>
When populated with instances that both have and do not have location information, doing a
distance(geom) query yields unexpected results.
SomeModel.objects.distance(somePoint) returns no results at all.
SomeModel.objects.filter(location__isnull=False).distance(somePoint) works as expected.
distance(geom) results that cannot calculate distance should simply return None.
Change History (7)
comment:2 Changed 7 years ago by
|Owner:||changed from nobody to jbronn|
|Status:||new → assigned|
|Summary:||distance(geom) results ambiguous when the PointField can be null → GeoQuerySet methods should filter out NULL values by default|
|Triage Stage:||Unreviewed → Accepted|