Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ch/ethz/karto/gui/ProjectionSelectionPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private void initComponents() {
selectionPanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 5, 10));

projectionComboBox.setMaximumRowCount(40);
projectionComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Plate Carr�e (Geographic)", "Cylindrical Equal-Area", "Cylindrical Conformal (Mercator)", "Conical Equidistant", "Conical Equal-Area (Albers)", "Conical Conformal (Lambert)", "Azimuthal Equidistant", "Azimuthal Equal-Area (Lambert)", "Azimuthal Conformal (Stereographic)", "Azimuthal Orthographic", "Sinusoidal", "Pseudoconical Equal-Area (Bonne)" }));
projectionComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Plate Carrée (Geographic)", "Cylindrical Equal-Area", "Cylindrical Conformal (Mercator)", "Conical Equidistant", "Conical Equal-Area (Albers)", "Conical Conformal (Lambert)", "Azimuthal Equidistant", "Azimuthal Equal-Area (Lambert)", "Azimuthal Conformal (Stereographic)", "Azimuthal Orthographic", "Sinusoidal", "Pseudoconical Equal-Area (Bonne)" }));
projectionComboBox.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
projectionComboBoxItemStateChanged(evt);
Expand All @@ -166,7 +166,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
selectionPanel.add(nextProjectionButton);

inverseCheckBox.setText("Test Inverse");
inverseCheckBox.setToolTipText("Applies forward and inverse projection, which should result in a Plate Carr�e projection.");
inverseCheckBox.setToolTipText("Applies forward and inverse projection, which should result in a Plate Carrée projection.");
inverseCheckBox.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
inverseCheckBoxActionPerformed(evt);
Expand Down
52 changes: 26 additions & 26 deletions src/com/jhlabs/map/GeodeticPosition.java
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
package com.jhlabs.map;
public class GeodeticPosition {
public double lat;
public double lon;
public double h;
public GeodeticPosition() {
lat = 0;
lon = 0;
h = 0;
}
public GeodeticPosition(double lat, double lon) {
this.lat = lat;
this.lon = lon;
this.h = 0;
}
public GeodeticPosition(double lat, double lon, double h) {
this.lat = lat;
this.lon = lon;
this.h = h;
}
}
package com.jhlabs.map;

public class GeodeticPosition {

public double lat;
public double lon;
public double h;

public GeodeticPosition() {
lat = 0;
lon = 0;
h = 0;
}

public GeodeticPosition(double lat, double lon) {
this.lat = lat;
this.lon = lon;
this.h = 0;
}

public GeodeticPosition(double lat, double lon, double h) {
this.lat = lat;
this.lon = lon;
this.h = h;
}
}
2 changes: 1 addition & 1 deletion src/com/jhlabs/map/proj/Apian1Projection.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public Year getYear() {

@Override
public String getAuthor() {
return "Peter Apian (Peter Bienewitz) (14951552)";
return "Peter Apian (Peter Bienewitz) (1495-1552)";
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/com/jhlabs/map/proj/Apian2Projection.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public Year getYear() {

@Override
public String getAuthor() {
return "Peter Apian (Peter Bienewitz) (14951552)";
return "Peter Apian (Peter Bienewitz) (1495-1552)";
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/com/jhlabs/map/proj/BaconProjection.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public Year getYear() {

@Override
public String getAuthor() {
return "Roger Bacon (12141294)";
return "Roger Bacon (1214-1294)";
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/com/jhlabs/map/proj/BonneProjection.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,6 @@ public String getHistoryDescription() {
+ " 1511 and Honter in 1561. Accurate use by De l'Isle before "
+ "1700, Coronelli in 1696. Named after Rigobert Bonne (1727-1795). "
+ "The Werner projection was invented by Johannes Stabius "
+ "around 1500 and promoted by Johannes Werner (14661528).";
+ "around 1500 and promoted by Johannes Werner (1466-1528).";
}
}
4 changes: 2 additions & 2 deletions src/com/jhlabs/map/proj/CassiniProjection.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ public Year getYear() {

@Override
public String getAuthor() {
return "C�sar Fran�ois Cassini de Thury (1714-1784)";
return "César François Cassini de Thury (1714-1784)";
}

@Override
public String getDescription() {
return super.getDescription() + "\nTransverse aspect of Plate Carr�e.";
return super.getDescription() + "\nTransverse aspect of Plate Carrée.";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,6 @@ public Year getYear() {

@Override
public String getAuthor() {
return "Johann Heinrich Lambert (17281777)";
return "Johann Heinrich Lambert (1728-1777)";
}
}
6 changes: 3 additions & 3 deletions src/com/jhlabs/map/proj/HufnagelProjection.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

/**
* The Hufnagel projection family was introduced by Herbert Hufnagel in
* "Hufnagel, H. 1989. Ein System unecht-zylindrischer Kartennetze f�r
* Erdkarten. Kartographische Nachrichten, 39(3), 8996." All projections are
* "Hufnagel, H. 1989. Ein System unecht-zylindrischer Kartennetze für
* Erdkarten. Kartographische Nachrichten, 39(3), 89-96." All projections are
* equal-area. Implementation by Bernhard Jenny, Oregon State University, Bojan
* Savric, Oregon State University, with substantial contributions by Daniel
* "daan" Strebe, Mapthematics. November 2014 to October 2015.
Expand Down Expand Up @@ -115,7 +115,7 @@ private double approximatePsiFromTable(double v, double[] table) {
} else if (vAbs > table[imid]) {
imin = imid;
} else {
// abs(phi) < latitudeTable[mid], or abs(phi) == latitudeTable[mid] and mid 0
// abs(phi) < latitudeTable[mid], or abs(phi) == latitudeTable[mid] and mid ­ 0
imax = imid;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/com/jhlabs/map/proj/LagrangeProjection.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,6 @@ public Year getYear() {

@Override
public String getAuthor() {
return "Johann Heinrich Lambert (17281777) and Joseph Louis Lagrange (17361813)";
return "Johann Heinrich Lambert (1728-1777) and Joseph Louis Lagrange (1736-1813)";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,6 @@ public Year getYear() {

@Override
public String getAuthor() {
return "Johann Heinrich Lambert (17281777)";
return "Johann Heinrich Lambert (1728-1777)";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public Year getYear() {

@Override
public String getAuthor() {
return "Johann Heinrich Lambert (17281777)";
return "Johann Heinrich Lambert (1728-1777)";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ public Year getYear() {

@Override
public String getAuthor() {
return "Johann Heinrich Lambert (17281777)";
return "Johann Heinrich Lambert (1728-1777)";
}
}
198 changes: 99 additions & 99 deletions src/com/jhlabs/map/proj/NZMGProjection.java
Original file line number Diff line number Diff line change
@@ -1,99 +1,99 @@
/**
Contributed by Andrey Novikov, September 2011.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package com.jhlabs.map.proj;
import com.jhlabs.map.MapMath;
import java.awt.geom.Point2D;
public class NZMGProjection extends Projection {
private static final double SEC5_TO_RAD = 0.4848136811095359935899141023;
private static final double RAD_TO_SEC5 = 2.062648062470963551564733573;
private static final double bf[][] = {
{.7557853228, 0.0},
{.249204646, .003371507},
{-.001541739, .041058560},
{-.10162907, .01727609},
{-.26623489, -.36249218},
{-.6870983, -1.1651967}};
private static final double tphi[] = {1.5627014243, .5185406398, -.03333098, -.1052906, -.0368594,
.007317, .01220, .00394, -.0013};
private static final double tpsi[] = {.6399175073, -.1358797613, .063294409, -.02526853, .0117879,
-.0055161, .0026906, -.001333, .00067, -.00034};
public void initialize() {
// force to International major axis
a = 6378388.0;
super.initialize();
//ra = 1. / a;
projectionLongitude = DTR * 173.;
projectionLatitude = DTR * -41.;
falseEasting = 2510000.;
falseNorthing = 6023150.;
}
public Point2D.Double project(double lam, double phi, Point2D.Double xy) {
double[] p = new double[2];
phi = (phi - projectionLatitude) * RAD_TO_SEC5;
p[0] = tpsi[tpsi.length - 1];
for (int i = tpsi.length - 2; i >= 0; i--) {
p[0] = tpsi[i] + phi * p[0];
}
p[0] *= phi;
p[1] = lam;
p = MapMath.zpoly1(p, bf, bf.length);
xy.x = p[1];
xy.y = p[0];
return xy;
}
public Point2D.Double projectInverse(double x, double y, Point2D.Double lp) {
int nn, i;
double[] p = new double[2], f, fp = new double[2], dp = new double[2];
double den;
p[0] = y;
p[1] = x;
for (nn = 20; nn > 0; --nn) {
f = MapMath.zpolyd1(p, bf, bf.length, fp);
f[0] -= y;
f[1] -= x;
den = fp[0] * fp[0] + fp[1] * fp[1];
p[0] += dp[0] = -(f[0] * fp[0] + f[1] * fp[1]) / den;
p[1] += dp[1] = -(f[1] * fp[0] - f[0] * fp[1]) / den;
if ((Math.abs(dp[0]) + Math.abs(dp[1])) <= EPS10) {
break;
}
}
lp.x = p[1];
lp.y = tphi[tphi.length - 1];
for (i = tphi.length - 2; i >= 0; --i) {
lp.y = tphi[i] + p[0] * lp.y;
}
lp.y = projectionLatitude + p[0] * lp.y * SEC5_TO_RAD;
return lp;
}
public boolean hasInverse() {
return true;
}
public String toString() {
return "New Zealand Map Grid";
}
}
/**
Contributed by Andrey Novikov, September 2011.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package com.jhlabs.map.proj;

import com.jhlabs.map.MapMath;
import java.awt.geom.Point2D;

public class NZMGProjection extends Projection {

private static final double SEC5_TO_RAD = 0.4848136811095359935899141023;
private static final double RAD_TO_SEC5 = 2.062648062470963551564733573;
private static final double bf[][] = {
{.7557853228, 0.0},
{.249204646, .003371507},
{-.001541739, .041058560},
{-.10162907, .01727609},
{-.26623489, -.36249218},
{-.6870983, -1.1651967}};
private static final double tphi[] = {1.5627014243, .5185406398, -.03333098, -.1052906, -.0368594,
.007317, .01220, .00394, -.0013};
private static final double tpsi[] = {.6399175073, -.1358797613, .063294409, -.02526853, .0117879,
-.0055161, .0026906, -.001333, .00067, -.00034};

public void initialize() {
// force to International major axis
a = 6378388.0;
super.initialize();
//ra = 1. / a;
projectionLongitude = DTR * 173.;
projectionLatitude = DTR * -41.;
falseEasting = 2510000.;
falseNorthing = 6023150.;
}

public Point2D.Double project(double lam, double phi, Point2D.Double xy) {
double[] p = new double[2];

phi = (phi - projectionLatitude) * RAD_TO_SEC5;
p[0] = tpsi[tpsi.length - 1];
for (int i = tpsi.length - 2; i >= 0; i--) {
p[0] = tpsi[i] + phi * p[0];
}
p[0] *= phi;
p[1] = lam;
p = MapMath.zpoly1(p, bf, bf.length);
xy.x = p[1];
xy.y = p[0];
return xy;
}

public Point2D.Double projectInverse(double x, double y, Point2D.Double lp) {
int nn, i;
double[] p = new double[2], f, fp = new double[2], dp = new double[2];
double den;

p[0] = y;
p[1] = x;
for (nn = 20; nn > 0; --nn) {
f = MapMath.zpolyd1(p, bf, bf.length, fp);
f[0] -= y;
f[1] -= x;
den = fp[0] * fp[0] + fp[1] * fp[1];
p[0] += dp[0] = -(f[0] * fp[0] + f[1] * fp[1]) / den;
p[1] += dp[1] = -(f[1] * fp[0] - f[0] * fp[1]) / den;
if ((Math.abs(dp[0]) + Math.abs(dp[1])) <= EPS10) {
break;
}
}
lp.x = p[1];
lp.y = tphi[tphi.length - 1];
for (i = tphi.length - 2; i >= 0; --i) {
lp.y = tphi[i] + p[0] * lp.y;
}
lp.y = projectionLatitude + p[0] * lp.y * SEC5_TO_RAD;
return lp;
}

public boolean hasInverse() {
return true;
}

public String toString() {
return "New Zealand Map Grid";
}
}
Loading