I'm hoping to be able to use the latitude and longitude for various locations on Earth, and have them displayed as a dot on a textured "Earth sphere". So far I have the Earth sphere, but I'm hoping to be able to have someone help me add the "location dots". Furthermore, I'd also like to be able to have the coordinates displayed in Spherical (r,theta,phi) and Cartesian (x,y,z) formats if possible in the output as well (although they don't have to be displayed in the image itself).

For example, let's say I want to display where London is located on Earth, with a latitude of 51.5074 N and 0.1278 W. How would I display these coordinates as a dot on an Earth sphere (see image below)?

EarthTexture = Import["http://naturalearth.springercarto.com/ne3_data/8192/textures/2_no_clouds_8k.jpg"];
EarthSphere = 
  ParametricPlot3D[{Cos[u] Sin[v], Sin[u] Sin[v], Cos[v]}, {u, 0, 
    2 Pi}, {v, 0, Pi}, Mesh -> None, PlotPoints -> 100, 
   TextureCoordinateFunction -> ({#4, 1 - #5} &), Boxed -> False, 
   PlotStyle -> Texture[Show[EarthTexture]], Lighting -> "Neutral", 
   Axes -> False, RotationAction -> "Clip", 
   ViewPoint -> {-2.026774, 2.07922, 1.73753418}, ImageSize -> 800];
Show[EarthSphere, PlotRange -> Automatic]

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.