Skip to content

Commit

Permalink
OSR_DEFAULT_AXIS_MAPPING_STRATEGY: Add doc and test
Browse files Browse the repository at this point in the history
  • Loading branch information
dbaston committed Jul 4, 2023
1 parent ae231d9 commit d2a2b01
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
15 changes: 15 additions & 0 deletions autotest/osr/osr_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2457,3 +2457,18 @@ def test_osr_basic_wkt_format_configuration_option():

assert "BBOX" not in wkt1
assert "BBOX" in wkt2


def test_osr_basic_default_axis_mapping_strategy():

with gdal.config_option(
"OSR_DEFAULT_AXIS_MAPPING_STRATEGY", "TRADITIONAL_GIS_ORDER"
):
crs1 = osr.SpatialReference()
crs1.ImportFromEPSG(4326)

crs2 = osr.SpatialReference()
crs2.ImportFromEPSG(4326)

assert crs1.GetAxisMappingStrategy() == osr.OAMS_TRADITIONAL_GIS_ORDER
assert crs2.GetAxisMappingStrategy() == osr.OAMS_AUTHORITY_COMPLIANT
8 changes: 8 additions & 0 deletions doc/source/user/configoptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,14 @@ PROJ options
Helmert transformation to WGS84 when there is exactly one such method
available for the CRS.

- .. config:: OSR_DEFAULT_AXIS_MAPPING_STRATEGY
:choices: TRADITIONAL_GIS_ORDER, AUTHORITY_COMPLIANT
:default: AUTHORITY_COMPLIANT
:since: 3.5

Determines whether to honor the declared axis mapping of a CRS or override it
with the traditional GIS ordering (x = longitude, y = latitude).

- .. config:: OSR_STRIP_TOWGS84
:choices: YES, NO
:default: YES
Expand Down

0 comments on commit d2a2b01

Please sign in to comment.