Re: Re: 3D plot of globe (map of world)?
- To: mathgroup at smc.vnet.net
- Subject: [mg67953] Re: [mg67903] Re: 3D plot of globe (map of world)?
- From: "Adel Elsabbagh" <aelsabbagh at gmail.com>
- Date: Thu, 13 Jul 2006 06:55:33 -0400 (EDT)
- References: <e8vu3v$t2i$1@smc.vnet.net> <200607120906.FAA22222@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi Jens, I feel curious to try your code although I don't think I will ever use it. However I get the error message: Syntax::sntxb: Expression cannot begin with "Import[\[LeftSkeleton]2625\ \[RightSkeleton]][[1, 1]]". Thanks! Adel On 7/12/06, Jens-Peer Kuska <kuska at informatik.uni-leipzig.de> wrote: > 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! > | > | > > > -- Adel Elsabbagh
- References:
- Re: 3D plot of globe (map of world)?
- From: "Jens-Peer Kuska" <kuska@informatik.uni-leipzig.de>
- Re: 3D plot of globe (map of world)?