Skip to content

Commit

Permalink
Merge 3d670b8 into 154cc0f
Browse files Browse the repository at this point in the history
  • Loading branch information
kbevers committed Mar 28, 2019
2 parents 154cc0f + 3d670b8 commit 7a74ead
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/source/operations/conversions/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ conversions.
cart
geoc
latlon
noop
pop
push
unitconvert
28 changes: 28 additions & 0 deletions docs/source/operations/conversions/noop.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.. _noop:

================================================================================
No operation
================================================================================

.. versionadded:: 6.1.0

Pass a coordinate through unchanged.

+---------------------+--------------------------------------------------------+
| **Alias** | noop |
+---------------------+--------------------------------------------------------+
| **Domain** | 4D |
+---------------------+--------------------------------------------------------+
| **Input type** | Any |
+---------------------+--------------------------------------------------------+
| **Output type** | Any |
+---------------------+--------------------------------------------------------+

The no operation is a dummy operation that returns whatever is passed to it
as seen in this example::

$ echo 12 34 56 78 | cct +proj=noop
12.0000 34.0000 56.0000 78.0000

The operation has no options and default options will not affect the output.

1 change: 1 addition & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ libproj_la_SOURCES = \
conversions/cart.cpp \
conversions/geoc.cpp \
conversions/geocent.cpp \
conversions/noop.cpp \
conversions/unitconvert.cpp \
\
transformations/affine.cpp \
Expand Down
19 changes: 19 additions & 0 deletions src/conversions/noop.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#define PJ_LIB__

#include "proj_internal.h"

PROJ_HEAD(noop, "No operation");

static PJ_COORD noop(PJ_COORD coord, PJ *P) {
(void) P;
return coord;
}

PJ *CONVERSION(noop, 0) {
P->fwd4d = noop;
P->inv4d = noop;
P->left = PJ_IO_UNITS_WHATEVER;
P->right = PJ_IO_UNITS_WHATEVER;
return P;
}

1 change: 1 addition & 0 deletions src/lib_proj.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ set(SRC_LIBPROJ_CONVERSIONS
conversions/cart.cpp
conversions/geoc.cpp
conversions/geocent.cpp
conversions/noop.cpp
conversions/unitconvert.cpp
)

Expand Down
1 change: 1 addition & 0 deletions src/pj_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ PROJ_HEAD(nell_h, "Nell-Hammer")
PROJ_HEAD(nicol, "Nicolosi Globular")
PROJ_HEAD(nsper, "Near-sided perspective")
PROJ_HEAD(nzmg, "New Zealand Map Grid")
PROJ_HEAD(noop, "No operation")
PROJ_HEAD(ob_tran, "General Oblique Transformation")
PROJ_HEAD(ocea, "Oblique Cylindrical Equal Area")
PROJ_HEAD(oea, "Oblated Equal Area")
Expand Down
17 changes: 17 additions & 0 deletions test/gie/more_builtins.gie
Original file line number Diff line number Diff line change
Expand Up @@ -756,4 +756,21 @@ expect 359 10 0

-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
# No-op
-------------------------------------------------------------------------------
operation +proj=noop
direction forward
accept 25 25
expect 25 25

accept 25 25 25
expect 25 25 25

accept 25 25 25 25
expect 25 25 25 25
-------------------------------------------------------------------------------



</gie>

0 comments on commit 7a74ead

Please sign in to comment.