Changeset 28364 in osm for applications/editors
- Timestamp:
- 2012-04-29T17:46:06+02:00 (13 years ago)
- 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 30 30 import org.openstreetmap.josm.plugins.opendata.modules.fr.datagouvfr.datasets.hydrologie.EauxDeSurfaceHandler; 31 31 import org.openstreetmap.josm.plugins.opendata.modules.fr.datagouvfr.datasets.hydrologie.ROEHandler; 32 import org.openstreetmap.josm.plugins.opendata.modules.fr.datagouvfr.datasets.transport.AeroportsHandler; 32 33 import org.openstreetmap.josm.plugins.opendata.modules.fr.datagouvfr.datasets.transport.PassageNiveauHandler; 33 34 … … 49 50 handlers.add(EauxDeSurfaceHandler.class); 50 51 handlers.add(InventaireForestierNationalHandler.class); 52 handlers.add(AeroportsHandler.class); 51 53 } 52 54 } -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/OdConstants.java
r28191 r28364 129 129 * Coordinates fields 130 130 */ 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"; 133 133 134 134 // 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 22 22 23 23 private int sheetNumber = -1; 24 private int lineNumber = -1; 24 25 private boolean handlesProjection = false; 26 27 private int xCol = -1; 28 private int yCol = -1; 25 29 26 30 @Override … … 48 52 return null; 49 53 } 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 } 50 84 } -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/tabular/SpreadSheetHandler.java
r28113 r28364 30 30 31 31 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(); 32 44 } -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/tabular/SpreadSheetReader.java
r28113 r28364 74 74 } 75 75 76 protected final int getLineNumber() { 77 return handler != null ? handler.getLineNumber() : -1; 78 } 79 76 80 private class CoordinateColumns { 77 81 public int xCol = -1; … … 148 152 lineNumber++; 149 153 EastNorth en = new EastNorth(Double.NaN, Double.NaN); 154 if (handler != null) { 155 handler.setXCol(-1); 156 handler.setYCol(-1); 157 } 150 158 Node n = new Node(); 151 159 for (int i = 0; i<fields.length; i++) { … … 155 163 } else if (i == columns.xCol) { 156 164 en.setLocation(parseDouble(fields[i]), en.north()); 165 if (handler != null) { 166 handler.setXCol(i); 167 } 157 168 } else if (i == columns.yCol) { 158 169 en.setLocation(en.east(), parseDouble(fields[i])); 170 if (handler != null) { 171 handler.setYCol(i); 172 } 159 173 } else if (!allProjIndexes.contains(i)) { 160 174 if (!fields[i].isEmpty()) { … … 185 199 String[] header = null; 186 200 int length = 0; 201 int n = 0; 187 202 188 203 while (header == null || length == 0) { 204 n++; 189 205 header = readLine(progressMonitor); 190 206 length = 0; 191 if (header == null ) {207 if (header == null && n > getLineNumber()) { 192 208 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 } 195 213 } 196 214 } -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/util/OdUtils.java
r28113 r28364 72 72 return lang; 73 73 } 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 } 74 82 }
Note:
See TracChangeset
for help on using the changeset viewer.