Skip to content

Commit

Permalink
Merge pull request #4177 from joukewitteveen/patch-1
Browse files Browse the repository at this point in the history
Support default context as nullptr in coordinateTransform
  • Loading branch information
rouault authored Jun 20, 2024
2 parents cc3ecae + 1b684bc commit 2495779
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/iso19111/operation/singleoperation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ CoordinateOperation::normalizeForVisualization() const {
* It should not be used after the context has been destroyed.
*
* @param ctx Execution context to which the transformer will be tied to.
* If null, the default context will be used (only sfe for
* If null, the default context will be used (only safe for
* single-threaded applications).
* @return a new CoordinateTransformer instance.
* @since 9.3
Expand Down Expand Up @@ -438,6 +438,9 @@ CoordinateTransformer::create(const CoordinateOperationNNPtr &op,
PJ_CONTEXT *ctx) {
auto transformer = NN_NO_CHECK(
CoordinateTransformer::make_unique<CoordinateTransformer>());
// pj_obj_create does not sanitize the context
if (ctx == nullptr)
ctx = pj_get_default_ctx();
transformer->d->pj_ = pj_obj_create(ctx, op);
if (transformer->d->pj_ == nullptr)
throw util::UnsupportedOperationException(
Expand Down

0 comments on commit 2495779

Please sign in to comment.