Map Projections

Tips for creating and manipulating planet textures for Celestia.
ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Re: Map Projections

Post #21by ElChristou » 08.04.2009, 11:12

tiburcio wrote:Hi,

I suppose there isn't any "political borders" file that would match NASA's blue marble images, at least I haven't found any. Would it be possible to apply Cham's political borders to a blue marble image?

If you need a 2D political map, I guess there must be something somewhere. You should contact Grant via PM, he helped with data for Cham's model, so perhaps he know a valid source...
Image

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Re: Map Projections

Post #22by selden » 08.04.2009, 11:20

One of Grant's political map overlays is available at
http://www.lepp.cornell.edu/~seb/celest ... rders.html
Selden

Topic author
tiburcio
Posts: 19
Joined: 01.04.2009
With us: 15 years 7 months

Re: Map Projections

Post #23by tiburcio » 08.04.2009, 11:52

Thanks!

I contacted Cham now :D but I should take a closer look on Grant's site and maybe contact him too. Thank you for the link Selden.

Cheers, tiburcio

Edit: @Selden: Is it the same file in your link as the one you can download on www.celestiamotherlode.net? ...I am looking for a 2D file though.

Topic author
tiburcio
Posts: 19
Joined: 01.04.2009
With us: 15 years 7 months

Re: Map Projections

Post #24by tiburcio » 08.04.2009, 21:41

Hi,

how do you convert the text files from Grant Hutchinson or those found here in order to plot them on the "Blue Marble projection" (cylindrical (latitude/longitude) projection)?

Cheers, tiburcio

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Re: Map Projections

Post #25by selden » 08.04.2009, 22:19

You can create a AltSurface SSC file which adds the borders VT to your existing BM textures.

Something like

Code: Select all

AltSurface "PoliticalBM" "Sol/Earth" {
   OverlayTexture "borders.*"
# plus the BM texture and other VTs. Order doesn't matter For example:
   Texture "BlueMarble.*"        # or whatever you're calling it
   NightTexture "earthnight.*"  # with the *, it'll look for VTs first, then non-VTs.
   NormalMap "earth-normal.*"

   SpecularTexture "earth-spec.*"
   SpecularColor [ 0.5 0.5 0.55 ]
   SpecularPower 25.0

   Color [ 0.85 0.85 1.0 ]

   HazeColor [ 1 1 1 ]      # these haze statements only work with Nvidia cards
   HazeDensity 0.3
}


Then you can use the right-mouse-button popup menu to select the AltSurface named PoliticalBM
(Sorry for the scatological pun. I simply couldn't resist using it. ;-) )
Selden

Topic author
tiburcio
Posts: 19
Joined: 01.04.2009
With us: 15 years 7 months

Re: Map Projections

Post #26by tiburcio » 10.04.2009, 19:39

Hi Selden,

I am not sure if I understand your example correctly. As an exercise I've created a VT successfully following the "Virtual Texture for Dummies" tutorial where I have to handle texture files like JPGs. But now I have to deal with those text files which carry the coordinates of the borders. So if I take e.g. africa.txt (besides there are of course europe, asia and america.txt files) does the code from your example then start like this:

Code: Select all

AltSurface "PoliticalBM" "Sol/Earth" {
   OverlayTexture "africa.txt"


The CIA World Data Bank files carry a readme file which says:

"...The segment number is just an ID for the segment. The rank is some sort
of ranking of the size or significance of the segment, with 1 being
the highest rank, 2 the next, and so on; map-drawing software typically
uses this number to control the amount of detail in a map
. The last
number is the number of points forming the segment. The points themselves
are then listed on the following lines, one per line. The values for a
point are its latitude and longitude, expressed as a floating point number
of degrees; positive latitude is north of the equator, positive longitude
is east of the prime meridian. Note that using floating point degrees
rather than the original integer degrees and arc minutes means that some
slight loss of accuracy has been incurred for the sake of convenience..."

So Celestia as a map-drawing software (if it is a such one) does interpret the text file with its coordinates as a texture ??? I am a little bit confused.

Thank you for your patience in advance :D

Cheers, tiburcio

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Re: Map Projections

Post #27by selden » 10.04.2009, 20:43

Unfortunately, Celestia does not use text to draw lines. That ability may be available in some future version of Celestia, but it is not yet possible.

The borders have to be provided as a picture (which is called a "texture" when discussing 3D graphics), or in a set of pictures if it's a "virtual texture" like the one that Grant created.

An AltSurface catalog entry contains pointers to pictures for the half-dozen different types of Textures (pictures) which Celestia can draw on the surface of a planet (or moon);

I suspect there are programs which can read CIA text files and draw pictures of them, but I don't know anything about that process.

Sorry.
Selden

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Re: Map Projections

Post #28by t00fri » 10.04.2009, 21:07

tiburcio wrote:Hi,

how do you convert the text files from Grant Hutchinson or those found here in order to plot them on the "Blue Marble projection" (cylindrical (latitude/longitude) projection)?

Cheers, tiburcio

But this is really simple (not just for me) : Take any decent plot program of your choice (Mathematica, Maple,...) and make a plot with abszissa ranging: -180...180 and ordinate: -90..90 (simple cylindrical setting). Then plot Grant's points and connect them with lines (every plot program can do this). Convert the plot from vector graphics to pixel graphics and save it as a PNG image, say, with exactly the number of pixels as the BMNG image. Overlay the result as a layer over the BMNG image (e.g GIMP), adjust the transparency, flatten everything and you're done.

If you don't understand what I wrote, I recommend to read some tutorials about image manipulation etc.

Fridger
Image

Topic author
tiburcio
Posts: 19
Joined: 01.04.2009
With us: 15 years 7 months

Re: Map Projections

Post #29by tiburcio » 11.04.2009, 10:18

Hi

Take any decent plot program of your choice (Mathematica, Maple,...) and make a plot with abszissa ranging: -180...180 and ordinate: -90..90 (simple cylindrical setting). Then plot Grant's points and connect them with lines (every plot program can do this).

That's the step I was missing. I thought there is a way to plot the coordinates directly in Celestia (even if it shouldn't make any sense). I think I should move forward quicker now :D Thank you!

Happy Easter, tiburcio

Topic author
tiburcio
Posts: 19
Joined: 01.04.2009
With us: 15 years 7 months

Re: Map Projections

Post #30by tiburcio » 11.04.2009, 20:10

Hi,

I've started to plot the coordinates in Mathematica now. There it goes e.g. like this:

Code: Select all

ListLinePlot[{
{x1,y1},{x2,y2}...
},PlotRange-> {{-180, 180}, {-90, 90}}]


What bothers me though is that I have to modify the coordinates from the txt files manually and it's so many coordinates. In the text file it looks e.g. like this:
-8.056098 29.092248
-8.039670 29.103982
-8.025296 29.112783
-8.000068 29.123931
...so after pasting the coordinates into Mathematica I have to add all the brackets and commas. If there's anybody who handles this app very well, is there an easier way to handle the coordinates?

Cheers, tiburcio

Ok, I think I've got it. I have to use the

Code: Select all

Import["path/africa.txt", Table]
command in order to get the coordinates into Mathematica...

Avatar
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 1 month
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Re: Map Projections

Post #31by cartrite » 13.04.2009, 05:00

I manipulate numbers like yours with spreadsheets and text editors. With a text editor you can use the "replace" command. Spreadsheets can do a lot too.
For example copy the column of numbers with -8.056098 and put them in the B column. Copy the column of numbers with 29.092248 and put them numbers in the D column of the spreadsheet. Then copy the spreadsheet to a text file. Columns A and C with have a blanks so a line from the text file will have

Code: Select all

blank -8.056098 blank 29.092248

You can populate the A and C columns with commas, brackets or what ever or use replace from a text editor. Replace

Code: Select all

blank -8.056098 blank 29.092248
with

Code: Select all

, -8.056098 , 29.092248
. It's a lot easier than it sounds here.
cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Re: Map Projections

Post #32by t00fri » 13.04.2009, 08:16

Reading 2 columns of numbers in and plotting them as a listplot or (connected) pointplot is a trivial standard task in Mathematica or Maple. These software packages have among the best manuals, context helps tutorials, examples etc. These have been done to be consulted...

Fridger
Image

Topic author
tiburcio
Posts: 19
Joined: 01.04.2009
With us: 15 years 7 months

Re: Map Projections

Post #33by tiburcio » 13.04.2009, 15:36

No problem anymore with this issue guys. Sorry, I wasn't clear enough with the 'edit' of my last post at the end where I tried to communicate the specific problem has been solved.

Cheers, tiburcio

Topic author
tiburcio
Posts: 19
Joined: 01.04.2009
With us: 15 years 7 months

Re: Map Projections

Post #34by tiburcio » 15.04.2009, 23:11

Hi,

I've got still some "little" problems. The first thing is that plotting the borders or coastlines with Mathematica's "ListLinePlot" command gives me a somehow unsatisfying result:

Image

I could not find out if or how it is possible to avoid joining specific points/coordinates which leads to those "errors". I suppose that's pretty difficult.
Anyway, another issue is that with apps like Photoshop or Illustrator I am delimited to use plots with maximum 10800x5400. I mean it's almost enough for my purpose but it would be nice e.g. to open an .eps plot in PS with an ImageSize of 21600x10800 in order to provie a template for Illustrator where I could draw a vector file. But in that case it would be then impossible to open this template in Illustrator...
I also ask myself how does Cham's "political borders" cmod file work? It doesn't use a pixel texture but creates a vector texure inside Celestia, doesn't it? I can remember that there was also a request for adding this addon vector coastlines. Is there still anybody interested in it?

Cheers, tiburcio

Edit: I must correct myself a little bit. When I plot the coordinates in M with ImageSize 10800x5400 and save the graphic as an .eps I can open it in PS with the desired 21600x10800 resolution and lay it over a BlueMarble 21600x10800 image. So then a workaround would be imaginable creating tiles and drawing the outlines in Illustrator. Anyway creating pixel texture tiles for borders or coastlines doesn't make much sense...
Last edited by tiburcio on 21.04.2009, 08:14, edited 1 time in total.

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Re: Map Projections

Post #35by t00fri » 16.04.2009, 23:22

...and what is so much worse with GoogleEarth that gave me this image including the political borders and big cities in a few seconds?
It's much reduced and can become really big. Also one can decend down until street view...
and add many different special sights etc.

click for BIG
africa.jpg

Here is some zoomed in surface structure from the Sahara border
click for BIG
africa2.jpg


Fridger
Image

Topic author
tiburcio
Posts: 19
Joined: 01.04.2009
With us: 15 years 7 months

Re: Map Projections

Post #36by tiburcio » 24.04.2009, 21:05

Hi,

does anybody know how to generate vector map projections?
In Mathematica there is this "World Plotting Package" but it delivers vector plots with very poor detail. And in its tutorial Mathematica says that "You can specify your own database of geographic coordinates by setting the option WorldDatabase..." but I could not find out exactly how to do it :? Any other suggestions?

Cheers, tiburcio

Coen
Posts: 18
Joined: 01.05.2008
With us: 16 years 6 months

Re: Map Projections

Post #37by Coen » 03.06.2009, 20:53

Hi Tiburcio,

I do not know whether the following is of any use to you, but Matlab has an extensive set of mapping commands that include pixel-based as well as vector-based maps. You can find more info at their website here:

http://www.mathworks.com/access/helpdes ... product=MG

Coen
"Never again, we vouched, would we let natural history become a mere part of human history"
Souren Nyroge, http://www.planetfuraha.org

scalbers
Posts: 138
Joined: 30.01.2005
With us: 19 years 9 months

Re: Map Projections

Post #38by scalbers » 20.06.2009, 18:18

Greetings,

FYI, I usually use IDL to do map projections. It has some included procedures to do this, though I have found it convenient to write my own projection routines that go from the spacecraft perspective to a cylindrical map in planetocentric coordinates. I use it on Linux and it is costly. There is freeware version called GDL that I have yet to compile on Cygwin, though it might be easier to install on a Mac.

Steve


Return to “Textures”