Skip to content

Commit

Permalink
OGRSpatialReference::SetDataAxisToSRSAxisMapping(): improve doc (fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Jan 13, 2024
1 parent 4daa319 commit cf8ffdc
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions ogr/ogrspatialreference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11998,11 +11998,39 @@ const int *OSRGetDataAxisToSRSAxisMapping(OGRSpatialReferenceH hSRS,
/************************************************************************/

/** \brief Set a custom data axis to CRS axis mapping.
*
* The number of elements of the mapping vector should be the number of axis
* of the CRS (as returned by GetAxesCount()) (although this method does not
* check that, beyond checking there are at least 2 elements, so that this
* method and setting the CRS can be done in any order).
* This is taken into account by OGRCoordinateTransformation to transform the
* order of ordinates to transform to the order expected by the CRS before
* transformation, and back to the data order after transformation.
*
* mapping[i] (numbering starting at 1) is the data axis number for the i(th)
* axis of the CRS . A negative value can also be used to ask for a sign
* reversal during coordinate transformation (to deal with northing vs southing,
* easting vs westing, heights vs depths).
*
* When used with OGRCoordinateTransformation,
* - the only valid values for mapping[0] (data axis number for the first axis
* of the CRS) are 1, 2, -1, -2.
* - the only valid values for mapping[1] (data axis number for the second axis
* of the CRS) are 1, 2, -1, -2.
* - the only valid values mapping[2] are 3 or -3.
* Note: this method does not validate the values of mapping[].
*
* mapping=[2,1] typically expresses the inversion of axis between the data
* axis and the CRS axis for a 2D CRS.
*
* Automatically implies SetAxisMappingStrategy(OAMS_CUSTOM)
*
* See OGRSpatialReference::GetAxisMappingStrategy()
* This is the same as the C function OSRSetDataAxisToSRSAxisMapping().
*
* @param mapping The new data axis to CRS axis mapping.
*
* @since GDAL 3.0
* @see OGRSpatialReference::GetDataAxisToSRSAxisMapping()
*/
OGRErr OGRSpatialReference::SetDataAxisToSRSAxisMapping(
const std::vector<int> &mapping)
Expand All @@ -12019,10 +12047,11 @@ OGRErr OGRSpatialReference::SetDataAxisToSRSAxisMapping(
/************************************************************************/

/** \brief Set a custom data axis to CRS axis mapping.
*s
*
* Automatically implies SetAxisMappingStrategy(OAMS_CUSTOM)
*
* See OGRSpatialReference::SetDataAxisToSRSAxisMapping()
* This is the same as the C++ method
* OGRSpatialReference::SetDataAxisToSRSAxisMapping()
*
* @since GDAL 3.1
*/
Expand Down

0 comments on commit cf8ffdc

Please sign in to comment.