Opened 14 months ago

Closed 14 months ago

Last modified 13 months ago

#34882 closed Bug (fixed)

options=0 is not respected when calling AsGeoJSON()

Reported by: Denis Rouzaud Owned by: Denis Rouzaud
Component: GIS Version: 4.2
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When calling AssGeoJSON, if bbox and crs are both false, then options = 0, there fore not added to the expression. See [0].

In Postgis [1], with geometries, the default is not 0 but 8, meaning the CRS is returned, not respecting the original call arguments.

[0] https://github.com/django/django/blob/6ad0dbc8d90ef37731608f7ac3d6e1d62cc8c765/django/contrib/gis/db/models/functions.py#L198
[1] https://postgis.net/docs/ST_AsGeoJSON.html

Change History (10)

comment:1 by Mariusz Felisiak, 14 months ago

Component: UncategorizedGIS
Has patch: set
Needs tests: set
Owner: changed from nobody to Denis Rouzaud
Status: newassigned
Summary: Options are not respected when calling contrib.gis.db.models.functions.AsGeoJSONoptions=0 is not respected when calling AsGeoJSON()
Triage Stage: UnreviewedAccepted
Type: UncategorizedBug

Good catch. Please add a regression test.

PR

comment:3 by Umang Patel, 14 months ago

Owner: changed from Denis Rouzaud to Umang Patel

comment:4 by Mariusz Felisiak, 14 months ago

Owner: changed from Umang Patel to Mariusz Felisiak

Umang, please don't reassign tickets that have not been abandoned.

comment:5 by Mariusz Felisiak, 14 months ago

Owner: changed from Mariusz Felisiak to Denis Rouzaud

comment:6 by Mariusz Felisiak, 14 months ago

Needs tests: unset
Triage Stage: AcceptedReady for checkin

comment:7 by GitHub <noreply@…>, 14 months ago

Resolution: fixed
Status: assignedclosed

In 96e7a752:

Fixed #34882 -- Fixed no options in AsGeoJSON() for geometries in non-default CRS.

comment:8 by Mariusz Felisiak <felisiak.mariusz@…>, 14 months ago

In df3f97a7:

[5.0.x] Fixed #34882 -- Fixed no options in AsGeoJSON() for geometries in non-default CRS.

Backport of 96e7a752b6c44a84e18d82d37524c1df64b32e12 from main

comment:9 by GitHub <noreply@…>, 13 months ago

In 6e369f36:

Refs #34882 -- Fixed GISFunctionsTests.test_asgeojson_option_0() test on Oracle.

This uses an example with the same precision for all databases.

Follow up to 96e7a752b6c44a84e18d82d37524c1df64b32e12.

comment:10 by Mariusz Felisiak <felisiak.mariusz@…>, 13 months ago

In bcc6a8ee:

[5.0.x] Refs #34882 -- Fixed GISFunctionsTests.test_asgeojson_option_0() test on Oracle.

This uses an example with the same precision for all databases.

Follow up to 96e7a752b6c44a84e18d82d37524c1df64b32e12.
Backport of 6e369f36f2def929525e524f621eead4b041d1cf from main

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