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

Wrong Dateline wrapping on extents that cross the dateline #4896

Merged
merged 1 commit into from Mar 27, 2014
Merged

Wrong Dateline wrapping on extents that cross the dateline #4896

merged 1 commit into from Mar 27, 2014

Conversation

tbonfort
Copy link
Member

@tbonfort tbonfort commented Mar 27, 2014

Setup:

  • issue a getmap request for a projected SRS, with an extent that crosses the dateline, e.g. -21000000,-21000000,21000000,21000000
  • use a mapfile with a layer who's data is stored in lonlat

Expected:

  • MapServer uses a searchrect for querying the layer data, that ressembles -181,-90,181,90 or -180,-90,180,90

Issue:

  • The searchrect created looks like the red polygon from https://gist.github.com/tbonfort/9779573 which is obviously creating incorrect results. The resulting polygon after this patch is colored in blue.

- Fixes a typo in the shapefile wrapping code to compare a vertex
  against its predecessor rather than the initial vertex to detect
  potential dateline hops.
- Forces +over proj parameter when reprojecting bboxes in order to
  conserve the initial property of wether the bbox intersects the
  dateline.
@tbonfort tbonfort added this to the 7.0 Release milestone Mar 27, 2014
@tbonfort tbonfort self-assigned this Mar 27, 2014
tbonfort added a commit to MapServer/msautotest_DEPRECATED that referenced this pull request Mar 27, 2014
- the wmsclient change was an error in the previous test
- the bounds floating point changes seem cosmetic, but have not been
  investigated further
@tbonfort tbonfort merged commit 46a4fea into MapServer:master Mar 27, 2014
@rouault
Copy link
Contributor

rouault commented Oct 2, 2014

@tbonfort Are you sure about your change in msProjectShapeLine ? The original code was consistant with the use of msTestNeedWrap() done in msProjectLine(), i.e. that we compare the current point with the first point of the line. In which situation does it makes things better to compare to previous point rather than to first point ? Perhaps if we have a polygon with a nearly world extent but that does not cross the antimeridian, and whose point density is sufficiently high so that 2 consecutive points don't have an abs difference of longitude > 180 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants