Opened 10 years ago

Closed 2 years ago

Last modified 2 years ago

#12410 closed New feature (fixed)

add support for St_Line_Locate_Point to geodjango postgis backend

Reported by: IanWard Owned by: Sergey Fedoseev
Component: GIS Version: master
Severity: Normal Keywords: St_Line_Locate_Point
Cc: ckesselh Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


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.

Attachments (1)

line_locate_point.patch (2.9 KB) - added by IanWard 10 years ago.

Download all attachments as: .zip

Change History (15)

Changed 10 years ago by IanWard

Attachment: line_locate_point.patch added

comment:1 Changed 9 years ago by Russell Keith-Magee

Triage Stage: UnreviewedDesign decision needed

comment:2 Changed 9 years ago by jbronn

milestone: 1.3
Owner: changed from nobody to jbronn
Status: newassigned

comment:3 Changed 9 years ago by wardi

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?

comment:4 Changed 8 years ago by jbronn

milestone: 1.31.4

comment:5 Changed 8 years ago by Matt McClanahan

Severity: Normal
Type: New feature

comment:6 Changed 8 years ago by ckesselh

Easy pickings: unset
UI/UX: unset

comment:7 Changed 8 years ago by ckesselh

Cc: ckesselh added

comment:8 Changed 8 years ago by Jacob

milestone: 1.4

Milestone 1.4 deleted

comment:9 Changed 6 years ago by Aymeric Augustin

Triage Stage: Design decision neededAccepted

comment:10 Changed 5 years ago by Tim Graham

Needs tests: set

comment:11 Changed 4 years ago by Sergey Fedoseev

Owner: changed from jbronn to Sergey Fedoseev

comment:12 Changed 2 years ago by Sergey Fedoseev

Needs tests: unset

comment:13 Changed 2 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In ede4f6d4:

Fixed #12410 -- Added LineLocatePoint GIS function.

comment:14 Changed 2 years ago by Tim Graham <timograham@…>

In 17e078d:

Refs #12410 -- Doc'd LineLocatePoint in functions' summary table.

Note: See TracTickets for help on using tickets.
Back to Top