-
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
Problem with projection and geoJSON? #116
Comments
Hmm. Well, partly this is expected when you have an orthographic projection where the clip angle is not 90° so the back hemisphere is visible: If you want to display the whole earth, I think you want to set the clip angle to 180° rather than using antimeridian clipping, if you aren’t already, since you won’t want a cut along the antimeridian. var projection = d3.geoOrthographic()
.scale(radius)
.clipAngle(180); That seems to fix some of the transient winding order issues, but, it looks like there are other winding order issues, probably because the topology is more interesting with the milky way shape than typical continents. See the winding order bl.ock for details. You probably need to reverse one (or more) of the rings in the GeoJSON to fix the winding order problem, but I think you’ll have to figure that out by hand. I might look later if I have time. |
Here’s a fixed-ish version: https://bl.ocks.org/mbostock/15a373ce034cbc4ad604767c0eac05cb |
Hi, Indeed. Thank you very much for your help! Regards, |
Hi Mike, Sorry to re-open that. In your example, you use a canvas and it seems that it is not so convenient to use with d3.js. In particular, we want to manipulate many svg elements on top of the milky way. Would you have a solution which works without the canvas? Best regards, P.S. BTW, d3-celestial https://github.com/ofrohn/d3-celestial (e.g. http://armchairastronautics.blogspot.de/p/skymap.html) shows the same problem with the milky way in orthographic projection. |
Please use Stack Overflow tag d3.js to ask for help. Although I make an effort to assist everyone that asks, I am not always available to provide help promptly or directly. Stack Overflow provides a better collaborative forum for self-help: tens of thousands of D3-related questions have already been asked there, and some answered questions may be relevant to you. When asking for help, please include a link to a live example that demonstrates the issue, preferably on bl.ocks.org. It is often impossible to debug from code snippets alone. Isolate the issue and reduce your code as much as possible before asking for help. The less code you post, the easier it is for someone to debug, and the more likely you are to get a helpful response. If you have a question about D3’s behavior and want to discuss it with other users, also consider the d3-js Google Group or joining the d3-js Slack. Thank you! 🤗 |
Hi,
I have an issue with the representation of a geoJSON file. It seems that the contours are, in some cases (depending on the rotation), misinterpreted and inner/outer regions are mixed up. See the attached screenshots and the codepen https://codepen.io/anon/pen/wdYmqL where you can manually rotate the projection.
Do you think it is an intrinsic problem of geoJSON, a projection-related problem, or a anything wrong in my example? Thanks!
The text was updated successfully, but these errors were encountered: