﻿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
15165	GeoQuerySet.perimeter returns invalid results on geometry fields with geodetic coordinate systems	jbronn	Tim Graham <timograham@…>	"The method `GeoQuerySet.perimeter` returns `Distance` objects with erroneous values when called on a geometry field that has a geodetic coordinate system (e.g., `srid=4326`).  The values in the returned distance objects are really perimeter measurements in degrees of latitude/longitude, rather than meters.

Here's an example using the models and data from the [http://docs.djangoproject.com/en/dev/ref/contrib/gis/tutorial/ GeoDjango tutorial]:
{{{
#!python
>>> from world.models import WorldBorders
>>> us = WorldBorders.objects.perimeter().get(name='United States')
>>> print us.perimeter
771.493229562 m
}}}

Obviously, the perimeter of the United States is greater than a kilometer.  To fix, the helper method `GeoQuerySet._distance_attribute` needs to be modified to raise an exception  or return a raw numeric value when attempting to calculate perimeters on geodetic coordinate systems."	Bug	closed	GIS	1.2	Normal	fixed	perimeter		Accepted	1	0	0	1	0	0
