Justin Kunimune f9a0e65496 improve graticule at poles
my real goal here was to add the outline of the full map to the gradicule, but I realized that would be hard because the Awt package I'm using only supports line segments; not arcs or anything.  so maybe another time, but for now have a slite improvement where the meridians are thinned out rite near the pole.
2023-12-18 10:33:54 -08:00
2023-12-18 10:07:07 -08:00
2023-12-18 10:33:54 -08:00
2020-11-01 15:18:52 -05:00
2023-11-12 11:30:56 -05:00
2015-11-23 12:58:38 -05:00
2022-04-18 14:53:44 -04:00
2018-04-01 22:51:01 -03:00
2022-04-18 14:49:21 -04:00
2022-04-18 14:49:21 -04:00
2022-04-18 14:49:21 -04:00
2023-12-18 10:09:42 -08:00

Map-Projections

A class to create custom maps of the Earth's surface. There are thousands of combinations of color-schemes, projections, and aspects. Includes Mercator, Gall-Peters, Orthographic, Peirce Quincuncial, and More!

Tobler hyperelliptical political map AuthaGraph imitation with Tissot's indicatrices of distortion Guyou physical map

Executable files

There are three main programs here:

  • MapDesignerRaster.jar The original program. Create custom oblique raster images of the Earth's surface using a variety of algorithms called projections.
  • MapDesignerVector.jar The same idea, but working in vector images instead in case you want to cut a vinyl sticker or something.
  • MapAnalyzer.jar See graphs and figures quantifying the amount of scale and angular distortion present in each map projection.

They all have similar layouts that let you select an input equirectangular map, a projection, an aspect (where the North Pole is situated with respect to the map), and parameters if applicable. Go crazy! There are a practically unlimited number of combinations.

I will note that while I think the interface is mostly intuitive, there are a couple of things where I never got around to making the proper GUI elements, so you won't be able to figure out on your own. The first is the fact that the graticule checkbox, available on Map Designer Raster, draws its formatting information from a file called graticule.txt in the input folder. If you're fine with the default styling, or if you don't use that checkbox, don't worry about it. But if you do use that checkbox, know that you can alter the color and width of the lines by editing that file.

The twoth is the existence of truncated inputs. If you load an input map with the word "octant" in the filename (all lowercase), then the program will load it into the octant bounded by 0°N, 90°N, 0°E, and 90°E. This is useful if you have very large inputs and/or memory constraints. The output will still be sized as though the entire map were there, unless it's a projection that doesn't show the entire globe ("CahillKeyes (single octant)" does not show the entire globe and is in fact specifically designed to work with this feature.)

Running by double-clicking

If you are a fancy Windows user, I recommend the convenient fancy Windows binaries. Double-click to install them and then keep pressing buttons until something good happens. If you see a map, you're in the right place.

If you are not on Windows or are otherwise not fancy enough to deserve such executables, there are also equivalent .jar files in the main directory. Simply double-click them and, if you have Java installed (10/10 would recommend), it should just run without further set-up. Sometimes Windows is weird and you have to use the command line.

Running from the command line

To run the .jar files from the command line, you need to download JavaFX, which you can get from here. It must be JavaFX 17 or older (JavaFX 20 is not back-compatible), and make sure you get the SDK version, not the Jmods version. Once youve unzipped it into some directory lets say, for example, /home/jkunimune/javafx-17-sdk then you can run the programs like so:

java --module-path '/home/jkunimune/javafx-17-sdk/lib' --add-modules javafx.controls,javafx.swing -jar MapDesignerRaster.jar

I think this syntax might be somewhat platform dependent, but I cant really remember. If youre having problems, try forward slashes instead of backslashes or double quotes instead of single quotes.

Building from source

If you want to edit the code, or use some of the deeper functionality not meant for mass consumption, you can also compile and run the Java source code. In addition to three .java files corresponding to the three executables, there are also these runnable scripts:

  • MapPlotter.java Plot a large group of map projections by the amount of distortion they produce.
  • src/app/MapOptimizer.java Run gradient descent on parametric projections to minimize their distortion.
  • src/app/MapExplainer.java Generate an HTML blurb outlining and displaying every map projection.
  • src/app/MapConverter.java Generate a bunch of maps in one projection from a bunch of input images.

To run these, youll need to install some dependencies in addition to JavaFX as mentioned above; you can get them as .jar files:

Once you have those and put them in, for example, /home/jkunimune/apache and /home/jkunimune/jtem, you can compile and run with

javac --module-path '/home/jkunimune/javafx-17-sdk/lib:/home/jkunimune/apache/commons-math3-3.6.1.jar:/home/jkunimune/jtem' --add-modules javafx.controls,javafx.swing,ellipticFunctions --source-path=src src/apps/MapPlotter.java
java --class-path '/home/jkunimune/javafx-17-sdk/lib/javafx.controls.jar:/home/jkunimune/javafx-17-sdk/lib/javafx.swing.jar:/home/jkunimune/apache/commons-math3-3.6.1.jar:/home/jkunimune/jtem/ellipticFunctions.jar:src' apps.MapPlotter

As with running the .jar file, the syntax is somewhat platform-dependent; the colons might need to be semicolons, for example.

There are also some Python files used to generate SVG inputs for MapDesignerVector in the src/zupplemental directory. To run those, you'll need a couple of packages from PyPI. Just install Python 3 and pip, and then call the following from a command line (or use Anaconda or something, I don't know. Up to you).

pip3 install numpy pyshp

Note that compose_maps.py requires input data from naturalearthdata.com, which should be downloaded and placed in src/zupplemental/shapefiles/.

Wherefore?

I'll write a little blurb here later.

For some examples, check out the output folder (all were created with this program but some also involved some postprocessing in paint.net). For more information, go to jkunimune.github.io/Map-Projections.

Credits

While I wrote all of the code in this repository myself, and I created several of the simpler images from scratch, other people did help. Here's a comprehensive list.

Description
A suite of programs to create custom maps of the Earth's surface. https://kunimune.home.blog/2017/11/23/the-secrets-of-the-authagraph-revealed/
Readme 886 MiB
Languages
Java 88.5%
Python 11.5%