#11854: Add support of PostGIS's Azimuth function
-------------------------------------+-------------------------------------
Reporter: ckarrie | Owner: nobody
Type: New | Status: new
feature | Component: GIS
Milestone: | Severity: Normal
Version: SVN | Keywords: azimuth, postgis
Resolution: | Has patch: 1
Triage Stage: Design | Needs tests: 1
decision needed | Easy pickings: 0
Needs documentation: 1 |
Patch needs improvement: 1 |
UI/UX: 0 |
-------------------------------------+-------------------------------------
Changes (by ckarrie):
* 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.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.