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

Add satellite and various projection types to geo subplots #5801

Merged
merged 19 commits into from
Jul 9, 2021

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Jul 5, 2021

Resolves #4781 by adding new projection types to geo subplots.

cc: #424

various_geo_projections

Here is the full list of types:

"airy",
"aitoff",
"albers",
"albers usa",
"august",
"azimuthal equal area",
"azimuthal equidistant",
"baker",
"bertin1953",
"boggs",
"bonne",
"bottomley",
"bromley",
"collignon",
"conic conformal",
"conic equal area",
"conic equidistant",
"craig",
"craster",
"cylindrical equal area",
"cylindrical stereographic",
"eckert1",
"eckert2",
"eckert3",
"eckert4",
"eckert5",
"eckert6",
"eisenlohr",
"equirectangular",
"fahey",
"foucaut",
"foucaut sinusoidal",
"ginzburg4",
"ginzburg5",
"ginzburg6",
"ginzburg8",
"ginzburg9",
"gnomonic",
"gringorten",
"gringorten quincuncial",
"guyou",
"hammer",
"hill",
"homolosine",
"hufnagel",
"hyperelliptical",
"kavrayskiy7",
"lagrange",
"larrivee",
"laskowski",
"loximuthal",
"mercator",
"miller",
"mollweide",
"mt flat polar parabolic",
"mt flat polar quartic",
"mt flat polar sinusoidal",
"natural earth",
"natural earth1",
"natural earth2",
"nell hammer",
"nicolosi",
"orthographic",
"patterson",
"peirce quincuncial",
"polyconic",
"rectangular polyconic",
"robinson",
"satellite",
"sinu mollweide",
"sinusoidal",
"stereographic",
"times",
"transverse mercator",
"van der grinten",
"van der grinten2",
"van der grinten3",
"van der grinten4",
"wagner4",
"wagner6",
"wiechel",
"winkel tripel",
"winkel3"

@plotly/plotly_js

cc: @disberd

@archmoj archmoj added this to the NEXT milestone Jul 5, 2021
@archmoj archmoj mentioned this pull request Jul 5, 2021
src/plots/geo/constants.js Outdated Show resolved Hide resolved
@nicolaskruchten
Copy link
Contributor

LGTM! ✨

constants.lonaxisSpan[projType] / 2 :
null;
var clipAngle =
projType === 'satellite' ? Math.acos(1 / projection.distance()) * 180 / Math.PI :
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does projection.distance() come from? Is that linked to the projection.scale attribute? I imagine users of the satellite would want to be able to fix the satellite's location (height and center lat/lon) and still zoom and pan - to match up with a specific image taken by a satellite. Is that possible as it stands?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The distance and tilt options are now implemented for satellite by d102a47.


'airy': 'airy',
// 'albers': 'albers',
'armadillo': 'armadillo',
// 'armadillo': 'armadillo',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a pattern to the ones we're still omitting?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of these are now enabled by eb30073.
Let me see if I could easily fix the clipping issue for some other remaining ones...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the remaining ones are interrupted-projections and polyhedral-projections as well as two-point projections , require extra work and attributes and we could say it is outside the scope of this PR.

@archmoj archmoj changed the title Add satellite and other new projection types to geo subplots Add satellite and various other projection types to geo subplots Jul 8, 2021
@archmoj archmoj changed the title Add satellite and various other projection types to geo subplots Add satellite and various projection types to geo subplots Jul 8, 2021
@archmoj archmoj requested a review from alexcjohnson July 8, 2021 20:21
@archmoj
Copy link
Contributor Author

archmoj commented Jul 8, 2021

@plotly/plotly_js and @disberd this PR is now reviewable and if you could play with it : )

"fitbounds": "locations",
"projection": {
"rotation": {"lat": 45},
"type": "mercator"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strange to think of this as a mercator projection when it has a rotation... can we omit projection.rotation from this mock, and let the projection do its own thing? Hopefully that will automatically rotate those projections that use rotation to fit their contents, but will use center for mercator and others like it. That would allow this mocks to function as more than just "these projections all work zoomed in", but also "here's the kind of map you can expect from each projection"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... geo_fitbounds-locations basically tests just that for Australia.
OK please see 77f0367 and then 8e352e2.
Keeping rotation for those three projections can simply help illustrate that the projection could actually be used with Canada.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping rotation for those three projections can simply help illustrate that the projection could actually be used with Canada.

I'd argue that this shows these projections may not be optimizing the correct variables when doing fitbounds - but if there's no obvious fix for that we can leave it. Thanks for dropping all the other rotations.

Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💃 that's a whole lot of projections 😲

@archmoj archmoj merged commit 01e25e7 into master Jul 9, 2021
@archmoj archmoj deleted the new-geo-projections branch July 9, 2021 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Satellite geo projection
3 participants