Ignore:
Timestamp:
2013-06-12T00:50:23+02:00 (6 years ago)
Author:
Don-vip
Message:

Fallback to core projections when proj4j plugin fails to get one

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/projection/Projections.java

    r5889 r6003  
    165165        if (proj != null) return proj;
    166166        ProjectionChoice pc = allProjectionChoicesByCode.get(code);
    167         if (pc == null) {
     167        if (pc != null) {
     168            Collection<String> pref = pc.getPreferencesFromCode(code);
     169            pc.setPreferences(pref);
     170            try {
     171                proj = pc.getProjection();
     172            } catch (Throwable t) {
     173                String cause = t.getMessage();
     174                Main.warn("Unable to get projection "+code+" with "+pc + (cause != null ? ". "+cause : ""));
     175            }
     176        }
     177        if (proj == null) {
    168178            Pair<String, String> pair = inits.get(code);
    169179            if (pair == null) return null;
     
    171181            String init = pair.b;
    172182            proj = new CustomProjection(name, code, init, null);
    173         } else {
    174             Collection<String> pref = pc.getPreferencesFromCode(code);
    175             pc.setPreferences(pref);
    176             proj = pc.getProjection();
    177183        }
    178184        projectionsByCode_cache.put(code, proj);
Note: See TracChangeset for help on using the changeset viewer.