Skip to content

Commit

Permalink
Merge pull request #1421 from OSGeo/backport-1420-to-6.0
Browse files Browse the repository at this point in the history
[Backport 6.0] DOC: add sphinx links to reference in dev quickstart
  • Loading branch information
rouault committed Apr 11, 2019
2 parents ba57407 + f7f6b97 commit 7c36ca4
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions docs/source/development/quickstart.rst
Expand Up @@ -28,7 +28,7 @@ See the :doc:`reference for more info on data types <reference/datatypes>`.
:lines: 43-45
:dedent: 4

For use in multi-threaded programs the ``PJ_CONTEXT`` threading-context is used.
For use in multi-threaded programs the :c:type:`PJ_CONTEXT` threading-context is used.
In this particular example it is not needed, but for the sake of completeness
it created here. The section on :doc:`threads <threads>` discusses
this in detail.
Expand All @@ -38,15 +38,15 @@ this in detail.
:lines: 49
:dedent: 4

Next we create the ``PJ`` transformation object ``P`` with the function
``proj_create``. ``proj_create`` takes the threading context ``C`` created above,
and a proj-string that defines the desired transformation. Here we transform
from geodetic coordinate to UTM zone 32N.
Next we create the :c:type:`PJ` transformation object ``P`` with the function
:c:func:`proj_create`. :c:func:`proj_create` takes the threading context ``C``
created above, and a proj-string that defines the desired transformation.
Here we transform from geodetic coordinate to UTM zone 32N.
It is recommended to create one threading-context per thread used by the program.
This ensures that all ``PJ`` objects created in the same context will be sharing
resources such as error-numbers and loaded grids.
In case the creation of the ``PJ`` object fails an error message is displayed and
the program returns. See :doc:`errorhandling` for further
This ensures that all :c:type:`PJ` objects created in the same context will be
sharing resources such as error-numbers and loaded grids.
In case the creation of the :c:type:`PJ` object fails an error message is
displayed and the program returns. See :doc:`errorhandling` for further
details.

.. literalinclude:: ../../../examples/pj_obs_api_mini_demo.c
Expand All @@ -55,28 +55,28 @@ details.
:dedent: 4

PROJ uses it's own data structures for handling coordinates. Here we use a
``PJ_COORD`` which is easily assigned with the function ``proj_coord``. Note
that the input values are converted to radians with ``proj_torad``. This is
necessary since PROJ is using radians internally. See :doc:`transformations`
:c:type:`PJ_COORD` which is easily assigned with the function :c:func:`proj_coord`.
Note that the input values are converted to radians with :c:func:`proj_torad`.
This is necessary since PROJ is using radians internally. See :doc:`transformations`
for further details.

.. literalinclude:: ../../../examples/pj_obs_api_mini_demo.c
:language: c
:lines: 57
:dedent: 4

The coordinate defined above is transformed with ``proj_trans``. For this
a ``PJ`` object, a transformation direction (either forward or inverse) and the
coordinate is needed. The transformed coordinate is returned in ``b``.
Here the forward (``PJ_FWD``) transformation from geodetic to UTM is made.
The coordinate defined above is transformed with :c:func:`proj_trans`. For this
a :c:type:`PJ` object, a transformation direction (either forward or inverse)
and the coordinate is needed. The transformed coordinate is returned in ``b``.
Here the forward (:c:type:`PJ_FWD`) transformation from geodetic to UTM is made.

.. literalinclude:: ../../../examples/pj_obs_api_mini_demo.c
:language: c
:lines: 60-61
:dedent: 4

The inverse transformation (UTM to geodetic) is done similar to above,
this time using ``PJ_INV`` as the direction.
this time using :c:type:`PJ_INV` as the direction.

.. literalinclude:: ../../../examples/pj_obs_api_mini_demo.c
:language: c
Expand Down

0 comments on commit 7c36ca4

Please sign in to comment.