| Revision 5236,
1.2 KB
checked in by bastiK, 9 days ago
(diff) |
- removed offset option from UTM which is probably rarely used.
(custom projection can be used for this now,
e.g. +proj=tmerc +lon_0=-3 +k_0=0.9996 +x_0=3500000 or
+init=epsg:32630 +x_0=3500000)
- fixed tests
|
| Line | |
|---|
| 1 | // License: GPL. For details, see LICENSE file. |
|---|
| 2 | package org.openstreetmap.josm.data.projection; |
|---|
| 3 | |
|---|
| 4 | import java.util.Collection; |
|---|
| 5 | import java.util.HashMap; |
|---|
| 6 | import java.util.Map; |
|---|
| 7 | |
|---|
| 8 | import org.openstreetmap.josm.gui.preferences.projection.ProjectionChoice; |
|---|
| 9 | import org.openstreetmap.josm.gui.preferences.projection.ProjectionPreference; |
|---|
| 10 | |
|---|
| 11 | public class ProjectionInfo { |
|---|
| 12 | private static Map<String, ProjectionChoice> allCodesPC = new HashMap<String, ProjectionChoice>(); |
|---|
| 13 | private static Map<String, Projection> allCodes = new HashMap<String, Projection>(); |
|---|
| 14 | |
|---|
| 15 | static { |
|---|
| 16 | for (ProjectionChoice pc : ProjectionPreference.getProjectionChoices()) { |
|---|
| 17 | for (String code : pc.allCodes()) { |
|---|
| 18 | allCodesPC.put(code, pc); |
|---|
| 19 | } |
|---|
| 20 | } |
|---|
| 21 | } |
|---|
| 22 | |
|---|
| 23 | public static Projection getProjectionByCode(String code) { |
|---|
| 24 | Projection p = allCodes.get(code); |
|---|
| 25 | if (p != null) return p; |
|---|
| 26 | ProjectionChoice pc = allCodesPC.get(code); |
|---|
| 27 | if (pc == null) return null; |
|---|
| 28 | Collection<String> pref = pc.getPreferencesFromCode(code); |
|---|
| 29 | pc.setPreferences(pref); |
|---|
| 30 | p = pc.getProjection(); |
|---|
| 31 | allCodes.put(code, p); |
|---|
| 32 | return p; |
|---|
| 33 | } |
|---|
| 34 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.