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

BitmapLayer supports globe projection #4655

Merged
merged 1 commit into from
Jun 8, 2020
Merged

Conversation

Pessimistress
Copy link
Collaborator

For #4638

Screen Shot 2020-06-05 at 12 09 39 PM

Note that this implementation assumes that the world coordinates can be linearly interpolated along the pixels. This is not true with e.g. OSM raster tiles, which have been preprojected to the Web Mercator space. Ultimately, the issue is that the layer does not ask the user for sufficient information regarding the image. We will need to introduce additional APIs for a more generalized solution.

Change List

  • Introduce resolution option to GlobeView
  • BitmapLayer creates a mesh if needed
  • Doc
  • Test

@coveralls
Copy link

coveralls commented Jun 5, 2020

Coverage Status

Coverage increased (+0.07%) to 83.355% when pulling 707e2c8 on x/globe-bitmap into 8cf70ab on master.

@kylebarron
Copy link
Collaborator

Note that this implementation assumes that the world coordinates can be linearly interpolated along the pixels. This is not true with e.g. OSM raster tiles, which have been preprojected to the Web Mercator space.

I still trying to wrap my mind around this.

In the example, you're projecting this image onto the globe. That image is 4096x2048px, so it maps linearly to degrees of latitude and longitude spanning the globe.

If you just stretched that image vertically to be a square, that would be nearly equivalent to an OSM web mercator tile at zoom 0 (except that in web mercator the latitude extremes are 85 degrees).

So it's not clear why it works to wrap the example image around the globe, but doesn't work to project an OSM web mercator image onto the globe, given that there's a linear combination relating the two.

@Pessimistress
Copy link
Collaborator Author

@kylebarron
Copy link
Collaborator

kylebarron commented Jun 8, 2020

Stretching a non-linear y axis still yields non-linear

I understand that there will be warping no matter what when you're projecting a rectangular image onto an ellipsoid, but I don't understand why this would apply differently to the image used in the example compared to an image in web mercator.

@Pessimistress Pessimistress merged commit 041600f into master Jun 8, 2020
@Pessimistress Pessimistress deleted the x/globe-bitmap branch June 8, 2020 21:14
@Pessimistress
Copy link
Collaborator Author

image

@kylebarron
Copy link
Collaborator

Tissot's indicatrix Mercator:
image

Tissot's indicatrix Equirectangular (wgs84):
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants