diff options
| author | Kristian Evers <kristianevers@gmail.com> | 2018-03-27 16:47:29 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-03-27 16:47:29 +0200 |
| commit | 9874f6078a5fa8981dba6a96adcffbc7a3ec7e8f (patch) | |
| tree | 4d0532ca2a4b2fb832e016723f2cc15900c4876c /src | |
| parent | a1d924593d55d462536b6243e2e29a5a0386d443 (diff) | |
| parent | bcd647fe82e45efd51c3a64e348b99b38c839e2b (diff) | |
| download | PROJ-9874f6078a5fa8981dba6a96adcffbc7a3ec7e8f.tar.gz PROJ-9874f6078a5fa8981dba6a96adcffbc7a3ec7e8f.zip | |
Merge pull request #906 from kbevers/validate-pipeline-units
Validate pipeline units
Diffstat (limited to 'src')
| -rw-r--r-- | src/PJ_axisswap.c | 4 | ||||
| -rw-r--r-- | src/PJ_pipeline.c | 13 |
2 files changed, 15 insertions, 2 deletions
diff --git a/src/PJ_axisswap.c b/src/PJ_axisswap.c index 44446d9c..0b81a733 100644 --- a/src/PJ_axisswap.c +++ b/src/PJ_axisswap.c @@ -277,8 +277,8 @@ PJ *CONVERSION(axisswap,0) { P->left = PJ_IO_UNITS_ANGULAR; P->right = PJ_IO_UNITS_ANGULAR; } else { - P->left = PJ_IO_UNITS_PROJECTED; - P->right = PJ_IO_UNITS_PROJECTED; + P->left = PJ_IO_UNITS_WHATEVER; + P->right = PJ_IO_UNITS_WHATEVER; } diff --git a/src/PJ_pipeline.c b/src/PJ_pipeline.c index 2791a4e8..b60e05a8 100644 --- a/src/PJ_pipeline.c +++ b/src/PJ_pipeline.c @@ -470,6 +470,19 @@ PJ *OPERATION(pipeline,0) { } } + /* Check that output units from step i are compatible with expected units in step i+1 */ + for (i = 1; i < nsteps; i++) { + enum pj_io_units unit_returned = pj_right (P->opaque->pipeline[i]); + enum pj_io_units unit_expected = pj_left (P->opaque->pipeline[i+1]); + + if ( unit_returned == PJ_IO_UNITS_WHATEVER || unit_expected == PJ_IO_UNITS_WHATEVER ) + continue; + if ( unit_returned != unit_expected ) { + proj_log_error (P, "Pipeline: Mismatched units between step %d and %d", i, i+1); + return destructor (P, PJD_ERR_MALFORMED_PIPELINE); + } + } + proj_log_trace (P, "Pipeline: %d steps built. Determining i/o characteristics", nsteps); /* Determine forward input (= reverse output) data type */ |
