[Django] #33274: Point coordinates should accept Decimal

7 views
Skip to first unread message

Django

unread,
Nov 9, 2021, 9:22:03 AM11/9/21
to django-...@googlegroups.com
#33274: Point coordinates should accept Decimal
------------------------------------------------+------------------------
Reporter: IulianCrudu | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: GIS | Version: 3.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
------------------------------------------------+------------------------
https://github.com/django/django/blob/6bc437c0d82675ebe6aa92c8e249892205c316ef/django/contrib/gis/geos/point.py#L9
This should allow for x/y/z to be Decimal and if needed convert to float
inside the __init__ method.

--
Ticket URL: <https://code.djangoproject.com/ticket/33274>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 10, 2021, 2:54:52 AM11/10/21
to django-...@googlegroups.com
#33274: Point coordinates should accept Decimal
-------------------------------------+-------------------------------------
Reporter: Iulian Crudu | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: GIS | Version: 3.2
Severity: Normal | Resolution: wontfix

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* status: new => closed
* resolution: => wontfix


Comment:

Hi Iulian. Thanks for the report.

I'm going to say `wontfix` here initially. Loosening the accepted types
adds complexity, and it's not clear that only `Point` would need to be
adjusted.
Rather, I'd suggest casting your data before instantiating the `Point` (as
I presume you're doing).

It may be worth a post on the
[https://forum.djangoproject.com/c/internals/geodjango/13 GeoDjango
category of the Forum] to discuss your use-case and how best to
handle/support `Decimal` instances.

--
Ticket URL: <https://code.djangoproject.com/ticket/33274#comment:1>

Reply all
Reply to author
Forward
0 new messages