User:Ojw/Cartography

This has been turned into a proper page -- see it at Producing_maps_with_xplanet Ojw 00:24, 5 Feb 2005 (UTC)

These are just my notes: see User:Ojw/Gallery for maps.

Script
arc_color={255,255,0} arc_file=C:\Downloads\xplanet-1.1.1\xplanet\boundaries.txt arc_file=C:\Downloads\xplanet-1.1.1\xplanet\states.txt marker_color={255,255,255} marker_file=C:\Downloads\xplanet-1.1.1\xplanet\capitals.txt marker_file=C:\Downloads\xplanet-1.1.1\xplanet\poi.txt marker_color={128,128,0} marker_file=C:\Downloads\xplanet-1.1.1\xplanet\cities2.txt grid=true grid1=30 grid2=30 shade=100

Batch
xplanet.exe -proj orthographic -config script.txt -latitude 52.25 -longitude 21.00 --num_times 1 -geometry 1000x600 -output output.jpeg -radius 700 -fontsize 16

Script 1: Graphics
$CountryList = "xplanet/countries.txt"; $XPlanet = "xplanet.exe"; $ConfigFile = "script.txt"; $ImageSize = "600x600"; $WorkingDir = "../"; $OutputDir = "atlas/Output/"; $Count = 0;

chdir $WorkingDir || die("Couldn't set working directory\n"); open(COUNTRIES, $CountryList) || die("Need a countries file\n"); foreach $Line(){ #33.93045	67.67894	"Afghanistan"	color={255,255,0} ($Lat, $Long, $Name, $Other) = split(/\t/, $Line); if(-180 < $Long && $Long < 180 && -90 < $Lat && $Lat < 90){ $Name =~ s/\"//g;		$Name =~ s/\W+/_/g;		print "$Name\n";

#xplanet.exe -proj orthographic -config script.txt -latitude 52.25 -longitude 21.00 --num_times 1 -geometry 600x600 -output output.jpeg -radius 700 -fontsize 16 $Filename = $OutputDir. "$Name.jpg"; $Arguments = "-proj orthographic ". "-config $ConfigFile ". "-latitude $Lat ". "-longitude $Long ". "--num_times 1 ". "-geometry $ImageSize ". "-output $Filename ". "-radius 1200 ". "-fontsize 16 ". "-verbosity 1"; $Command = "$XPlanet $Arguments\n"; print $Command; system $Command; #exit if (++$Count > 2); } }

Script 2: thumbnails
$CountryList = "xplanet/countries.txt"; $XPlanet = "xplanet.exe"; $ConfigFile = "thumbnails/script.txt"; $LabelFile = "thumbnails/labels.txt"; $Image = "day.jpg"; $ImageSize = "120x120"; $WorkingDir = "../"; $OutputDir = "thumbnails/Output/"; $Count = 0; chdir $WorkingDir || die("Couldn't set working directory\n"); open(COUNTRIES, $CountryList) || die("Need a countries file\n"); foreach $Line(){ #33.93045	67.67894	"Afghanistan"	color={255,255,0} ($Lat, $Long, $Name, $Other) = split(/\t/, $Line); if(-180 < $Long && $Long < 180 && -90 < $Lat && $Lat < 90){ $Name =~ s/\"//g;		$Name =~ s/\W+/_/g;		print "$Name\n";

open(CONFIG, ">", $ConfigFile) || die($!); print CONFIG "[Earth]\n"; print CONFIG "marker_file=$LabelFile\n"; print CONFIG "image=$Image\n"; print CONFIG "night_map=$Image\n"; print CONFIG "grid=true\n"; print CONFIG "grid1=2\n"; print CONFIG "grid2=20\n"; print CONFIG "shade=100\n"; close CONFIG;

$Label = $Name; $Label =~ s/_/ /g; $Label = substr($Label,0,13). "-" if(length($Label) > 14); open(LABEL, ">", $LabelFile); print LABEL "$Lat\t$Long\t\"$Label\"\tcolor={255,255,0}\n"; close LABEL; $Filename = $OutputDir. "$Name.jpg"; $Arguments = "-proj orthographic ". "-config $ConfigFile ". "-latitude $Lat ". "-longitude $Long ". "--num_times 1 ". "-geometry $ImageSize ". "-output $Filename ". "-radius 40 ". "-fontsize 14 ". "-verbosity 1 ". "-background white120.png"; $Command = "$XPlanet $Arguments\n"; print $Command; system $Command; #exit if (++$Count > 2); } }