Skip to content
Closed
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
14 changes: 14 additions & 0 deletions lib/proj/do_proj.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,20 @@ int get_pj_area(const struct pj_info *iproj, double *xmin, double *xmax,
*ymax = y[i];
}

/* detect an attempt to reproject outside the intended area of use */
if (*xmin < -180 && *xmax < -180) {
G_warning(_("The requested region seems to be outside the area of "
"use of the target CRS"));
Comment on lines +171 to +173
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I imagine getting this message I think I would lack three pieces of information:

  1. What region? Is that extent of my raster?
  2. The actual numbers and what's wrong about them. This is what I did for g.region: g.region: Add more detail into error messages #1140 and g.region: Add more detail into LL error messages #1988 in lib/gis/adj_cellhd.c. This may also clarify the uncertainty expressed by "it seems to".
  3. What will happen next. It's a warning, not error, so I would expect the code to go on which it does but it also does some adjustment to the values.

*xmin += 360;
*xmax += 360;
}
if (*xmin > 180 && *xmax > 180) {
G_warning(_("The requested region seems to be outside the area of "
"use of the target CRS"));
*xmin -= 360;
*xmax -= 360;
}

/* The west longitude is generally lower than the east longitude,
* except for areas of interest that go across the anti-meridian.
* do not reduce global coverage to a small north-south strip
Expand Down
Loading