-
Notifications
You must be signed in to change notification settings - Fork 201
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
Clip polygon #124
Clip polygon #124
Conversation
if the projection is using antimeridian clipping, use that also for the sphereStream if the projection is using angle clipping, use 180 (i.e. no clipping) for the sphere stream
For the record 3df20ab#diff-17e3641b0cc55c3ac139841ba77aa058L109 was necessary to avoid |
…er to fix the precision to 1 for polyhedral projections (after all we're just drawing a straight line in any case) https://gateway.ipfs.io/ipfs/QmZdXgR4wEosW1Ues3ZcfcDBJP1pnKSeErgz4fkVVJbntq/2017-08/artifact-lee-projection-precision.png
This clipPolygon branch works, but it is a bit messy, and will need in any case to be complemented with the complex branch. (Complex introduces the Cox (equilateral triangle) and Lee (conformal tetrahedral) projections.) I separated the two needs while developing, but Lee's North aspect needs clipPolygon to work. So, instead of maintaining three branches (clipPolygon, complex, and a merge of them), I think I'd like to PR a unique (& cleanly rebased) branch. This also needs to settle on d3-geo's API design for clipPolygon(). |
… centroids — solves a lot of the issues at d3/d3-geo#108 (comment) and allows to use clipPolygon() properly on all polyhedral projections (tested to this date).
This is now living in https://github.com/d3/d3-geo-polygon |
Note that d3-geo-polygon is still unstable. When we stream points that belong to the clipping polygon itself, it sometimes bleeds out -- for example on the Waterman projection with a default aspect -- rotate [0,0]). I have been as conservative as possible: d3-geo-projection works as usual without d3-geo-polygon, and checks that it has projection.preclip (d3-geo > 1.8.1). Examples and issues at [d3-geo-polygon](https://github.com/d3/d3-geo-polygon) Solves #129 Solves #124 Solves d3/d3-geo#108 Solves #86
Note that d3-geo-polygon is still unstable. When we stream points that belong to the clipping polygon itself, it sometimes bleeds out -- for example on the Waterman projection with a default aspect -- rotate [0,0]). I have been as conservative as possible: d3-geo-projection works as usual without d3-geo-polygon, and checks that it has projection.preclip (d3-geo > 1.8.1). Examples and issues at [d3-geo-polygon](https://github.com/d3/d3-geo-polygon) Solves #129 Solves #124 Solves d3/d3-geo#108 Solves #86
polyhedral uses projection.clipPolygon() if present (d3/d3-geo#108).
This will allow building "maps in a cube" (#86).
We can optionally remove this test once d3-geo has clipPolygon.