Changeset 8610 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2015-07-21T22:58:33+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java
r8609 r8610 188 188 ellps = parseEllipsoid(parameters); 189 189 datum = parseDatum(parameters, ellps); 190 if (ellps == null) { 191 ellps = datum.getEllipsoid(); 192 } 190 193 proj = parseProjection(parameters, ellps); 191 194 // "utm" is a shortcut for a set of parameters … … 338 341 parameters.containsKey(Param.b.key)) 339 342 throw new ProjectionConfigurationException(tr("Combination of ellipsoid parameters is not supported.")); 340 if (parameters.containsKey(Param.no_defs.key)) 341 throw new ProjectionConfigurationException(tr("Ellipsoid required (+ellps=* or +a=*, +b=*)")); 342 // nothing specified, use WGS84 as default 343 return Ellipsoid.WGS84; 343 return null; 344 344 } 345 345 346 346 public Datum parseDatum(Map<String, String> parameters, Ellipsoid ellps) throws ProjectionConfigurationException { 347 String datumId = parameters.get(Param.datum.key); 348 if (datumId != null) { 349 Datum datum = Projections.getDatum(datumId); 350 if (datum == null) throw new ProjectionConfigurationException(tr("Unknown datum identifier: ''{0}''", datumId)); 351 return datum; 352 } 353 if (ellps == null) { 354 if (parameters.containsKey(Param.no_defs.key)) 355 throw new ProjectionConfigurationException(tr("Ellipsoid required (+ellps=* or +a=*, +b=*)")); 356 // nothing specified, use WGS84 as default 357 ellps = Ellipsoid.WGS84; 358 } 359 347 360 String nadgridsId = parameters.get(Param.nadgrids.key); 348 361 if (nadgridsId != null) { … … 362 375 return parseToWGS84(towgs84, ellps); 363 376 364 String datumId = parameters.get(Param.datum.key);365 if (datumId != null) {366 Datum datum = Projections.getDatum(datumId);367 if (datum == null) throw new ProjectionConfigurationException(tr("Unknown datum identifier: ''{0}''", datumId));368 return datum;369 }370 377 if (parameters.containsKey(Param.no_defs.key)) 371 378 throw new ProjectionConfigurationException(tr("Datum required (+datum=*, +towgs84=* or +nadgrids=*)"));
Note:
See TracChangeset
for help on using the changeset viewer.