Code

Opened 5 years ago

Last modified 2 years ago

#11854 new New feature

Add support of PostGIS's Azimuth function

Reported by: ckarrie Owned by: nobody
Component: GIS Version: master
Severity: Normal Keywords: azimuth, postgis
Cc: ckarrie@… Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: yes Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

Hi, I would like to see the azimuth function in the gis component.

Thank you very much.

Attachments (2)

azimuth_verbose.txt (1.7 KB) - added by ckarrie 3 years ago.
some verbose infos
django-trunk-rev16840-azimuth-version1.diff (2.6 KB) - added by ckarrie 3 years ago.
first diff, THIS is just a proof of concept

Download all attachments as: .zip

Change History (6)

comment:1 Changed 4 years ago by jacob

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

comment:2 Changed 3 years ago by baumer1122

  • Severity set to Normal
  • Type set to New feature

comment:3 Changed 3 years ago by ckarrie

  • Cc ckarrie@… added
  • Easy pickings unset
  • Has patch set
  • Needs documentation set
  • Needs tests set
  • Patch needs improvement set
  • UI/UX unset
  • Version changed from 1.1 to SVN

Here is my first try, but it doesn't work:

models.py

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.

Changed 3 years ago by ckarrie

some verbose infos

Changed 3 years ago by ckarrie

first diff, THIS is just a proof of concept

comment:4 Changed 2 years ago by aaugustin

  • Triage Stage changed from Design decision needed to Accepted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as new
The owner will be changed from nobody to anonymous. Next status will be 'assigned'
as The resolution will be set. Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.