Opened 5 years ago

Last modified 4 weeks ago

#12410 assigned New feature

add support for St_Line_Locate_Point to geodjango postgis backend

Reported by: IanWard Owned by: jbronn
Component: GIS Version: master
Severity: Normal Keywords: St_Line_Locate_Point
Cc: ckesselh Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes 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 5 years ago.

Download all attachments as: .zip

Change History (11)

Changed 5 years ago by IanWard

comment:1 Changed 4 years ago by russellm

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

comment:2 Changed 4 years ago by jbronn

  • milestone set to 1.3
  • Owner changed from nobody to jbronn
  • Status changed from new to assigned

comment:3 Changed 4 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 3 years ago by jbronn

  • milestone changed from 1.3 to 1.4

comment:5 Changed 3 years ago by mattmcc

  • Severity set to Normal
  • Type set to New feature

comment:6 Changed 3 years ago by ckesselh

  • Easy pickings unset
  • UI/UX unset

comment:7 Changed 3 years ago by ckesselh

  • Cc ckesselh added

comment:8 Changed 3 years ago by jacob

  • milestone 1.4 deleted

Milestone 1.4 deleted

comment:9 Changed 16 months ago by aaugustin

  • Triage Stage changed from Design decision needed to Accepted

comment:10 Changed 4 weeks ago by timo

  • Needs tests set

Add Comment

Modify Ticket

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

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

Note: See TracTickets for help on using tickets.