com.bbn.openmap.layer.rpf
Class RpfUtil

java.lang.Object
  extended by com.bbn.openmap.layer.rpf.RpfUtil

public class RpfUtil
extends java.lang.Object

The RpfUtil is a program that will allow you to manage RPF data geographically. You can copy and delete RPF data frames from RPF data directories, make an A.TOC file for a RPF directory (even after copying and/or deleting), and you can zip an RPF directory into an archive if you like. You can limit the commands to only affect those frames completely inside or outside a specified area, or for those frames that intersect and are contained by that area (default). You can also limit the charts affected based on their map scales, providing a scale and indicating that you only want those frames that match the scale, do not match the scale, are greater or less than the scale. Greater than or less than refers to the scale number of the chart being greater or less than the scale number provided, NOT whether the resulting scale ratio is greater or less than. These things are opposite if each other, and we're just working with the numbers.

When you call RpfUtil.setRpfDir, that calls organizeFrames(rpfDir), which creates a list of the frames affected by the scale and boundary settings. Then, the operation runs on those frames.

It is important that the A.TOC file in the source RPF directory reflects the current state of the data in that directory. If you are not sure, run this program with the -maketoc option on that directory to update it.

Author:
dietrick

Field Summary
static float ALL_SCALES
           
protected  int boundaryLimits
           
static int BOUNDED
           
protected  java.util.List<java.lang.String> frameList
           
static int INSIDE
           
protected  float leftLon
           
protected  float lowerLat
           
static int OUTSIDE
           
protected  float rightLon
           
protected  java.lang.String rpfDir
           
protected  float scale
           
static char SCALE_EQUALS
           
static char SCALE_GREATERTHAN
           
static char SCALE_LESSTHAN
           
static char SCALE_NOTEQUALS
           
protected  char scaleDelim
           
protected  float upperLat
           
protected  boolean verbose
           
 
Constructor Summary
RpfUtil()
          Create a default RpfUtil considering all data.
RpfUtil(float ulat, float llon, float llat, float rlon)
          Create a RpfUtil considering data intersecting the provided boundary.
RpfUtil(java.lang.String rpfDir, float ulat, float llon, float llat, float rlon)
          Create a RpfUtil considering data intersecting the provided boundary, involving the provided RPF directory.
RpfUtil(java.lang.String rpfDir, float ulat, float llon, float llat, float rlon, float scale, char scaleDelimiter, int boundaryLimits)
          Full control over the RpfUtil settings.
 
Method Summary
 boolean copy(java.lang.String toRpfDir)
          Copy the frame files currently set on the FrameList to the provided RPF directory.
 boolean delete(java.lang.String rpfDir)
          Delete the files in the provided RPF directory that match the current scale and boundary settings.
protected  boolean frameFitsCriteria(double left, double right, double up, double down, double rlinterval, double udinterval)
          Geographical evaluation of frame file
 int getBoundaryLimits()
           
 java.util.List<java.lang.String> getFrameList()
           
protected  java.util.List<java.lang.String> getFrameList(RpfTocEntry entry, double rlinterval, double udinterval)
          Middle management for frames for A.TOC entry box.
 float getLeftLon()
           
 float getLowerLat()
           
 float getRightLon()
           
 java.lang.String getRpfDir()
           
 float getScale()
           
 char getScaleDelim()
           
 float getUpperLat()
           
static void main(java.lang.String[] args)
          The RpfUtil class can be run as a java program.
 boolean maketoc(java.lang.String rpfDir)
          Create an A.TOC file for the provided RPF directory.
protected  java.util.List<java.lang.String> organizeFrames(java.lang.String rpfDir)
          Creates the list of frames to consider, based on settings.
 void query(java.lang.String rpfDir)
          Just run a query on the provided directory, listing the names of the frames that will be affected by the current scale and boundary settings.
 void setBoundaryLimits(int boundaryLimits)
          Set whether the frames need to be INSIDE, OUTSIDE or inside and touching the BOUNDARY of the geographical area set in the RpfUtil object.
 void setFrameList(java.util.List<java.lang.String> frameList)
           
 void setLeftLon(float leftLon)
           
 void setLowerLat(float lowerLat)
           
 void setRightLon(float rightLon)
           
 void setRpfDir(java.lang.String rpfDir)
          Creates the list of frames matching the geographical and scale parameters of the frames within the directory.
 void setScale(float scale)
           
 void setScaleDelim(char scaleDelim)
          Set whether the frames considered should have scale numbers greater than (g), less than (l), not equal to (n) or equal to (e).
 void setUpperLat(float upperLat)
           
 boolean zip(java.lang.String zipLocation, java.lang.String toBeZippedName)
          Store the contents of the toBeZippedName directory into a zip file with the provided name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCALE_EQUALS

public static final char SCALE_EQUALS
See Also:
Constant Field Values

SCALE_NOTEQUALS

public static final char SCALE_NOTEQUALS
See Also:
Constant Field Values

SCALE_GREATERTHAN

public static final char SCALE_GREATERTHAN
See Also:
Constant Field Values

SCALE_LESSTHAN

public static final char SCALE_LESSTHAN
See Also:
Constant Field Values

ALL_SCALES

public static final float ALL_SCALES
See Also:
Constant Field Values

BOUNDED

public static final int BOUNDED
See Also:
Constant Field Values

INSIDE

public static final int INSIDE
See Also:
Constant Field Values

OUTSIDE

public static final int OUTSIDE
See Also:
Constant Field Values

boundaryLimits

protected int boundaryLimits

scale

protected float scale

scaleDelim

protected char scaleDelim

upperLat

protected float upperLat

leftLon

protected float leftLon

lowerLat

protected float lowerLat

rightLon

protected float rightLon

rpfDir

protected java.lang.String rpfDir

verbose

protected boolean verbose

frameList

protected java.util.List<java.lang.String> frameList
Constructor Detail

RpfUtil

public RpfUtil()
Create a default RpfUtil considering all data.


RpfUtil

public RpfUtil(float ulat,
               float llon,
               float llat,
               float rlon)
Create a RpfUtil considering data intersecting the provided boundary. The RPF data directory still needs to be set.

Parameters:
ulat - upper latitude
llon - left longitude
llat - lower latitude
rlon - right longitude

RpfUtil

public RpfUtil(java.lang.String rpfDir,
               float ulat,
               float llon,
               float llat,
               float rlon)
Create a RpfUtil considering data intersecting the provided boundary, involving the provided RPF directory.

Parameters:
rpfDir - the RPF directory to search and consider frames over.
ulat - upper latitude
llon - left longitude
llat - lower latitude
rlon - right longitude

RpfUtil

public RpfUtil(java.lang.String rpfDir,
               float ulat,
               float llon,
               float llat,
               float rlon,
               float scale,
               char scaleDelimiter,
               int boundaryLimits)
Full control over the RpfUtil settings.

Parameters:
rpfDir - the RPF directory to search and consider frames over.
ulat - upper latitude
llon - left longitude
llat - lower latitude
rlon - right longitude
scale - the scale of the charts to consider.
scaleDelimiter - character 'g'reater than, 'l'ess than, 'n'ot equal to, 'e'qual to. e is the default.
boundaryLimits - INSIDE, OUTSIDE or BOUNDARY
Method Detail

organizeFrames

protected java.util.List<java.lang.String> organizeFrames(java.lang.String rpfDir)
Creates the list of frames to consider, based on settings. This method does a cursory check of scale settings before moving to geographical settings.

Parameters:
rpfDir -
Returns:
List of relative path names to frames.

getFrameList

protected java.util.List<java.lang.String> getFrameList(RpfTocEntry entry,
                                                        double rlinterval,
                                                        double udinterval)
Middle management for frames for A.TOC entry box.

Parameters:
entry - RpfTocEntry to consider.
rlinterval - right to left decimal degree interval for entry.
udinterval - up to down decimal degree interval for entry
Returns:
List of frame strings that pass current settings.

frameFitsCriteria

protected boolean frameFitsCriteria(double left,
                                    double right,
                                    double up,
                                    double down,
                                    double rlinterval,
                                    double udinterval)
Geographical evaluation of frame file

Returns:
true if file should be added to the list.

copy

public boolean copy(java.lang.String toRpfDir)
Copy the frame files currently set on the FrameList to the provided RPF directory.

Parameters:
toRpfDir -
Returns:
true if it works.

maketoc

public boolean maketoc(java.lang.String rpfDir)
Create an A.TOC file for the provided RPF directory.

Parameters:
rpfDir -
Returns:
true if it works.

delete

public boolean delete(java.lang.String rpfDir)
Delete the files in the provided RPF directory that match the current scale and boundary settings.

Parameters:
rpfDir -
Returns:
true if it works.

zip

public boolean zip(java.lang.String zipLocation,
                   java.lang.String toBeZippedName)
Store the contents of the toBeZippedName directory into a zip file with the provided name. If the zip file name doesn't end in .zip, it will.

Parameters:
zipLocation -
toBeZippedName -
Returns:
true if it works.

query

public void query(java.lang.String rpfDir)
Just run a query on the provided directory, listing the names of the frames that will be affected by the current scale and boundary settings.

Parameters:
rpfDir -

main

public static void main(java.lang.String[] args)
The RpfUtil class can be run as a java program. This program will allow commands to be stacked, but will execute them in this order - copy, delete, maketoc, zip. Only one version of each argument is allowed per execution.

Parameters:
args -

getBoundaryLimits

public int getBoundaryLimits()

setBoundaryLimits

public void setBoundaryLimits(int boundaryLimits)
Set whether the frames need to be INSIDE, OUTSIDE or inside and touching the BOUNDARY of the geographical area set in the RpfUtil object.

Parameters:
boundaryLimits -

getFrameList

public java.util.List<java.lang.String> getFrameList()

setFrameList

public void setFrameList(java.util.List<java.lang.String> frameList)

getLeftLon

public float getLeftLon()

setLeftLon

public void setLeftLon(float leftLon)

getLowerLat

public float getLowerLat()

setLowerLat

public void setLowerLat(float lowerLat)

getRightLon

public float getRightLon()

setRightLon

public void setRightLon(float rightLon)

getRpfDir

public java.lang.String getRpfDir()

setRpfDir

public void setRpfDir(java.lang.String rpfDir)
Creates the list of frames matching the geographical and scale parameters of the frames within the directory.

Parameters:
rpfDir -

getScale

public float getScale()

setScale

public void setScale(float scale)

getScaleDelim

public char getScaleDelim()

setScaleDelim

public void setScaleDelim(char scaleDelim)
Set whether the frames considered should have scale numbers greater than (g), less than (l), not equal to (n) or equal to (e). Equal to is the default, and that's set if any other value os provided.

Parameters:
scaleDelim -

getUpperLat

public float getUpperLat()

setUpperLat

public void setUpperLat(float upperLat)


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details