Re: 3D plot of globe (map of world)?
- To: mathgroup at smc.vnet.net
- Subject: [mg67903] Re: 3D plot of globe (map of world)?
- From: "Jens-Peer Kuska" <kuska at informatik.uni-leipzig.de>
- Date: Wed, 12 Jul 2006 05:06:03 -0400 (EDT)
- Organization: Uni Leipzig
- References: <e8vu3v$t2i$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi, what is with img = Import[ "http://phong.informatik.uni-leipzig.de/~kuska/oglscript/EarthMap.png"][[1, 1]]; img = First /@ Partition[(First /@ Partition[#, 2]) & /@ img, 2]; {n, m} = Take[Dimensions[img], 2]; dth = Pi/n; dphi = 2Pi/m; spdata = MapIndexed[ {{Pi, 2Pi}*#2/{n, m}, N[#/255]} &, img, {2}]; onSphere[th_, phi_] := {Sin[th]*Cos[phi], Sin[th]*Sin[phi], Cos[th]} expandPoly[t_, phi_] := With[{th = Pi - t}, Polygon[{onSphere[th, phi], onSphere[th, phi + dphi], onSphere[th + dth, phi + dphi], onSphere[th + dth, phi]}] ] poly = Map[{SurfaceColor[RGBColor @@ #[[2]]], expandPoly @@ #[[1]]} &, spdata, {2}]; Show[Graphics3D[{EdgeForm[], poly},ViewPoint -> {-2.602, -2.019, 0.777}]] only clouds and mountains can make the picture better. Regards Jens "Xiangdong Liu" <liu at vtaix.cc.vt.edu> schrieb im Newsbeitrag news:e8vu3v$t2i$1 at smc.vnet.net... | Hi! | | Not sure if this question has been asked before but does anyone know how | to make a 3D plot of the world or globe? Or at least the map of a continent | on a 3D globe? | | With the `WorldPlot` package, you can plot 2D world map or country/continent | maps, with various 3D-to-2D projections. Yet, Mathematica does not seem to | provide a means to easily plot the map data in 3D (well as far as I know). | | Mathematica does allow the per-country map data (polygons) to be referenced | but does not allow (as far as I can see) map data of a continent to be | referenced collectively. I am looking therefore into if I can do the | tedious country by country plots and then combine them. Yet, the map data | for some countries, such as US, consists multiple disjoint polygons. But | if you use ListPlot or ListPlot3D, Mathematica connects all polygons as if | they were one, adding superfluous edges. Manually separating map data for | such countries into multiple indpendent lists and plotting the lists | separately and then combining them, whew, seems to be too tedious to be | doable. | | Thanks! | |
- Follow-Ups:
- Re: Re: 3D plot of globe (map of world)?
- From: "Adel Elsabbagh" <aelsabbagh@gmail.com>
- Re: Re: 3D plot of globe (map of world)?