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
Bad reprojection of antimeridian query bbox #2648
Comments
rcoup
added a commit
to rcoup/mapnik
that referenced
this issue
Jan 27, 2015
When doing an envelope-points reprojection to a geographic CS, check the points stay in clockwise order. Otherwise expand the resulting bounds to include the world.
rcoup
added a commit
to rcoup/mapnik
that referenced
this issue
Jan 27, 2015
When doing an envelope-points reprojection to a geographic CS, check the points stay in clockwise order. Otherwise expand the resulting bounds to include the world. Includes visual test. Cairo tests aren't finding differences, but the renderer is doing the right thing.
rcoup
added a commit
to rcoup/mapnik
that referenced
this issue
Jan 27, 2015
When doing an envelope-points reprojection to a geographic CS, check the points stay in clockwise order. Otherwise expand the resulting bounds to include the world. Includes visual test. Cairo tests aren't finding differences, but the renderer is doing the right thing.
rcoup
added a commit
to rcoup/mapnik
that referenced
this issue
Jan 27, 2015
When doing an envelope-points reprojection to a geographic CS, check the points stay in clockwise order. Otherwise expand the resulting bounds to include the world. Includes visual test. Cairo tests aren't finding differences, but the renderer is doing the right thing.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Maps are hard in New Zealand.
We've found a bug rendering an image of a dataset covering both mainland NZ (west of the antimeridian) and the Chatham Islands (east of the antimeridian.)
Some data near the antimeridian is missing from the rendered image, due to a badly calculated query bbox.
The bug happens when all of these are true:
maximum-extent
in NZTM covers the antimeridianIt seems the logic for calculating the query bbox in this instance is:
maximum-extent
, and potentially buffers it a little (0px in this case)so far so good - see screenshot:
Then:
Here's a fairly minimal testcase (a few points) which demonstrates the render gap across the antimeridian.
I suspect a fix might involve calculating cross-products to determine winding order of the 20-point query box. If the winding order changes when reprojected, the box has hit the antimeridian. Then you could snap the X values outward to +/- 180.
A related performance issue: in this case the query box covers the whole width of the world, so potentially is going to be quite slow. Snapping the X values outward to fix the rendering gap won't fix that performance issue. However an alternative would involve splitting the box into multiple boxes, and that'd probably be much harder.
The text was updated successfully, but these errors were encountered: