Changeset 28364 in osm


Ignore:
Timestamp:
2012-04-29T17:46:06+02:00 (12 years ago)
Author:
donvip
Message:

[josm_opendata] French airports support

Location:
applications/editors/josm/plugins/opendata
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/DataGouvFrModule.java

    r28143 r28364  
    3030import org.openstreetmap.josm.plugins.opendata.modules.fr.datagouvfr.datasets.hydrologie.EauxDeSurfaceHandler;
    3131import org.openstreetmap.josm.plugins.opendata.modules.fr.datagouvfr.datasets.hydrologie.ROEHandler;
     32import org.openstreetmap.josm.plugins.opendata.modules.fr.datagouvfr.datasets.transport.AeroportsHandler;
    3233import org.openstreetmap.josm.plugins.opendata.modules.fr.datagouvfr.datasets.transport.PassageNiveauHandler;
    3334
     
    4950        handlers.add(EauxDeSurfaceHandler.class);
    5051        handlers.add(InventaireForestierNationalHandler.class);
     52        handlers.add(AeroportsHandler.class);
    5153    }
    5254}
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/OdConstants.java

    r28191 r28364  
    129129     * Coordinates fields
    130130     */
    131     public static final String X_STRING = "X|LON|LONGI|LONGITUDE|EASTING";
    132     public static final String Y_STRING = "Y|LAT|LATI|LATITUDE|NORTHING";
     131    public static final String X_STRING = "X|LON|LONGI|LONGITUDE.*|EASTING";
     132    public static final String Y_STRING = "Y|LAT|LATI|LATITUDE.*|NORTHING";
    133133   
    134134    // The list of all ProjectionPatterns (filled at each constructor call)
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/tabular/DefaultSpreadSheetHandler.java

    r28113 r28364  
    2222
    2323        private int sheetNumber = -1;
     24        private int lineNumber = -1;
    2425        private boolean handlesProjection = false;
     26       
     27        private int xCol = -1;
     28        private int yCol = -1;
    2529       
    2630        @Override
     
    4852                return null;
    4953        }
     54
     55        @Override
     56        public void setLineNumber(int n) {
     57                lineNumber = n;
     58        }
     59
     60        @Override
     61        public int getLineNumber() {
     62                return lineNumber;
     63        }
     64
     65        @Override
     66        public void setXCol(int i) {
     67                xCol = i;
     68        }
     69
     70        @Override
     71        public void setYCol(int i) {
     72                yCol = i;
     73        }
     74
     75        @Override
     76        public int getXCol() {
     77                return xCol;
     78        }
     79
     80        @Override
     81        public int getYCol() {
     82                return yCol;
     83        }
    5084}
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/tabular/SpreadSheetHandler.java

    r28113 r28364  
    3030
    3131        public LatLon getCoor(EastNorth en, String[] fields);
     32
     33        public void setLineNumber(int n);
     34       
     35        public int getLineNumber();
     36
     37        public void setXCol(int i);
     38
     39        public void setYCol(int i);
     40       
     41        public int getXCol();
     42
     43        public int getYCol();
    3244}
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/tabular/SpreadSheetReader.java

    r28113 r28364  
    7474        }
    7575       
     76        protected final int getLineNumber() {
     77                return handler != null ? handler.getLineNumber() : -1;
     78        }
     79       
    7680        private class CoordinateColumns {
    7781                public int xCol = -1;
     
    148152                        lineNumber++;
    149153                        EastNorth en = new EastNorth(Double.NaN, Double.NaN);
     154                        if (handler != null) {
     155                                handler.setXCol(-1);
     156                                handler.setYCol(-1);
     157                        }
    150158                        Node n = new Node();
    151159                        for (int i = 0; i<fields.length; i++) {
     
    155163                                        } else if (i == columns.xCol) {
    156164                                                en.setLocation(parseDouble(fields[i]), en.north());
     165                                                if (handler != null) {
     166                                                        handler.setXCol(i);
     167                                                }
    157168                                        } else if (i == columns.yCol) {
    158169                                                en.setLocation(en.east(), parseDouble(fields[i]));
     170                                                if (handler != null) {
     171                                                        handler.setYCol(i);
     172                                                }
    159173                                        } else if (!allProjIndexes.contains(i)) {
    160174                                                if (!fields[i].isEmpty()) {
     
    185199                String[] header = null;
    186200                int length = 0;
     201                int n = 0;
    187202               
    188203                while (header == null || length == 0) {
     204                        n++;
    189205                        header = readLine(progressMonitor);
    190206                        length = 0;
    191                         if (header == null) {
     207                        if (header == null && n > getLineNumber()) {
    192208                                return null;
    193                         } else for (String field : header) {
    194                                 length += field.length();
     209                        } else if (header != null && (getLineNumber() == -1 || getLineNumber() == n)) {
     210                                for (String field : header) {
     211                                        length += field.length();
     212                                }
    195213                        }
    196214                }
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/util/OdUtils.java

    r28113 r28364  
    7272                return lang;
    7373        }
     74       
     75    public static final double convertMinuteSecond(double minute, double second) {
     76        return (minute/60.0) + (second/3600.0);
     77    }
     78
     79    public static final double convertDegreeMinuteSecond(double degree, double minute, double second) {
     80        return degree + convertMinuteSecond(minute, second);
     81    }
    7482}
Note: See TracChangeset for help on using the changeset viewer.