Changeset 6135 in josm
- Timestamp:
- 2013-08-10T22:17:09+02:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/projection
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/projection/AbstractProjection.java
r6069 r6135 39 39 } 40 40 41 /** 42 * Replies the projection (in the narrow sense) 43 * @return The projection object 44 */ 41 45 public final Proj getProj() { 42 46 return proj; -
trunk/src/org/openstreetmap/josm/data/projection/Projections.java
r6003 r6135 24 24 import org.openstreetmap.josm.data.projection.proj.LambertConformalConic; 25 25 import org.openstreetmap.josm.data.projection.proj.LonLat; 26 import org.openstreetmap.josm.data.projection.proj.Mercator; 26 27 import org.openstreetmap.josm.data.projection.proj.Proj; 27 28 import org.openstreetmap.josm.data.projection.proj.ProjFactory; … … 62 63 static { 63 64 registerBaseProjection("lonlat", LonLat.class, "core"); 64 registerBaseProjection("josm:smerc", org.openstreetmap.josm.data.projection.proj.Mercator.class, "core");65 registerBaseProjection("josm:smerc", Mercator.class, "core"); 65 66 registerBaseProjection("lcc", LambertConformalConic.class, "core"); 66 67 registerBaseProjection("somerc", SwissObliqueMercator.class, "core"); -
trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2GridShiftFile.java
r6093 r6135 79 79 private NTV2SubGrid lastSubGrid; 80 80 81 /** 82 * Constructs a new {@code NTV2GridShiftFile}. 83 */ 81 84 public NTV2GridShiftFile() { 82 85 } … … 92 95 * @param in Grid Shift File InputStream 93 96 * @param loadAccuracy is Accuracy data to be loaded as well as shift data? 94 * @throws Exception97 * @throws IOException 95 98 */ 96 99 public void loadGridShiftFile(InputStream in, boolean loadAccuracy ) throws IOException { -
trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2GridShiftFileWrapper.java
r6069 r6135 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.data.projection.datum; 3 4 import static org.openstreetmap.josm.tools.I18n.tr;5 3 6 4 import java.io.InputStream; … … 9 7 10 8 /** 11 * Wrapper for NTV2GridShiftFile.9 * Wrapper for {@link NTV2GridShiftFile}. 12 10 * 13 11 * Loads the shift file from disk, when it is first accessed. 12 * @since 5226 14 13 */ 15 14 public class NTV2GridShiftFileWrapper { 16 15 16 /** 17 * Used in Germany to convert coordinates between the DHDN (<i>Deutsches Hauptdreiecksnetz</i>) 18 * and ETRS89 (<i>European Terrestrial Reference System 1989</i>) datums. 19 * @see <a href="http://crs.bkg.bund.de/crseu/crs/descrtrans/eu-descrtrans.php?crs_id=REVfREhETiAvIEdLXzM=&op_id=REVfREhETiAoQmVUQSwgMjAwNykgdG8gRVRSUzg5"> 20 * Description of Transformation - DE_DHDN (BeTA, 2007) to ETRS89</a> 21 */ 17 22 public final static NTV2GridShiftFileWrapper BETA2007 = new NTV2GridShiftFileWrapper("resource://data/BETA2007.gsb"); 23 24 /** 25 * Used in France to convert coordinates between the NTF (<i>Nouvelle triangulation de la France</i>) 26 * and RGF93 (<i>Réseau géodésique français 1993</i>) datums. 27 * @see <a href="http://geodesie.ign.fr/contenu/fichiers/documentation/algorithmes/notice/NT111_V1_HARMEL_TransfoNTF-RGF93_FormatGrilleNTV2.pdf"> 28 * [French] Transformation de coordonnées NTF – RGF93 / Format de grille NTv2</a> 29 */ 18 30 public final static NTV2GridShiftFileWrapper ntf_rgf93 = new NTV2GridShiftFileWrapper("resource://data/ntf_r93_b.gsb"); 19 31 … … 22 34 private String gridFileName; 23 35 36 /** 37 * Constructs a new {@code NTV2GridShiftFileWrapper}. 38 * @param filename Path to the grid file (GSB format) 39 */ 24 40 public NTV2GridShiftFileWrapper(String filename) { 25 41 this.gridFileName = filename; 26 42 } 27 43 44 /** 45 * Returns the actual {@link NTV2GridShiftFile} behind this wrapper. 46 * The grid file is only loaded once, when first accessed. 47 * @return The NTv2 grid file 48 */ 28 49 public NTV2GridShiftFile getShiftFile() { 29 50 if (instance == null) { 30 51 try { 31 52 InputStream is = new MirroredInputStream(gridFileName); 32 if (is == null)33 throw new RuntimeException(tr("Error: failed to open input stream for resource ''/data/{0}''.", gridFileName));34 53 instance = new NTV2GridShiftFile(); 35 54 instance.loadGridShiftFile(is, false); -
trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2SubGrid.java
r6104 r6135 28 28 * 29 29 * @author Peter Yuill 30 * Modifi fied for JOSM :30 * Modified for JOSM : 31 31 * - removed the RandomAccessFile mode (Pieren) 32 32 * - read grid file by single bytes. Workaround for a bug in some VM not supporting … … 64 64 * @param bigEndian is the file bigEndian? 65 65 * @param loadAccuracy is the node Accuracy data to be loaded? 66 * @throws Exception66 * @throws IOException 67 67 */ 68 68 public NTV2SubGrid(InputStream in, boolean bigEndian, boolean loadAccuracy) throws IOException { … … 289 289 } 290 290 291 /** 292 * Returns textual details about the sub grid. 293 * @return textual details about the sub grid 294 */ 291 295 public String getDetails() { 292 296 StringBuffer buf = new StringBuffer("Sub Grid : "); … … 323 327 try { 324 328 clone = (NTV2SubGrid)super.clone(); 329 // Do a deep clone of the sub grids 330 if (subGrid != null) { 331 clone.subGrid = new NTV2SubGrid[subGrid.length]; 332 for (int i = 0; i < subGrid.length; i++) { 333 clone.subGrid[i] = (NTV2SubGrid)subGrid[i].clone(); 334 } 335 } 325 336 } catch (CloneNotSupportedException cnse) { 326 }327 // Do a deep clone of the sub grids328 if (subGrid != null) {329 clone.subGrid = new NTV2SubGrid[subGrid.length];330 for (int i = 0; i < subGrid.length; i++) {331 clone.subGrid[i] = (NTV2SubGrid)subGrid[i].clone();332 }333 337 } 334 338 return clone; -
trunk/src/org/openstreetmap/josm/data/projection/proj/Proj.java
r5066 r6135 23 23 */ 24 24 public interface Proj { 25 25 26 /** 26 * A Human readable name of this projection. 27 * Replies a human readable name of this projection. 28 * @return The projection name. must not be null. 27 29 */ 28 30 String getName(); 29 31 30 32 /** 31 * The Proj.4 identifier.33 * Replies the Proj.4 identifier. 32 34 * 33 * (as reported by cs2cs -lp)34 * If no id exists, return null.35 * @return The Proj.4 identifier (as reported by cs2cs -lp). 36 * If no id exists, return {@code null}. 35 37 */ 36 38 String getProj4Id(); … … 38 40 /** 39 41 * Initialize the projection using the provided parameters. 42 * @param params The projection parameters 40 43 * 41 44 * @throws ProjectionConfigurationException in case parameters are not suitable -
trunk/src/org/openstreetmap/josm/data/projection/proj/SwissObliqueMercator.java
r5066 r6135 2 2 package org.openstreetmap.josm.data.projection.proj; 3 3 4 import static java.lang.Math.*; 5 4 import static java.lang.Math.PI; 5 import static java.lang.Math.abs; 6 import static java.lang.Math.asin; 7 import static java.lang.Math.atan; 8 import static java.lang.Math.atan2; 9 import static java.lang.Math.cos; 10 import static java.lang.Math.exp; 11 import static java.lang.Math.log; 12 import static java.lang.Math.pow; 13 import static java.lang.Math.sin; 14 import static java.lang.Math.sqrt; 15 import static java.lang.Math.tan; 16 import static java.lang.Math.toRadians; 6 17 import static org.openstreetmap.josm.tools.I18n.tr; 7 18 … … 10 21 11 22 /** 12 * Projection for the SwissGrid CH1903 / L03, see http:// de.wikipedia.org/wiki/Swiss_Grid.23 * Projection for the SwissGrid CH1903 / L03, see http://en.wikipedia.org/wiki/Swiss_coordinate_system. 13 24 * 14 * Calculations are based onformula from25 * Calculations were originally based on simple formula from 15 26 * http://www.swisstopo.admin.ch/internet/swisstopo/en/home/topics/survey/sys/refsys/switzerland.parsysrelated1.37696.downloadList.12749.DownloadFile.tmp/ch1903wgs84en.pdf 16 27 *
Note:
See TracChangeset
for help on using the changeset viewer.