Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 8.0] Revert "proj_create_crs_to_crs_from_pj(): do not use PROJ_SPATIAL_CRITERION_PARTIAL_INTERSECTION if area is specified" #2679

Merged
merged 1 commit into from
Apr 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/4D_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1350,11 +1350,9 @@ PJ *proj_create_crs_to_crs_from_pj (PJ_CONTEXT *ctx, const PJ *source_crs, cons
area->east_lon_degree,
area->north_lat_degree);
}
else {
proj_operation_factory_context_set_spatial_criterion(
ctx, operation_ctx, PROJ_SPATIAL_CRITERION_PARTIAL_INTERSECTION);
}

proj_operation_factory_context_set_spatial_criterion(
ctx, operation_ctx, PROJ_SPATIAL_CRITERION_PARTIAL_INTERSECTION);
proj_operation_factory_context_set_grid_availability_use(
ctx, operation_ctx,
proj_context_is_network_enabled(ctx) ?
Expand Down
24 changes: 24 additions & 0 deletions test/unit/gie_self_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,30 @@ TEST(gie, proj_create_crs_to_crs_outside_area_of_use) {

// ---------------------------------------------------------------------------

TEST(gie, proj_create_crs_to_crs_with_area_large) {

// Test bugfix for https://github.com/OSGeo/gdal/issues/3695
auto area = proj_area_create();
proj_area_set_bbox(area, -14.1324, 49.5614, 3.76488, 62.1463);
auto P = proj_create_crs_to_crs(PJ_DEFAULT_CTX, "EPSG:4277", "EPSG:4326",
area);
proj_area_destroy(area);
ASSERT_TRUE(P != nullptr);
PJ_COORD c;

c.xyzt.x = 50; // Lat in deg
c.xyzt.y = -2; // Long in deg
c.xyzt.z = 0;
c.xyzt.t = HUGE_VAL;
c = proj_trans(P, PJ_FWD, c);
EXPECT_NEAR(c.xy.x, 50.00065628, 1e-8);
EXPECT_NEAR(c.xy.y, -2.00133989, 1e-8);

proj_destroy(P);
}

// ---------------------------------------------------------------------------

TEST(gie, proj_trans_generic) {
// GDA2020 to WGS84 (G1762)
auto P = proj_create(
Expand Down