Class NTV2GridShiftFileWrapper
- java.lang.Object
-
- org.openstreetmap.josm.data.projection.datum.NTV2GridShiftFileWrapper
-
public class NTV2GridShiftFileWrapper extends java.lang.Object
Wrapper forNTV2GridShiftFile
. Loads the shift file from disk, when it is first accessed.- Since:
- 5226
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
gridFileName
private NTV2GridShiftFile
instance
static float
NTV2_SOURCE_PRIORITY_DOWNLOAD
Priority for downloaded NTV2 grid filesstatic float
NTV2_SOURCE_PRIORITY_LOCAL
Priority for local NTV2 grid filesprivate static java.util.Map<java.lang.Float,NTV2GridShiftFileSource>
sources
-
Constructor Summary
Constructors Constructor Description NTV2GridShiftFileWrapper(java.lang.String filename)
Constructs a newNTV2GridShiftFileWrapper
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description NTV2GridShiftFile
getShiftFile()
Returns the actualNTV2GridShiftFile
behind this wrapper.static void
registerNTV2GridShiftFileSource(float priority, NTV2GridShiftFileSource source)
Register a source for NTV2 grid files.
-
-
-
Field Detail
-
instance
private NTV2GridShiftFile instance
-
gridFileName
private final java.lang.String gridFileName
-
NTV2_SOURCE_PRIORITY_LOCAL
public static final float NTV2_SOURCE_PRIORITY_LOCAL
Priority for local NTV2 grid files- See Also:
- Constant Field Values
-
NTV2_SOURCE_PRIORITY_DOWNLOAD
public static final float NTV2_SOURCE_PRIORITY_DOWNLOAD
Priority for downloaded NTV2 grid files- See Also:
- Constant Field Values
-
sources
private static final java.util.Map<java.lang.Float,NTV2GridShiftFileSource> sources
-
-
Constructor Detail
-
NTV2GridShiftFileWrapper
public NTV2GridShiftFileWrapper(java.lang.String filename)
Constructs a newNTV2GridShiftFileWrapper
.- Parameters:
filename
- Path to the grid file (GSB format)
-
-
Method Detail
-
registerNTV2GridShiftFileSource
public static void registerNTV2GridShiftFileSource(float priority, NTV2GridShiftFileSource source)
Register a source for NTV2 grid files.- Parameters:
priority
- the priority, sources with higher priority are checked first; useNTV2_SOURCE_PRIORITY_LOCAL
for local files andNTV2_SOURCE_PRIORITY_DOWNLOAD
for remote downloadssource
- the NTV2 grid file source- Since:
- 12777
-
getShiftFile
public NTV2GridShiftFile getShiftFile() throws java.io.IOException
Returns the actualNTV2GridShiftFile
behind this wrapper. The grid file is only loaded once, when first accessed.- Returns:
- The NTv2 grid file
- Throws:
java.io.IOException
- if the grid file cannot be found/loaded
-
-