Comments (6)
d3-geo-projection now has newton.js which can help in some cases
from d3-geo-projection.
https://marcinciura.wordpress.com/2016/11/20/authagraph/ has this note:
As inverting the equations of the projection algebraically is a hopeless task, I resorted to the numerical Broyden’s method. The initial guess of (\phi, \lambda) = f^{-1}(x, y) comes from inverting the gnomonic projection. When the accuracy is set to 10-7 R, i.e. about one metre, the method usually finds \phi and \lambda after 5 iterations.
So it looks like a nice generic method for this would be to use a known inverse proj as a first step, then optimize on the real stuff: unknown.invert = approximation_method (known.invert);
from d3-geo-projection.
@mciura I cited you here also
from d3-geo-projection.
In my experience, Broyden's method had the median number of iterations equal to 5, and the long tail ended at 18 or 19 iterations. I had to come up with nontrivial tricks to make it work near the poles — I suppose Newton–Raphson and any other method would need them too.
from d3-geo-projection.
Here's a function that apparently works correctly for the inverse of:
- ChamberlinAfrica
- ModifiedStereographicAlaska
- ModifiedStereographicGs48
- ModifiedStereographicMiller
- ModifiedStereographicLee
- TwoPointAzimuthalUsa
- ModifiedStereographicGs50 (the part over Europe is broken but it's not supposed to be shown)
- InterruptedSinuMollweide (needs a bit more syntactic sugar to go around interrupt.invert, see block)
- Bertin 1953 (work in progress)
https://bl.ocks.org/Fil/07930ee04d7fbd9e5e3e84e803d35dcf
from d3-geo-projection.
This inverse function now works on all remaining d3 projections.
The code would need to be cleaned up before merging, and before I try and do that, I'd like to know if you think the 2D (and spherical) Newton-Raphson method should be promoted into its own plugin (exporting d3.solve & d3.geoSolve), rather than be constrained to d3-geo.
There's also a problem of convergence, evidenced by the red dots on https://bl.ocks.org/Fil/07930ee04d7fbd9e5e3e84e803d35dcf
This might be fixed by restricting the search domain to the initial clipAngle.
from d3-geo-projection.
Related Issues (20)
- Snyder's "Magnifying-Glass" projections?
- Relax d3-array dependency to 1-2. HOT 3
- compatibility of geoRectangularPolyconicRaw with geoInterrupt HOT 3
- There are es2015 in the final package file HOT 3
- Count Number Of Visible Objects Within Projection HOT 1
- What is the source of the projections? HOT 10
- Pangean projection HOT 5
- Two-point equidistant projection has artifacts when showing the whole world HOT 6
- geoPath.curve ? HOT 1
- Support All US Territories in Albers USA projection HOT 7
- geoProject converts hole to MultiPolygon HOT 2
- Using this lib in TypeScript? HOT 2
- interrupted projections sometimes have partially undefined inverse HOT 2
- More customizable Wagner projections (and others)? HOT 7
- Add Cupola projection HOT 14
- A new quincuncial projection HOT 10
- geoStitch mislabels the union of two Polygons forming a hole on the date line as a MultiPolygon
- Could not find a declaration file HOT 2
- ISEA visualization? HOT 3
- No types definition package of d3-geo-projection HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d3-geo-projection.