﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24136	GeoQueryset.extent() -> TypeError	DemarsM	nobody	"Im trying to get the extent of a GeoQueryset as explained in the doc:


{{{
class Feature(models.Model):
    geom_point = models.PointField(srid=3857, blank=True, null=True)
    geom_multipoint = models.MultiPointField(srid=3857, blank=True, null=True)
    geom_multilinestring = models.MultiLineStringField(srid=3857, blank=True, null=True)
    geom_multipolygon = models.MultiPolygonField(srid=3857, blank=True, null=True)
    geom_geometrycollection = models.GeometryCollectionField(srid=3857, blank=True, null=True)
}}}




for a specific feature, only one of the geometry field is not empty


{{{
featuresExtent = Feature.objects.all().extent()
}}}





{{{
Traceback (most recent call last):
  File ""<console>"", line 1, in <module>
  File ""C:\Python27\lib\site-packages\django\contrib\gis\db\models\query.py"", li
ne 119, in extent
    return self._spatial_aggregate(aggregates.Extent, **kwargs)
  File ""C:\Python27\lib\site-packages\django\contrib\gis\db\models\query.py"", li
ne 505, in _spatial_aggregate
    return self.aggregate(geoagg=aggregate(agg_col, **agg_kwargs))['geoagg']
  File ""C:\Python27\lib\site-packages\django\db\models\query.py"", line 325, in a
ggregate
    return query.get_aggregation(using=self.db, force_subq=force_subq)
  File ""C:\Python27\lib\site-packages\django\contrib\gis\db\models\sql\query.py""
, line 76, in get_aggregation
    return super(GeoQuery, self).get_aggregation(using, force_subq)
  File ""C:\Python27\lib\site-packages\django\db\models\sql\query.py"", line 397,
in get_aggregation
    in zip(query.aggregate_select.items(), result)
  File ""C:\Python27\lib\site-packages\django\db\models\sql\query.py"", line 396,
in <genexpr>
    for (alias, aggregate), val
  File ""C:\Python27\lib\site-packages\django\contrib\gis\db\models\sql\query.py""
, line 88, in resolve_aggregate
    return connection.ops.convert_extent(value)
  File ""C:\Python27\lib\site-packages\django\contrib\gis\db\backends\postgis\ope
rations.py"", line 285, in convert_extent
    ll, ur = box[4:-1].split(',')
TypeError: 'NoneType' object has no attribute '__getitem__'
}}}


same error if I do:


{{{
Feature.objects.filter(pk=1).extent()
}}}

"	Bug	closed	GIS	1.7	Normal	fixed			Accepted	0	0	0	0	1	0
