BCoordSysRepository Class Reference

#include <BCoordSysRepository.h>

List of all members.


Detailed Description

A static class that encapsulates the interface with a GeoCalc data source, such as geocalc.xml or geodata.xml.

Public Member Functions

GeoCore::EDialogState BCoordSysRepository::ShowEditCoordSysDialog (const BString &title, BCoordSysPtr &pCoordSys, HWND parent, EObjectType coordSysType=NoType, bool isLocked=false)
 Displays a dialog allowing the user to edit or create a coordinate system and optionally return it.
GeoCore::EDialogState BCoordSysRepository::ShowEditCoordSysDialog (const BString &title, BCoordSysPtr &pCoordSys, QWidget *parent=0, EObjectType coordSysType=NoType, bool isLocked=false)
 Displays a dialog allowing the user to edit or create a coordinate system and optionally return it.
BCoordSysCreateCoordSysfromStringPairs (const BKeyValuePairs &csparams, const BKeyValuePairs &elparams, const BKeyValuePairs &dtparams, const BKeyValuePairs &utparams)
 Creates a BCoordSys that matches a string pair defined coordinate system.
double GetCenteringMargin ()
 Get the value in the GeoCalc datasource that indicates how far in degrees to go beyond the "world boundaries" before wrapping around.
bool GetCenterOnMeridianFlag ()
 Get the current setting of the flag in the GeoCalc datasource that indicates that data being projected should be "wrapped around" if necessary, to maintain a symmetrical view centered on the central meridian (if one exists).
long GetChangesToDatasource ()
 Indicates how many changes have been made to the data source since it was last saved.
BCoordSysGetCoordSys (const BIdentifier &identifier)
 Gets a BCoordSys from this BCoordSysRepository based on the specified BIdentifier.
const
GeoCalc::DB::CDataSource * 
GetDSInstance () const
 Gets the GeoCalcCore CDataSource object that underlies this repository.
void IgnoreEnvelope (bool ignore)
 Toggles the IgnoreEnvelope option for conversions.
bool IsInitialized (void) const
 Indicates whether or not the data source has been initialized.
bool IsLoaded (void)
 Indicates whether or not a data source file has been loaded into this BCoordSysRepository.
void Load (const BString &dataSrcFile)
 Loads the data source from the specified file.
BCoordSysReadCoordSysFromFile (const BString &coordSysFile)
 Creates a BCoordSys from a file (WKT, PRJ, MAP, TAB, etc).
BCoordSysReadCoordSysFromPlainTextStrings (const BString &system, const BString &datum, const BString &units)
 Creates a BCoordSys from a GeoCalc 5.x set of strings.
BCoordSysReadCoordSysFromWKTString (const BString &wkt)
 Creates a BCoordSys from a Well-Known Text (WKT) string.
void SetCenteringMargin (double epsilondegrees)
 Set a value in the GeoCalc datasource that indicates how far in degrees to go beyond the "world boundaries" before wrapping around.
void SetCenterOnMeridianFlag (bool centeronmeridian)
 Set a flag in the GeoCalc datasource that indicates data being projected should be "wrapped around" if necessary, to maintain a symmetrical view centered on the central meridian (if one exists).
void SetDSInstance (GeoCalc::DB::CDataSource *pds)
 Sets the GeoCalcCore CDataSource object that underlies this repository.
void ShowCoordSysDetailsDialog (const BCoordSysPtr pCoordSys, HWND parent)
 Displays a dialog allowing the user to view the details of a coordinate system.
void ShowCoordSysDetailsDialog (const BCoordSysPtr pCoordSys, QWidget *parent=0)
 Displays a dialog allowing the user to view the details of a coordinate system.
GeoCore::EDialogState ShowPickCoordSysDialog (const BString &title, BCoordSysPtr &pCoordSys, HWND parent, const BRect *validGeodeticArea=0, EObjectType coordSysType=NoType)
 Displays a dialog that allows the user to select a coordinate system.
GeoCore::EDialogState ShowPickCoordSysDialog (const BString &title, BCoordSysPtr &pCoordSys, QWidget *parent=0, const BRect *validGeodeticArea=0, EObjectType coordSysType=NoType)
 Displays a dialog that allows the user to select a coordinate system.
void ShowUnitDetailsDialog (const BUnitPtr pUnit, HWND parent)
 Displays a dialog allowing the user to view the details of a measurement unit.
void ShowUnitDetailsDialog (const BUnitPtr pUnit, QWidget *parent=0)
 Displays a dialog allowing the user to view the details of a measurement unit.
bool WriteCoordSysToFile (const BCoordSys &cs, const BString &csFile)
 Writes the coordinate system defined in the specified BCoordSys to a file (WKT, PRJ, MAP, TAB, etc).
BString WriteCoordSysToMIFString (const BCoordSys &cs)
 Creates a MapInfo MIF string representing the coordinate system defined in the specified BCoordSys.
bool WriteCoordSysToPlainTextStrings (const BCoordSys &cs, BString &system, BString &datum, BString &units)
 Finds the GeoCalc 5.x strings that identify the specified BCoordSys.
BString WriteCoordSysToWKTString (const BCoordSys &cs)
 Creates a Well-Known Text (WKT) definition for the coordinate system defined in the specified BCoordSys.
virtual ~BCoordSysRepository ()
 Destructor.

Static Public Member Functions

static void DestroyInstance (void)
 Frees the singleton instance of the BCoordSysRepository.
static
BCoordSysRepository
Instance (void)
 Gets access to the singleton instance of the BCoordSysRepository.
static void SetAuxDataPath (const BString &path)
 Sets the data path for auxillary files needed by the BCoordSysRepository.
static void SetInstance (BCoordSysRepository *pcsr)
 Sets the singleton instance pointer.

Protected Member Functions

EDatumShiftStateType EstablishDatumShift (BCoordTransform &ct)
 Determines the appropriate datum shift(s) to use for the specified BCoordTransform.

Friends

class BCoordTransform

Constructor & Destructor Documentation

virtual ~BCoordSysRepository (  )  [virtual]

Destructor.


Member Function Documentation

GeoCore::EDialogState BCoordSysRepository::ShowEditCoordSysDialog ( const BString title,
BCoordSysPtr pCoordSys,
HWND  parent,
EObjectType  coordSysType = NoType,
bool  isLocked = false 
)

Displays a dialog allowing the user to edit or create a coordinate system and optionally return it.

Parameters:
title The title to be displayed on the dialog box.
parent The parent window.
pCoordSys The coordinate systems that is selected by the user.
coordSysType The type(s) of coordinate systems to display in the dialog [optional, defaults to all].
isLocked A bool indicating whether those objects from outside sources should be locked (view only) or not.
Returns:
The result of showing the dialog.

GeoCore::EDialogState BCoordSysRepository::ShowEditCoordSysDialog ( const BString title,
BCoordSysPtr pCoordSys,
QWidget *  parent = 0,
EObjectType  coordSysType = NoType,
bool  isLocked = false 
)

Displays a dialog allowing the user to edit or create a coordinate system and optionally return it.

Parameters:
title The title to be displayed on the dialog box.
parent The parent widget [optional].
pCoordSys The coordinate systems that is selected by the user.
coordSysType The type(s) of coordinate systems to display in the dialog [optional, defaults to all].
isLocked A bool indicating whether those objects from outside sources should be locked (view only) or not.
Returns:
The result of showing the dialog.

BCoordSys* CreateCoordSysfromStringPairs ( const BKeyValuePairs csparams,
const BKeyValuePairs elparams,
const BKeyValuePairs dtparams,
const BKeyValuePairs utparams 
)

Creates a BCoordSys that matches a string pair defined coordinate system.

Parameters:
csparams The coordinate system parameters
elparams The ellipsoid parameters
dtparams The datum parameters
utparams The unit parameters
Returns:
The coordinate system object. It is the caller's responsibility to delete this object.
Exceptions:
BCoordSysRepositoryException This exception will be thrown if the BCoordSysRepository has not been initialized.
BGeoCalcException This exception will be thrown if GeoCalc encounters an error when creating the coordinate system.

static void DestroyInstance ( void   )  [static]

Frees the singleton instance of the BCoordSysRepository.

EDatumShiftStateType EstablishDatumShift ( BCoordTransform ct  )  [protected]

Determines the appropriate datum shift(s) to use for the specified BCoordTransform.

This should never be called except from inside BCoordTransform itself, since the BCoordTransform constructor itself calls this and doing so a second time is repetitive.

Parameters:
ct The BCoordTransform.
Returns:
The result of the attempt to establish a datum shift.

double GetCenteringMargin (  ) 

Get the value in the GeoCalc datasource that indicates how far in degrees to go beyond the "world boundaries" before wrapping around.

This is only applicable if the Center On Meridian flag is true.

Returns:
double A double containing range beyond which we begin wrapping.

bool GetCenterOnMeridianFlag (  ) 

Get the current setting of the flag in the GeoCalc datasource that indicates that data being projected should be "wrapped around" if necessary, to maintain a symmetrical view centered on the central meridian (if one exists).

Returns:
A bool representing whether the flag is set

long GetChangesToDatasource (  ) 

Indicates how many changes have been made to the data source since it was last saved.

Returns:
The number of changes made to the current data source since the last save.

BCoordSys* GetCoordSys ( const BIdentifier identifier  ) 

Gets a BCoordSys from this BCoordSysRepository based on the specified BIdentifier.

Parameters:
identifier A BIdentifier that identifies the desired coordinate system.
Returns:
A BCoordSys object with the specified identifier. It is the responsibility of the caller to delete this object. If no such BCoordSys can be found, then this method will return NULL.
Exceptions:
BCoordSysRepositoryException This exception will be thrown if the BCoordSysRepository has not been initialized.

const GeoCalc::DB::CDataSource* GetDSInstance (  )  const

Gets the GeoCalcCore CDataSource object that underlies this repository.

Returns:
The GeoCalcCore CDataSource object.

void IgnoreEnvelope ( bool  ignore  ) 

Toggles the IgnoreEnvelope option for conversions.

If this is turned on (true), then envelopes will not be checked during conversions. If this is turned off (false), then envelopes will be checked.

Parameters:
ignore Indicates if the IgnoreEnvelope option should be on (true) or off (false).

static BCoordSysRepository* Instance ( void   )  [static]

Gets access to the singleton instance of the BCoordSysRepository.

Returns:
The singleton instance of the BCoordSysRepository.

bool IsInitialized ( void   )  const

Indicates whether or not the data source has been initialized.

Returns:
True if the data source has been initialized and false otherwise.

bool IsLoaded ( void   ) 

Indicates whether or not a data source file has been loaded into this BCoordSysRepository.

Returns:
True if the data source file has been loaded and false otherwise.

void Load ( const BString dataSrcFile  ) 

Loads the data source from the specified file.

Parameters:
dataSrcFile The absolute path and filename of the data source file.
Returns:
True if the data source was loaded successfully and false otherwise.

BCoordSys* ReadCoordSysFromFile ( const BString coordSysFile  ) 

Creates a BCoordSys from a file (WKT, PRJ, MAP, TAB, etc).

Parameters:
coordSysFile The path and file name containing the coordinate system definition.
Returns:
A BCoordSys object that represents the coordinate system defined in the file. It is the responsibility of the caller to delete this object.
Exceptions:
BCoordSysRepositoryException This exception will be thrown if the BCoordSysRepository has not been initialized.
BGeoCalcException This exception will be thrown if GeoCalc encounters an error when parsing the input file.

BCoordSys* ReadCoordSysFromPlainTextStrings ( const BString system,
const BString datum,
const BString units 
)

Creates a BCoordSys from a GeoCalc 5.x set of strings.

Parameters:
system The GeoCalc 5.x system name (i.e. CA83-3).
datum The GeoCalc 5.x datum name (i.e. NAD27).
units The GeoCalc 5.x units name (i.e. METERS).
Returns:
A BCoordSys object that represents the GeoCalc 5.x coordinate system. It is the responsibility of the caller to delete this object.
Exceptions:
BCoordSysRepositoryException This exception will be thrown if the BCoordSysRepository has not been initialized.
BGeoCalcException This exception will be thrown if GeoCalc encounters an error when creating the BCoordSys.

BCoordSys* ReadCoordSysFromWKTString ( const BString wkt  ) 

Creates a BCoordSys from a Well-Known Text (WKT) string.

Parameters:
wkt A WKT string that defines a coordinate system.
Returns:
A BCoordSys object that represents the coordinate system defined in the WKT string. It is the responsibility of the caller to delete this object.
Exceptions:
BCoordSysRepositoryException This exception will be thrown if the BCoordSysRepository has not been initialized.
BGeoCalcException This exception will be thrown if GeoCalc encounters an error when parsing the WKT string.

static void SetAuxDataPath ( const BString path  )  [static]

Sets the data path for auxillary files needed by the BCoordSysRepository.

Parameters:
path The absolute path to the folder containing the auxillary data.
Exceptions:
BFileNotFoundException This exception will be thrown if the specified path does not exist.

void SetCenteringMargin ( double  epsilondegrees  ) 

Set a value in the GeoCalc datasource that indicates how far in degrees to go beyond the "world boundaries" before wrapping around.

This is only applicable if the Center On Meridian flag is true.

Parameters:
epsilondegrees A double containing range beyond which we begin wrapping.
Returns:

void SetCenterOnMeridianFlag ( bool  centeronmeridian  ) 

Set a flag in the GeoCalc datasource that indicates data being projected should be "wrapped around" if necessary, to maintain a symmetrical view centered on the central meridian (if one exists).

Parameters:
centeronmeridian A bool representing whether the flag should be set
Returns:

void SetDSInstance ( GeoCalc::DB::CDataSource *  pds  ) 

Sets the GeoCalcCore CDataSource object that underlies this repository.

Parameters:
pds The GeoCalcCore CDataSource object.

static void SetInstance ( BCoordSysRepository pcsr  )  [static]

Sets the singleton instance pointer.

Parameters:
pcsr An instance of the BCoordSysRepository object.

void ShowCoordSysDetailsDialog ( const BCoordSysPtr  pCoordSys,
HWND  parent 
)

Displays a dialog allowing the user to view the details of a coordinate system.

Parameters:
pCoordSys The coordinate system to view.
parent The parent window.

void ShowCoordSysDetailsDialog ( const BCoordSysPtr  pCoordSys,
QWidget *  parent = 0 
)

Displays a dialog allowing the user to view the details of a coordinate system.

Parameters:
pCoordSys The coordinate system to view.
parent The parent widget [optional].

GeoCore::EDialogState ShowPickCoordSysDialog ( const BString title,
BCoordSysPtr pCoordSys,
HWND  parent,
const BRect validGeodeticArea = 0,
EObjectType  coordSysType = NoType 
)

Displays a dialog that allows the user to select a coordinate system.

Parameters:
title The title to be displayed on the dialog box.
pCoordSys The coordinate systems that is selected by the user.
parent The parent window.
validGeodeticArea The area in Geodetic-WGS84 Lat/Lon in which this coordinate systems needs to be valid [optional].
coordSysType The type(s) of coordinate systems to display in the dialog [optional, defaults to all].
Returns:
The result of showing the dialog.

GeoCore::EDialogState ShowPickCoordSysDialog ( const BString title,
BCoordSysPtr pCoordSys,
QWidget *  parent = 0,
const BRect validGeodeticArea = 0,
EObjectType  coordSysType = NoType 
)

Displays a dialog that allows the user to select a coordinate system.

Parameters:
title The title to be displayed on the dialog box.
pCoordSys The coordinate systems that is selected in the dialog.
parent The parent widget [optional].
validGeodeticArea The area in Geodetic-WGS84 Lat/Lon in which this coordinate systems needs to be valid [optional]
coordSysType The type(s) of coordinate systems to display in the dialog [optional, defaults to all].
Returns:
The result of showing the dialog.

void ShowUnitDetailsDialog ( const BUnitPtr  pUnit,
HWND  parent 
)

Displays a dialog allowing the user to view the details of a measurement unit.

Parameters:
pUnit The BUnit to view.
parent The parent window.

void ShowUnitDetailsDialog ( const BUnitPtr  pUnit,
QWidget *  parent = 0 
)

Displays a dialog allowing the user to view the details of a measurement unit.

Parameters:
pUnit The BUnit to view.
parent The parent widget [optional].

bool WriteCoordSysToFile ( const BCoordSys cs,
const BString csFile 
)

Writes the coordinate system defined in the specified BCoordSys to a file (WKT, PRJ, MAP, TAB, etc).

Parameters:
cs The BCoordSys that shall be written to file.
csFile The file to which the coordinate system will be written.
Returns:
True if the coordinate system was written successfully and false otherwise.
Exceptions:
BCoordSysRepositoryException This exception will be thrown if the BCoordSysRepository has not been initialized.
BGeoCalcException This exception will be thrown if GeoCalc encounters an error when writing the coordinate system to the file.

BString WriteCoordSysToMIFString ( const BCoordSys cs  ) 

Creates a MapInfo MIF string representing the coordinate system defined in the specified BCoordSys.

Parameters:
cs The BCoordSys to convert to a MapInfo MIF String.
Returns:
A MapInfo MIF string representing the coordinate system.

bool WriteCoordSysToPlainTextStrings ( const BCoordSys cs,
BString system,
BString datum,
BString units 
)

Finds the GeoCalc 5.x strings that identify the specified BCoordSys.

Parameters:
cs The coordinate system to be converted to GeoCalc 5.x strings.
system This string will hold the resulting GeoCalc 5.x system name.
datum This string will hold the resulting GeoCalc 5.x datum name.
units This string will hold the resulting GeoCalc 5.x units name.
Returns:
True if the method is successful and false otherwise.
Exceptions:
BCoordSysRepositoryException This exception will be thrown if the BCoordSysRepository has not been initialized.
BGeoCalcException This exception will be thrown if GeoCalc encounters an error when creating the GeoCalc 5.x strings.

BString WriteCoordSysToWKTString ( const BCoordSys cs  ) 

Creates a Well-Known Text (WKT) definition for the coordinate system defined in the specified BCoordSys.

Parameters:
cs The BCoordSys that should be converted to a WKT string.
Returns:
A WKT representation for the coordinate system.
Exceptions:
BCoordSysRepositoryException This exception will be thrown if the BCoordSysRepository has not been initialized.
BGeoCalcException This exception will be thrown if GeoCalc encounters an error when creating the WKT string.


Friends And Related Function Documentation

friend class BCoordTransform [friend]


The documentation for this class was generated from the following file:

GeoTranslate 5.0 From Blue Marble Geographics