Changeset 12776 in josm for trunk/src/org/openstreetmap/josm/data/projection/datum
- Timestamp:
- 2017-09-07T23:41:42+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2GridShiftFileWrapper.java
r11642 r12776 5 5 import java.io.IOException; 6 6 import java.io.InputStream; 7 import java.util.Arrays; 8 import java.util.Collections; 9 import java.util.List; 7 10 8 11 import org.openstreetmap.josm.Main; 9 12 import org.openstreetmap.josm.io.CachedFile; 13 import org.openstreetmap.josm.tools.Platform; 14 import org.openstreetmap.josm.tools.PlatformVisitor; 10 15 11 16 /** … … 29 34 30 35 /** 36 * Lists default directories where the ntv2 shift files (NAD) for the proj4 37 * library would be located on different platforms. 38 */ 39 public static final PlatformVisitor<List<File>> DEFAULT_PROJ4_NTV2_SHIFT_DIRS = 40 new PlatformVisitor<List<File>>() { 41 @Override 42 public List<File> visitUnixoid() { 43 return Arrays.asList(new File("/usr/local/share/proj"), new File("/usr/share/proj")); 44 } 45 46 @Override 47 public List<File> visitWindows() { 48 return Arrays.asList(new File("C:\\PROJ\\NAD")); 49 } 50 51 @Override 52 public List<File> visitOsx() { 53 return Collections.emptyList(); 54 } 55 }; 56 57 /** 31 58 * Returns the actual {@link NTV2GridShiftFile} behind this wrapper. 32 59 * The grid file is only loaded once, when first accessed. … … 38 65 File grid = null; 39 66 // Check is the grid is installed in default PROJ.4 directories 40 for (File dir : Main.platform.getDefaultProj4NadshiftDirectories()) {67 for (File dir : Platform.determinePlatform().accept(DEFAULT_PROJ4_NTV2_SHIFT_DIRS)) { 41 68 File file = new File(dir, gridFileName); 42 69 if (file.exists() && file.isFile()) {
Note:
See TracChangeset
for help on using the changeset viewer.