3
$\begingroup$

I am converting some code, which ran under V10.2, into V11. However, the results is different and undesirable. Here is a simplified version of the code:

mI = Image[
  Graphics @@ GeoGraphics[
    GeoModel -> Entity["PlanetaryMoon", "Moon"],
    GeoProjection -> GeoProjectionData[][[46]]
    (* GallIsographic *)
  ]
];

SphericalPlot3D[
  1, {u, 0, Pi}, {v, 0, 2 Pi},
  TextureCoordinateFunction -> ({#5, 1 - #4} &),
  (* x, y, z, \[Theta], \[Phi], r *)
  PlotStyle -> Directive[Texture[mI]],
  ViewVector -> {2 {Cos[6.392], Sin[6.392], 0}, {0, 0, 0} },
  Mesh -> False,
  Boxed -> False,
  Axes -> False
]

In V10.2, the output, as expected, looks like Moon as Texture in V10.2

However, in V11, I get the following distortion: Moon as Texture in V11

Note that the problem does not occur if the GeoProjection option is removed.

Is this a bug in V11, or am I misunderstanding how to texture?

$\endgroup$
5
  • 1
    $\begingroup$ Check what GeoProjectionData[][[46]] returns. Personally, I'd stick to "Equirectangular" for texturing: mI = Image[GeoGraphics[GeoModel -> Entity["PlanetaryMoon", "Moon"], GeoProjection -> "Equirectangular"]]. $\endgroup$ Mar 23, 2017 at 14:37
  • $\begingroup$ On my Mac with v10.2 your code produces the error message "GeoGraphics::invgm: Entity[PlanetaryMoon,Moon] is not a valid GeoModel specification. >>" along with a multi-colored, non-textured "sphere". The distorted output occurs in v10.3.1 and later. $\endgroup$
    – Bob Hanlon
    Mar 23, 2017 at 14:51
  • 3
    $\begingroup$ To add to what JM said, this is somewhat of an abuse of GeoProjectionData that is not guaranteed to be stable between releases as projections are added and sorted differently. But, GeoProjectionData["GallIsographic"] is stable between releases, and GeoProjection can take the string "GallIsographic" directly (GeoProjection -> "GallIsographic" is equivalent to GeoProjection -> GeoProjectionData@"GallIsographic") so I'd use that form. $\endgroup$
    – rcollyer
    Mar 23, 2017 at 15:07
  • 2
    $\begingroup$ Additionally, Image[Graphics@@GeoGraphics[...] is redundant as Image understands GeoGraphics in 10.2 and higher. $\endgroup$
    – rcollyer
    Mar 23, 2017 at 15:10
  • 1
    $\begingroup$ Are you aware of EntityValue[Entity["PlanetaryMoon", "Moon"], "TexturedSurface"]? $\endgroup$
    – Jason B.
    Mar 24, 2017 at 13:52

1 Answer 1

4
$\begingroup$

Thanks to the commenters I now realize that the order of the values in GeoProjectionData has changed in V11, and that I should be directly using the projection name instead of indexing into the array. Here is code that works correctly in V11:

Image[
  GeoGraphics[
    GeoModel -> Entity["PlanetaryMoon", "Moon"],
    GeoProjection -> "GallIsographic"
  ]
]

Thanks also for the advice about Graphics being redundant in V11.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.