Changeset 5230 in josm


Ignore:
Timestamp:
2012-05-11T17:11:04+02:00 (12 years ago)
Author:
bastiK
Message:

use standard parameter set for lambert projection

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/data_nodist/projection-regression-test-data.csv

    r5067 r5230  
    969969  en  3266743.101643809 8326980.665451931
    970970  ll2 -15.122420619099696 174.82953069806615
     971EPSG:31370
     972  ll  49.91513996934379 3.0892264075922404
     973  en  58108.251968638695 67871.94610605389
     974  ll2 49.91513997291573 3.0892264054277314
     975EPSG:3812
     976  ll  50.76787953358437 3.4513353977071453
     977  en  585284.6677650046 662323.5758590293
     978  ll2 50.76787953358439 3.4513353977071453
     979EPSG:21781
     980  ll  46.582471410091934 8.159223152110604
     981  en  655231.0208778976 159275.39184032555
     982  ll2 46.58247142005926 8.159223160343661
    971983EPSG:31466
    972984  ll  7.0210401440287065 6.5142293675331056
     
    985997  en  5533907.888998117 8406162.271952605
    986998  ll2 75.7147487977527 16.230800026412293
    987 EPSG:31370
    988   ll  49.91513996934379 3.0892264075922404
    989   en  58108.251968638695 67871.94610605389
    990   ll2 49.91513997291573 3.0892264054277314
    991 EPSG:3812
    992   ll  50.76787953358437 3.4513353977071453
    993   en  585284.6677650046 662323.5758590293
    994   ll2 50.76787953358439 3.4513353977071453
    995999EPSG:3301
    9961000  ll  59.493759099912154 27.525338967200614
     
    9991003EPSG:27561
    10001004  ll  48.687023294540744 9.13470536591202
    1001   en  1099861.4330225135 132165.34595185294
    1002   ll2 48.687023294540765 9.13470536591202
     1005  en  1099861.4328694288 132165.3475888513
     1006  ll2 48.687023294540765 9.134705365912021
    10031007EPSG:27562
    10041008  ll  47.083336187611536 -1.6746579886431774
    1005   en  295565.1739406001 239272.03689665193
    1006   ll2 47.08333618761155 -1.6746579886431756
     1009  en  295565.17384739226 239272.03526596428
     1010  ll2 47.08333618761155 -1.6746579886431774
    10071011EPSG:27563
    10081012  ll  46.443136133672226 5.992820527372115
    1009   en  881070.7804436726 466693.7684649829
    1010   ll2 46.44313613367226 5.992820527372116
     1013  en  881070.7805340261 466693.7656533603
     1014  ll2 46.44313613367226 5.992820527372114
    10111015EPSG:27564
    10121016  ll  43.42400252536329 0.5163786716368639
    1013   en  -147178.22007173466 327298.1814310246
     1017  en  -147178.2200372536 327298.1840058803
    10141018  ll2 43.42400252536333 0.5163786716368636
    10151019EPSG:2154
     
    11011105  en  128126.42078859449 6861850.502124558
    11021106  ll2 61.86405448889923 13.084399903079852
    1103 EPSG:21781
    1104   ll  46.582471410091934 8.159223152110604
    1105   en  655231.0208778976 159275.39184032555
    1106   ll2 46.58247142005926 8.159223160343661
  • trunk/src/org/openstreetmap/josm/data/projection/Lambert.java

    r5226 r5230  
    66import java.awt.GridBagLayout;
    77import java.awt.event.ActionListener;
    8 import java.io.InputStream;
    98import java.util.Collection;
    109import java.util.Collections;
     
    1413import javax.swing.JPanel;
    1514
    16 import org.openstreetmap.josm.Main;
    1715import org.openstreetmap.josm.data.Bounds;
    1816import org.openstreetmap.josm.data.coor.LatLon;
    1917import org.openstreetmap.josm.data.projection.datum.NTV2Datum;
    20 import org.openstreetmap.josm.data.projection.datum.NTV2GridShiftFile;
    2118import org.openstreetmap.josm.data.projection.datum.NTV2GridShiftFileWrapper;
    2219import org.openstreetmap.josm.data.projection.proj.LambertConformalConic;
     
    2926 * This newer version uses the grid translation NTF<->RGF93 provided by IGN for a submillimetric accuracy.
    3027 * (RGF93 is the French geodetic system similar to WGS84 but not mathematically equal)
     28 *
     29 * Source: http://professionnels.ign.fr/DISPLAY/000/526/700/5267002/transformation.pdf
    3130 * @author Pieren
    3231 */
    3332public class Lambert extends AbstractProjection implements ProjectionSubPrefs {
    34     /**
    35      * Lambert I, II, III, and IV projection exponents
    36      */
    37     private static final double n[] = { 0.7604059656, 0.7289686274, 0.6959127966, 0.6712679322 };
    38 
    39     /**
    40      * Lambert I, II, III, and IV projection constants
    41      */
    42     private static final double c[] = { 11603796.98, 11745793.39, 11947992.52, 12136281.99 };
     33
     34    /**
     35     * Lambert I, II, III, and IV latitude origin
     36     */
     37    private static final double lat_0s[] = { 49.5, 46.8, 44.1, 42.165 };
     38   
     39    /**
     40     * Lambert I, II, III, and IV latitude of first standard parallel
     41     */
     42    private static final double lat_1s[] = {
     43            convertDegreeMinuteSecond(48, 35, 54.682),
     44            convertDegreeMinuteSecond(45, 53, 56.108),
     45            convertDegreeMinuteSecond(43, 11, 57.449),
     46            convertDegreeMinuteSecond(41, 33, 37.396)};
     47   
     48    /**
     49     * Lambert I, II, III, and IV latitude of second standard parallel
     50     */
     51    private static final double lat_2s[] = {
     52            convertDegreeMinuteSecond(50, 23, 45.282),
     53            convertDegreeMinuteSecond(47, 41, 45.652),
     54            convertDegreeMinuteSecond(44, 59, 45.938),
     55            convertDegreeMinuteSecond(42, 46, 3.588)};
    4356
    4457    /**
     
    4659     */
    4760    private static final double x_0s[] = { 600000.0, 600000.0, 600000.0, 234.358 };
    48 
     61   
    4962    /**
    5063     * Lambert I, II, III, and IV false north
    5164     */
    52     private static final double y_fs[] = { 5657616.674, 6199695.768, 6791905.085, 7239161.542 };
    53 
     65    private static final double y_0s[] = { 200000.0, 200000.0, 200000.0, 185861.369 };
     66   
    5467    /**
    5568     * France is divided in 4 Lambert projection zones (1,2,3 + 4th for Corsica)
     
    87100        datum = new NTV2Datum("ntf_rgf93Grid", null, ellps, NTV2GridShiftFileWrapper.ntf_rgf93);
    88101        x_0 = x_0s[layoutZone];
     102        y_0 = y_0s[layoutZone];
    89103        lon_0 = 2.0 + 20.0 / 60 + 14.025 / 3600; // 0 grade Paris
    90104        if (proj == null) {
     
    95109            proj.initialize(new ProjParameters() {{
    96110                ellps = Lambert.this.ellps;
    97                 lcc_n = n[layoutZone];
    98                 lcc_F = c[layoutZone] / ellps.a;
    99                 lcc_r0 = y_fs[layoutZone] / ellps.a;
     111                lat_0 = lat_0s[layoutZone];
     112                lat_1 = lat_1s[layoutZone];
     113                lat_2 = lat_2s[layoutZone];
    100114            }});
    101115        } catch (ProjectionConfigurationException e) {
  • trunk/src/org/openstreetmap/josm/data/projection/proj/LambertConformalConic.java

    r5066 r5230  
    6767        ellps = params.ellps;
    6868        e = ellps.e;
    69         if (params.lcc_n != null && params.lcc_F != null && params.lcc_r0 != null) {
    70             initializeDirect(params.lcc_n, params.lcc_F, params.lcc_r0);
     69        if (params.lat_0 == null)
     70            throw new ProjectionConfigurationException(tr("Parameter ''{0}'' required.", "lat_0"));
     71        if (params.lat_1 != null && params.lat_2 != null) {
     72            initialize2SP(params.lat_0, params.lat_1, params.lat_2);
    7173        } else {
    72             if (params.lat_0 == null)
    73                 throw new ProjectionConfigurationException(tr("Parameter ''{0}'' required.", "lat_0"));
    74             if (params.lat_1 != null && params.lat_2 != null) {
    75                 initialize2SP(params.lat_0, params.lat_1, params.lat_2);
    76             } else {
    77                 initialize1SP(params.lat_0);
    78             }
     74            initialize1SP(params.lat_0);
    7975        }
    8076    }
     
    117113        F  = m0 / (n * pow(t0, n));
    118114        r0 = F * pow(t0, n);
    119     }
    120 
    121     /**
    122      * Initialize LCC by providing the projection parameters directly.
    123      *
    124      * @param n see field n
    125      * @param F see field F
    126      * @param r0 see field r0
    127      */
    128     private void initializeDirect(double n, double F, double r0) {
    129         this.params = null;
    130         this.n = n;
    131         this.F = F;
    132         this.r0 = r0;
    133115    }
    134116
  • trunk/src/org/openstreetmap/josm/data/projection/proj/ProjParameters.java

    r5066 r5230  
    1515    public Double lat_2;
    1616
    17     /* for LambertConformalConic */
    18     public Double lcc_n;
    19     public Double lcc_F;
    20     public Double lcc_r0;
    21 
    2217}
Note: See TracChangeset for help on using the changeset viewer.