add support for St_Line_Locate_Point to geodjango postgis backend
Here's a patch that adds a line_locate_point method to the GeoQuerySet class, allowing a calculation of the closest point along a LineString to a point field. The value returned is a float between 0 and 1. This is useful for estimating addresses and ordering points given a LineString reference.
Change History
(15)
| Triage Stage: |
Unreviewed → Design decision needed
|
| milestone: |
→ 1.3
|
| Owner: |
changed from nobody to jbronn
|
| Status: |
new → assigned
|
| Severity: |
→ Normal
|
| Type: |
→ New feature
|
| Easy pickings: |
unset
|
| UI/UX: |
unset
|
| Triage Stage: |
Design decision needed → Accepted
|
| Owner: |
changed from jbronn to Sergey Fedoseev
|
| Resolution: |
→ fixed
|
| Status: |
assigned → closed
|
This might be a better API for LineLocatePoint (and possibly other GIS QuerySet methods)
from django.contrib.gis.db import LineLocatePoint #... points_of_interest = points_of_interest.annotate( line_locate_point=LineLocatePoint('my_point_field', along_path)) points_of_interest = points_of_interest.order_by('line_locate_point')The current GIS methods behave like annotate, so why not use a similar interface?