Changeset 11660 in josm for trunk


Ignore:
Timestamp:
2017-03-04T03:09:43+01:00 (8 years ago)
Author:
Don-vip
Message:

see #5399 - Swissgrid: add NTv2 grid file provided by swisstopo

Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/CONTRIBUTION

    r10455 r11660  
    7171with the New (2-clause) BSD license.
    7272
     73------------------------------- PROJECTION DATA -------------------------------
     74
     75French NTF_R93 NTV2 grid: Source: IGN - Institut national de l'information
     76                                        géographique et forestière
     77
     78German BETA2007 NTV2 grid: Source: BKG - Bundesamt für Kartographie und Geodäsie
     79
     80Swiss CHENYX06 NTV2 grid: Source: Swiss Federal Office of Topography
     81
    7382------------------------------------ ICONS ------------------------------------
    7483
  • trunk/README

    r11602 r11660  
    6161    - fonts/                font files used for map rendering
    6262    - projection/           projection files
    63       - *.gsb               NTv2 grid files for projection support
    6463      - epsg                list of projection definitions
    6564    - *.lang                translation data
     
    7877    - Join_Areas_Tests.osm  some examples to test the 'join areas' feature
    7978    - mapcss/               sample map styles and corresponding data files for regression testing
     79    - projection/           projection files
     80      - *.gsb               NTv2 grid files for projection support (see CONTRIBUTION)
    8081    - projection-reference-data.csv
    8182                            reference data for projection tests
  • trunk/data_nodist/projection/josm-epsg

    r11644 r11660  
    7878<4326> +proj=lonlat +datum=WGS84 +axis=neu +bounds=-180,-90,180,90  <>
    7979# Swiss Grid (Switzerland)
    80 <21781> +proj=somerc +lat_0=46d57'8.66" +lon_0=7d26'22.5" +x_0=600000 +y_0=200000 +ellps=bessel +towgs84=674.374,15.056,405.346 +units=m +bounds=5.7,45.7,10.6,47.9  <>
     80<21781> +proj=somerc +lat_0=46d57'8.66" +lon_0=7d26'22.5" +x_0=600000 +y_0=200000 +ellps=bessel +nadgrids=CHENYX06_etrs.gsb +towgs84=674.374,15.056,405.346 +units=m +bounds=5.7,45.7,10.6,47.9  <>
    8181# HD72 / EOV (Hungary)
    8282<23700> +proj=somerc +lat_0=47.14439372222222 +lon_0=19.04857177777778 +k_0=0.99993 +x_0=650000 +y_0=200000 +ellps=GRS67 +towgs84=52.17,-71.82,-14.9 +units=m +bounds=16.1200,45.7800,22.9100,48.6000  <>
  • trunk/data_nodist/projection/projection-regression-test-data

    r9950 r11660  
    995995EPSG:21781
    996996  ll  46.582471410091934 8.159223152110604
    997   en  655231.0208778976 159275.39184032555
    998   ll2 46.58247142005926 8.159223160343661
     997  en  655230.9360561728 159275.55116362066
     998  ll2 46.582471410091884 8.159223152110604
    999999EPSG:21782
    10001000  ll  34.74535187788922 167.90219295117086
  • trunk/src/org/openstreetmap/josm/data/projection/proj/SwissObliqueMercator.java

    r11374 r11660  
    109109        while (abs(phi - prevPhi) > EPSILON) {
    110110            if (++iteration > 30)
    111                 throw new JosmRuntimeException("Two many iterations");
     111                throw new JosmRuntimeException("Too many iterations");
    112112            prevPhi = phi;
    113113            double s = 1 / alpha * (log(tan(PI / 4 + b / 2)) - k) + ellps.e
  • trunk/test/unit/org/openstreetmap/josm/data/projection/SwissGridTest.java

    r10758 r11660  
    66
    77import org.junit.BeforeClass;
    8 import org.junit.Ignore;
     8import org.junit.Rule;
    99import org.junit.Test;
    1010import org.openstreetmap.josm.Main;
    1111import org.openstreetmap.josm.data.coor.EastNorth;
    1212import org.openstreetmap.josm.data.coor.LatLon;
     13import org.openstreetmap.josm.testutils.JOSMTestRules;
     14
     15import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1316
    1417public class SwissGridTest {
     
    1922     * Setup test.
    2023     */
     24    @Rule
     25    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     26    public JOSMTestRules test = new JOSMTestRules().platform();
     27
     28    /**
     29     * Setup test.
     30     */
    2131    @BeforeClass
    2232    public static void setUp() {
     
    2838
    2939    /**
    30      * source: http://www.swisstopo.admin.ch/internet/swisstopo/en/home/topics/survey/sys/refsys/switzerland.parsysrelated1.37696.downloadList.97912.DownloadFile.tmp/swissprojectionen.pdf
     40     * source: https://www.swisstopo.admin.ch/content/swisstopo-internet/en/topics/survey/reference-systems/projections/_jcr_content/contentPar/tabs/items/dokumente_publikatio/tabPar/downloadlist/downloadItems/463_1459341821844.download/refsyse.pdf
    3141     */
    3242    ProjData[] data = {
     
    5666    }
    5767
    58     private static final double EPSILON_APPROX = 1.5;
    5968    private static final double EPSILON_ACCURATE = 0.05;
    6069
     
    7281
    7382    @Test
    74     public void testProjReferenceTestApprox() {
    75         projReferenceTest(EPSILON_APPROX);
    76     }
    77 
    78     @Test
    79     @Ignore("high accuracy of epsilon=" + EPSILON_ACCURATE + " is not met")
    8083    public void testProjReferenceTestAccurate() {
    81         // TODO make this test pass
    8284        projReferenceTest(EPSILON_ACCURATE);
    8385    }
     
    9092            System.out.println(en);
    9193        }
    92         assertTrue("Lausanne", Math.abs(en.east() - 533111.69) < 0.1);
    93         assertTrue("Lausanne", Math.abs(en.north() - 152227.85) < 0.1);
     94        assertTrue("Lausanne", Math.abs(en.east() - 533112.13) < 0.1);
     95        assertTrue("Lausanne", Math.abs(en.north() - 152227.35) < 0.1);
    9496
    9597        ll = new LatLon(47.78, 8.58);
     
    98100            System.out.println(en);
    99101        }
    100         assertTrue("Schafouse", Math.abs(en.east() - 685544.16) < 0.1);
    101         assertTrue("Schafouse", Math.abs(en.north() - 292782.91) < 0.1);
     102        assertTrue("Schafouse", Math.abs(en.east() - 685542.97) < 0.1);
     103        assertTrue("Schafouse", Math.abs(en.north() - 292783.21) < 0.1);
    102104
    103105        ll = new LatLon(46.58, 10.48);
     
    106108            System.out.println(en);
    107109        }
    108         assertTrue("Grinson", Math.abs(en.east() - 833068.04) < 0.1);
    109         assertTrue("Grinson", Math.abs(en.north() - 163265.39) < 0.1);
     110        assertTrue("Grinson", Math.abs(en.east() - 833066.95) < 0.1);
     111        assertTrue("Grinson", Math.abs(en.north() - 163265.32) < 0.1);
    110112
    111113        ll = new LatLon(46.0 + 57.0 / 60 + 3.89813884505 / 3600, 7.0 + 26.0 / 60 + 19.076595154147 / 3600);
     
    117119        assertTrue("Berne", Math.abs(en.north() - 200000.0) < 0.1);
    118120
    119         ll = new LatLon(46.0 + 2.0 / 60 + 38.87 / 3600, 8.0 + 43.0 / 60 + 49.79 / 3600);
     121        // http://geodesy.geo.admin.ch/reframe/lv03towgs84?easting=700000&northing=100000
     122        ll = new LatLon(46.04412093223244, 8.730497366167727);
    120123        en = Main.getProjection().latlon2eastNorth(ll);
    121124        if (debug) {
     
    128131    @Test
    129132    public void testBeastNorth2latlon() {
    130         EastNorth en = new EastNorth(533111.69, 152227.85);
     133        EastNorth en = new EastNorth(533112.13, 152227.35);
    131134        LatLon ll = Main.getProjection().eastNorth2latlon(en);
    132135        if (debug) {
     
    136139        assertTrue("Lausanne", Math.abs(ll.lon() - 6.567) < 0.00001);
    137140
    138         en = new EastNorth(685544.16, 292782.91);
     141        en = new EastNorth(685542.97, 292783.21);
    139142        ll = Main.getProjection().eastNorth2latlon(en);
    140143        if (debug) {
     
    144147        assertTrue("Schafouse", Math.abs(ll.lon() - 8.58) < 0.00001);
    145148
    146         en = new EastNorth(833068.04, 163265.39);
     149        en = new EastNorth(833066.95, 163265.32);
    147150        ll = Main.getProjection().eastNorth2latlon(en);
    148151        if (debug) {
     
    160163        assertTrue("Berne", Math.abs(ll.lon() - (7.0 + 26.0 / 60 + 19.076595154147 / 3600)) < 0.00001);
    161164
     165        // http://geodesy.geo.admin.ch/reframe/lv03towgs84?easting=700000&northing=100000
    162166        en = new EastNorth(700000.0, 100000.0);
    163167        ll = Main.getProjection().eastNorth2latlon(en);
     
    165169            System.out.println(ll);
    166170        }
    167         assertTrue("Ref", Math.abs(ll.lat() - (46.0 + 2.0 / 60 + 38.87 / 3600)) < 0.00001);
    168         assertTrue("Ref", Math.abs(ll.lon() - (8.0 + 43.0 / 60 + 49.79 / 3600)) < 0.00001);
     171        assertTrue("Ref", Math.abs(ll.lat() - 46.04412093223244) < 0.00001);
     172        assertTrue("Ref", Math.abs(ll.lon() - 8.730497366167727) < 0.00001);
    169173    }
    170174
Note: See TracChangeset for help on using the changeset viewer.