Ready for Release

I fixed up some things, changing Tetrahedral aspect preset to not slice
up Antarctica as much and Longest Line to have Australia at the top
again (I just like it better that way. I'm not sure why I ever did it
differently.). Then I rebuilt it. Fun fact: JDK 9 doesn't work. I had to
go back and find JDK 8 to make it actually compile.
I also revised my ReadMe to reflect a few changes and made some new
images. It's a wild time.
This commit is contained in:
Justin Kunimune 2017-11-26 11:46:43 -05:00
parent f37b266fdf
commit 910ec37911
13 changed files with 38 additions and 51 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -37,7 +37,7 @@ While I wrote all of the code in this repository myself, and I created several o
* **RokerHRO** for [the indicatrix layer of Tissot.jpg](https://commons.wikimedia.org/wiki/File:Tissot_10deg.png)
* **The CIA** for [Basic.svg](https://commons.wikimedia.org/wiki/File:BlankMap-World6-Equirectangular.svg)
* **Crates** for [Landmasses.svg](https://commons.wikimedia.org/wiki/File:World_map_blank_without_borders.svg)
* **Eric Gaba** for [Tissot.svg](https://commons.wikimedia.org/wiki/File:Tissot_indicatrix_world_map_equirectangular_proj.svg)
* **The Apache Commons** for their [complex mathematics code](https://commons.apache.org/proper/commons-math/)
* **Technische Universität Berlin** for their [complex mathematics code](http://www3.math.tu-berlin.de/jtem/ellipticFunctions/)
* **AuthaGraph Co., Ltd.** for their [vague information about their map projection](http://www.authagraph.com/projects/description/%E3%80%90%E4%BD%9C%E5%93%81%E8%A7%A3%E8%AA%AC%E3%80%91%E8%A8%98%E4%BA%8B01/?lang=en), which inspired several of my own.
* **Wikipedia** for their [impressive collection of map projection information and equations](https://en.wikipedia.org/wiki/List_of_map_projections)

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project name="Map Projections" default="cleanup">
<property name="dir.workspace" value="C:/Users/jkunimune/workspace"/>
<property name="dir.workspace" value="C:/Users/jkunimune/eclipse-workspace"/>
<property name="dir.jarfile" value="."/>
<target name="setup">
@ -16,7 +16,7 @@
<fileset dir="bin"/>
<zipfileset excludes="META-INF/*.SF" src="${dir.workspace}/ellipticFunctions/ellipticFunctions.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${dir.workspace}/ellipticFunctions/mfc.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${dir.workspace}/commons-math3-3.5/commons-math3-3.5.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${dir.workspace}/commons-math3-3.6.1/commons-math3-3.6.1.jar"/>
</jar>
<jar destfile="${dir.jarfile}/MapDesignerVector.jar" filesetmanifest="mergewithoutmain">
<manifest>
@ -25,7 +25,7 @@
<fileset dir="bin"/>
<zipfileset excludes="META-INF/*.SF" src="${dir.workspace}/ellipticFunctions/ellipticFunctions.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${dir.workspace}/ellipticFunctions/mfc.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${dir.workspace}/commons-math3-3.5/commons-math3-3.5.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${dir.workspace}/commons-math3-3.6.1/commons-math3-3.6.1.jar"/>
</jar>
<jar destfile="${dir.jarfile}/MapAnalyzer.jar" filesetmanifest="mergewithoutmain">
<manifest>
@ -34,7 +34,7 @@
<fileset dir="bin"/>
<zipfileset excludes="META-INF/*.SF" src="${dir.workspace}/ellipticFunctions/ellipticFunctions.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${dir.workspace}/ellipticFunctions/mfc.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${dir.workspace}/commons-math3-3.5/commons-math3-3.5.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${dir.workspace}/commons-math3-3.6.1/commons-math3-3.6.1.jar"/>
</jar>
</target>
@ -43,19 +43,19 @@
<arg line="-deploy -native exe -srcfiles MapDesignerRaster.jar;LICENSE.md;input -appclass apps.MapDesignerRaster -outdir build -outfile MapDesignerRaster"/>
<arg line="-name &quot;Map Designer Raster&quot; -title &quot;Map Designer (Raster)&quot; -description &quot;Design oblique raster world maps in different projections&quot;"/>
<arg line="-vendor &quot;Justin Kunimune&quot; -Bcopyright=&quot;Copyright (c) 2017 Justin Kunimune&quot;"/>
<arg line="-BappVersion=3.1 -Bicon=res\raster.ico -BlicenseFile=LICENSE.md"/>
<arg line="-BappVersion=3.2 -Bicon=res\raster.ico -BlicenseFile=LICENSE.md"/>
</exec>
<exec executable="javapackager">
<arg line="-deploy -native exe -srcfiles MapDesignerVector.jar;LICENSE.md;input -appclass apps.MapDesignerVector -outdir build -outfile MapDesignerVector"/>
<arg line="-name &quot;Map Designer Vector&quot; -title &quot;Map Designer (Vector)&quot; -description &quot;Design oblique vector world maps in different projections&quot;"/>
<arg line="-vendor &quot;Justin Kunimune&quot; -Bcopyright=&quot;Copyright (c) 2017 Justin Kunimune&quot;"/>
<arg line="-BappVersion=3.1 -Bicon=res\vector.ico -BlicenseFile=LICENSE.md"/>
<arg line="-BappVersion=3.2 -Bicon=res\vector.ico -BlicenseFile=LICENSE.md"/>
</exec>
<exec executable="javapackager">
<arg line="-deploy -native exe -srcfiles MapAnalyzer.jar;LICENSE.md;input -appclass apps.MapAnalyzer -outdir build -outfile MapAnalyzer"/>
<arg line="-name &quot;Map Analyzer&quot; -title &quot;Map Analyzer&quot; -description &quot;Compare distortion graphs and metrics for different map projections.&quot;"/>
<arg line="-vendor &quot;Justin Kunimune&quot; -Bcopyright=&quot;Copyright (c) 2017 Justin Kunimune&quot;"/>
<arg line="-BappVersion=3.1 -Bicon=res\analyz.ico -BlicenseFile=LICENSE.md"/>
<arg line="-BappVersion=3.2 -Bicon=res\analyz.ico -BlicenseFile=LICENSE.md"/>
</exec>
</target>

View File

Before

Width:  |  Height:  |  Size: 530 KiB

After

Width:  |  Height:  |  Size: 530 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

View File

@ -67,9 +67,9 @@ public abstract class MapApplication extends Application {
"Atlantis", "AuthaGraph", "Jerusalem", "Point Nemo", "Longest Line",
"Cylindrical", "Tetrahedral", "Antipode", "Random" };
private static final double[][] ASPECT_VALS = { //the aspect presets (in degrees)
{ 90., 0., 0., -4., 77., 31.78, 48.88, 28.52,-35., 35.5 },
{ 0., 0., 90., 65., 143., 35.22, 56.61,-38.55,-13.61,-27.9 },
{ 0., 0.,-90.,-147., 17., -35., -45., -30., 145., -167.3 } };
{ 90., 0., 0., -4., 77., 31.78, 48.88, -28.52,-35., 57. },
{ 0., 0., 90., 65., 143., 35.22, 56.61, 141.45,-13.61,-176. },
{ 0., 0.,-90.,-147., 17.,-35., -45., 30., 145., 154. } };
final private String name;

View File

@ -87,12 +87,12 @@ public class MapDesignerRaster extends MapApplication {
Cylindrical.EQUIRECTANGULAR, Cylindrical.EQUAL_AREA, Cylindrical.GALL,
Azimuthal.STEREOGRAPHIC, Azimuthal.POLAR, Azimuthal.EQUAL_AREA, Azimuthal.GNOMONIC,
Azimuthal.PERSPECTIVE, Conic.LAMBERT, Conic.EQUIDISTANT, Conic.ALBERS, Tetrahedral.LEE,
Tetrahedral.TETRAGRAPH, Tetrahedral.ACTUAUTHAGRAPH, Tetrahedral.AUTHAPOWER,
Tetrahedral.AUTHAGRAPH, Pseudocylindrical.SINUSOIDAL, Pseudocylindrical.MOLLWEIDE,
Tobler.TOBLER, Misc.AITOFF, Misc.VAN_DER_GRINTEN, Robinson.ROBINSON,
WinkelTripel.WINKEL_TRIPEL, Misc.PEIRCE_QUINCUNCIAL, Misc.TWO_POINT_EQUIDISTANT,
Misc.HAMMER_RETROAZIMUTHAL, Pseudocylindrical.LEMONS, MyProjections.EXPERIMENT,
MyProjections.PSEUDOSTEREOGRAPHIC, MyProjections.TWO_POINT_EQUALIZED };
Tetrahedral.ACTUAUTHAGRAPH, Tetrahedral.AUTHAPOWER, Tetrahedral.AUTHAGRAPH,
Pseudocylindrical.SINUSOIDAL, Pseudocylindrical.MOLLWEIDE, Tobler.TOBLER, Misc.AITOFF,
Misc.VAN_DER_GRINTEN, Robinson.ROBINSON, WinkelTripel.WINKEL_TRIPEL,
Misc.PEIRCE_QUINCUNCIAL, Misc.TWO_POINT_EQUIDISTANT, Misc.HAMMER_RETROAZIMUTHAL,
Pseudocylindrical.LEMONS, MyProjections.EXPERIMENT, MyProjections.PSEUDOSTEREOGRAPHIC,
MyProjections.TWO_POINT_EQUALIZED };
private Node aspectSelector;

View File

@ -82,12 +82,12 @@ public class MapDesignerVector extends MapApplication {
Cylindrical.EQUIRECTANGULAR, Cylindrical.EQUAL_AREA, Cylindrical.GALL,
Azimuthal.STEREOGRAPHIC, Azimuthal.POLAR, Azimuthal.EQUAL_AREA, Azimuthal.GNOMONIC,
Azimuthal.PERSPECTIVE, Conic.LAMBERT, Conic.EQUIDISTANT, Conic.ALBERS, Tetrahedral.LEE,
Tetrahedral.TETRAGRAPH, Tetrahedral.ACTUAUTHAGRAPH, Tetrahedral.AUTHAPOWER,
Tetrahedral.AUTHAGRAPH, Pseudocylindrical.SINUSOIDAL, Pseudocylindrical.MOLLWEIDE,
Tobler.TOBLER, Misc.AITOFF, Misc.VAN_DER_GRINTEN, Robinson.ROBINSON,
WinkelTripel.WINKEL_TRIPEL, Misc.PEIRCE_QUINCUNCIAL, Misc.TWO_POINT_EQUIDISTANT,
Misc.HAMMER_RETROAZIMUTHAL, Pseudocylindrical.LEMONS, MyProjections.EXPERIMENT,
MyProjections.PSEUDOSTEREOGRAPHIC, MyProjections.TWO_POINT_EQUALIZED };
Tetrahedral.ACTUAUTHAGRAPH, Tetrahedral.AUTHAPOWER, Tetrahedral.AUTHAGRAPH,
Pseudocylindrical.SINUSOIDAL, Pseudocylindrical.MOLLWEIDE, Tobler.TOBLER, Misc.AITOFF,
Misc.VAN_DER_GRINTEN, Robinson.ROBINSON, WinkelTripel.WINKEL_TRIPEL,
Misc.PEIRCE_QUINCUNCIAL, Misc.TWO_POINT_EQUIDISTANT, Misc.HAMMER_RETROAZIMUTHAL,
Pseudocylindrical.LEMONS, MyProjections.EXPERIMENT, MyProjections.PSEUDOSTEREOGRAPHIC,
MyProjections.TWO_POINT_EQUALIZED };
private static final int DEF_MAX_VTX = 5000;
private static final int FAST_MAX_VTX = 2000;

View File

@ -67,28 +67,18 @@ public class MapPlotter extends Application {
private static final double GLOBE_RES = .002;
private static final Projection[] CYLINDRICAL = { Cylindrical.MERCATOR,
Cylindrical.PLATE_CARREE, Cylindrical.BEHRMANN, Cylindrical.GALL };
private static final Projection[] AZIMUTHAL = { Azimuthal.STEREOGRAPHIC, Azimuthal.POLAR,
Azimuthal.EQUAL_AREA };
Cylindrical.PLATE_CARREE, Cylindrical.GALL_PETERS, Cylindrical.BEHRMANN,
Cylindrical.GALL };
private static final Projection[] AZIMUTHAL = { Azimuthal.POLAR };
private static final Projection[] PSEUDOCYL = { Pseudocylindrical.MOLLWEIDE, Robinson.ROBINSON,
Tobler.TOBLER };
private static final Projection[] PSEUDOAZM = { Misc.AITOFF,
MyProjections.PSEUDOSTEREOGRAPHIC };
private static final Projection[] TETRAHEDRAL = { Tetrahedral.LEE, Tetrahedral.ACTUAUTHAGRAPH,
Tetrahedral.AUTHAPOWER, Tetrahedral.TETRAPOWER };
Tetrahedral.AUTHAGRAPH, Tetrahedral.TETRAPOWER };
private static final Projection[] OTHER = { Misc.VAN_DER_GRINTEN, WinkelTripel.WINKEL_TRIPEL,
Misc.PEIRCE_QUINCUNCIAL, Pseudocylindrical.LEMONS };
// private static final Projection[] COMMON = { Azimuthal.STEREOGRAPHIC, Cylindrical.MERCATOR,
// Azimuthal.POLAR, Cylindrical.PLATE_CARREE, Azimuthal.EQUAL_AREA,
// Cylindrical.GALL_PETERS, Cylindrical.GALL, Misc.VAN_DER_GRINTEN, Robinson.ROBINSON,
// WinkelTripel.WINKEL_TRIPEL, Azimuthal.ORTHOGRAPHIC };
// private static final Projection[] UNCOMMON = { Misc.PEIRCE_QUINCUNCIAL, Tetrahedral.LEE,
// Tobler.TOBLER, Cylindrical.BEHRMANN, Misc.AITOFF };
// private static final Projection[] INVENTED = { MyProjections.PSEUDOSTEREOGRAPHIC,
// MyProjections.HYPERELLIPOWER, Tetrahedral.ACTAAUTHAGRAPH, Tetrahedral.TETRAPOWER,
// Tetrahedral.TETRAFILLET, MyProjections.TWO_POINT_EQUALIZED };
private StackPane stack;
@ -103,7 +93,7 @@ public class MapPlotter extends Application {
public void start(Stage root) {
final ScatterChart<Number, Number> plot =
new ScatterChart<Number, Number>(
new NumberAxis("Size distortion", 0, 1.6, 0.2),
new NumberAxis("Size distortion", 0, 1.4, 0.2),
new NumberAxis("Shape distortion", 0, 0.8, 0.2));
final AnchorPane overlay = new AnchorPane();
stack = new StackPane(plot, overlay);
@ -112,16 +102,12 @@ public class MapPlotter extends Application {
final List<Data<Number,Number>> data = new LinkedList<Data<Number,Number>>();
final double[][][] points = Projection.globe(GLOBE_RES);
plotProjections(plot, overlay, labels, data, AZIMUTHAL, "Azimuthal", points);
plotProjections(plot, overlay, labels, data, CYLINDRICAL, "Cylindrical", points);
plotProjections(plot, overlay, labels, data, PSEUDOAZM, "Pseudoazimuthal", points);
plotProjections(plot, overlay, labels, data, PSEUDOCYL, "Pseudocylindrical", points);
plotProjections(plot, overlay, labels, data, TETRAHEDRAL, "Tetrahedral", points);
plotProjections(plot, overlay, labels, data, OTHER, "Other", points);
// plotProjections(plot, overlay, labels, data, COMMON, "Common", points);
// plotProjections(plot, overlay, labels, data, UNCOMMON, "Hipster", points);
// plotProjections(plot, overlay, labels, data, INVENTED, "Mine", points);
plotProjections(plot, overlay, labels, data, AZIMUTHAL, "Azimuthal ", points);
plotProjections(plot, overlay, labels, data, CYLINDRICAL, "Cylindrical ", points);
plotProjections(plot, overlay, labels, data, PSEUDOAZM, "Pseudoazimuthal ", points);
plotProjections(plot, overlay, labels, data, PSEUDOCYL, "Pseudocylindrical ", points);
plotProjections(plot, overlay, labels, data, TETRAHEDRAL, "Tetrahedral ", points);
plotProjections(plot, overlay, labels, data, OTHER, "Other ", points);
final ChangeListener<Number> listener = new ChangeListener<Number>() {
final Timer timer = new Timer();
@ -173,8 +159,7 @@ public class MapPlotter extends Application {
List<Label> labels, List<Data<Number,Number>> data) {
for (int i = 0; i < labels.size(); i ++) {
AnchorPane.setLeftAnchor(labels.get(i),
chart.getXAxis().localToParent(chart.getXAxis().getDisplayPosition(data.get(i).getXValue()), 0).getX() + chart.getPadding().getLeft()
+ 3);
chart.getXAxis().localToParent(chart.getXAxis().getDisplayPosition(data.get(i).getXValue()), 0).getX() + chart.getPadding().getLeft() + 3);
AnchorPane.setTopAnchor(labels.get(i),
chart.getYAxis().localToParent(0, chart.getYAxis().getDisplayPosition(data.get(i).getYValue())).getY() + chart.getPadding().getTop() - labels.get(i).getHeight()
);

View File

@ -262,7 +262,9 @@ public abstract class Projection {
final double s1ps2 = Math.hypot((p1[0]-p0[0])+(p2[1]-p0[1]), (p1[1]-p0[1])-(p2[0]-p0[0]));
final double s1ms2 = Math.hypot((p1[0]-p0[0])-(p2[1]-p0[1]), (p1[1]-p0[1])+(p2[0]-p0[0]));
output[1] = Math.abs(Math.log(Math.abs((s1ps2-s1ms2)/(s1ps2+s1ms2))));
output[1] = Math.abs(Math.log(Math.abs((s1ps2-s1ms2)/(s1ps2+s1ms2)))); //the first output is the shape (angle) distortion
if (Math.abs(output[1]) > 15)
output[1] = Double.NaN; //discard outliers
return output;
}