Opened 3 weeks ago
Last modified 3 weeks ago
#37420 assigned New feature
GIS ST_MakeLine, ST_Union and ST_Collect should accept the ORDER BY clause
| Reported by: | Jefferson Raylan | Owned by: | Jefferson Raylan |
|---|---|---|---|
| Component: | GIS | Version: | 6.1 |
| Severity: | Normal | Keywords: | |
| Cc: | Jefferson Raylan, Vaibhav Pant | Triage Stage: | Accepted |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Since PostGIS version 2.2, ST_MakeLine, ST_Union, and ST_Collect accept the ORDER BY clause when running on PostgreSQL version 9+. However, Django still does not support it. It would be nice to have this feature integrated. Since Django currently requires PostgreSQL version 15+ and PostGIS version 3.2, backward compatibility so it should not be an issue
Postgres 9.0.0 release note:
https://www.postgresql.org/docs/release/9.0.0/#AEN103013
PostGIS 2.2 ST_MakeLine manual:
https://postgis.net/docs/manual-2.2/ST_MakeLine.html#idm4835
Django 6.1 release note about PostgreSQL version:
https://docs.djangoproject.com/en/6.1/releases/6.1/#dropped-support-for-postgresql-14
Django 6.1 release note about PostGIS version:
https://docs.djangoproject.com/en/6.1/releases/6.1/#id3
Change History (7)
follow-ups: 3 7 comment:1 by , 3 weeks ago
| Triage Stage: | Unreviewed → Accepted |
|---|---|
| Type: | Uncategorized → New feature |
follow-up: 5 comment:2 by , 3 weeks ago
| Cc: | added |
|---|
Hi Jefferson, are you planning to work on this? If not, I’d be happy to take it.
comment:3 by , 3 weeks ago
Replying to Jacob Walls:
Thanks, it should be relatively simple: setting
allow_order_by = Trueon theMakeLineclass, etc., and checking cross-database support.
Do you know if
ExtentandExtent3Dalso support ordering?
Finally, would you like to submit a PR?
It's not that simple. Other backend may not support ORDER BY on those aggregate, so I followed the same principle used in disallowed_aggregates. I'll be happy to submit a pull request.
comment:4 by , 3 weeks ago
| Owner: | set to |
|---|---|
| Status: | new → assigned |
comment:5 by , 3 weeks ago
Replying to Vaibhav Pant:
Hi Jefferson, are you planning to work on this? If not, I’d be happy to take it.
Hi, I'm already working on this. But any feedback and contribution are more than welcome.
comment:7 by , 3 weeks ago
Replying to Jacob Walls:
Do you know if
ExtentandExtent3Dalso support ordering?
The result of Extent and Extent3D aggregations shouldn't change based on the order of the entries, since they look for the min and max values, so I don't think it's really necessary.
Thanks, it should be relatively simple: setting
allow_order_by = Trueon theMakeLineclass, etc., and checking cross-database support.Do you know if
ExtentandExtent3Dalso support ordering?Finally, would you like to submit a PR?