* cc: ckarrie@… (added)
* needs_better_patch: 0 => 1
* needs_tests: 0 => 1
* version: 1.1 => SVN
* easy: => 0
* needs_docs: 0 => 1
* has_patch: 0 => 1
* ui_ux: => 0
Comment:
Here is my first try, but it doesn't work:
'''models.py'''
{{{#!python
class Project(models.Model):
name = models.CharField(max_length=100)
center = models.PointField()
objects = models.GeoManager()
}}}
'''Shell'''
{{{
>>> from karrie.django.ogna.models import Project
>>> mz = Project.objects.get(name="Mainz")
>>> a_dist = Project.objects.distance(mz.center)
>>> a_dist[0].distance
Distance(m=84958.0635775)
>>> a_azimuth = Project.objects.azimuth(mz.center)
>>> a_azimuth[0].azimuth
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py",
line 189, in __getitem__
return list(qs)[0]
IndexError: list index out of range
>>>
}}}
Could somebody point me in the right direction? I plan to implement more
spatial functions (mainly PostGIS) into GeoDjango.
I added a patch and a file with some more verbose infos.
--
Ticket URL: <https://code.djangoproject.com/ticket/11854#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* stage: Design decision needed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/11854#comment:4>
* status: new => assigned
* owner: nobody => sir-sigurd
--
Ticket URL: <https://code.djangoproject.com/ticket/11854#comment:5>
* needs_better_patch: 1 => 0
* needs_tests: 1 => 0
* needs_docs: 1 => 0
Comment:
[https://github.com/django/django/pull/8286 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/11854#comment:6>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"5e710cf4a5dba1fc30e3b6775b83c2218e57cd36" 5e710cf4]:
{{{
#!CommitTicketReference repository=""
revision="5e710cf4a5dba1fc30e3b6775b83c2218e57cd36"
Fixed #11854 -- Added Azimuth GIS function. (#8286)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/11854#comment:7>