Class TfrmImportShapefile

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TfrmImportShapefile = class(TfrmCustomGoPhast)

Description

TfrmImportShapefile is used to import Shapefiles.

Hierarchy

Overview

Fields

Implicit btnAll: TButton;
Implicit btnCancel: TBitBtn;
Implicit btnHelp: TBitBtn;
Implicit btnImportCriterion: TButton;
Implicit btnNone: TButton;
Implicit btnOK: TBitBtn;
Implicit btnToggle: TButton;
Implicit cbCoordinateConversion: TCheckBox;
Implicit cbEnclosedCells: TCheckBox;
Implicit cbInterpolation: TCheckBox;
Implicit cbIntersectedCells: TCheckBox;
Implicit comboEllipsoid: TComboBox;
Implicit dgFields: TRbwDataGrid;
Implicit edImportCriterion: TEdit;
Implicit imageUtmZones: TImage;
Implicit lblCoordinateConversionInfo: TLabel;
Implicit lblCoordinates: TLabel;
Implicit lblEllipsoid: TLabel;
Implicit lblImportCriterion: TLabel;
Implicit lblUtmZoneNumber: TLabel;
Implicit OpenDialogShape: TOpenDialog;
Implicit pcImportShape: TPageControl;
Implicit pnlButton: TPanel;
Implicit pnlData: TPanel;
Implicit rpShapeCompiler: TRbwParser;
Implicit seZoneNumber: TSpinEdit;
Implicit Shape1: TShape;
Implicit Shape2: TShape;
Implicit Shape3: TShape;
Implicit Shape4: TShape;
Implicit Shape5: TShape;
Implicit Shape6: TShape;
Implicit Shape7: TShape;
Implicit Shape8: TShape;
Implicit Shape9: TShape;
Implicit Shape10: TShape;
Implicit tabData: TTabSheet;
Implicit tabCoordinateConversion: TTabSheet;
Implicit rgEvaluatedAt: TRadioGroup;
Implicit xbShapeDataBase: TXBase;
Private FFieldTypes: array of TRbwDataType;
Private FGeometryFile: TShapeGeometryFile;

Methods

Implicit procedure btnImportCriterionClick(Sender: TObject);
Implicit procedure btnSelectClick(Sender: TObject);
Implicit procedure btnOKClick(Sender: TObject);
Implicit procedure btnToggleClick(Sender: TObject);
Implicit procedure cbCoordinateConversionClick(Sender: TObject);
Implicit procedure cbEnclosedCellsClick(Sender: TObject);
Implicit procedure comboEllipsoidChange(Sender: TObject);
Implicit procedure dgFieldsDrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState);
Implicit procedure dgFieldsSelectCell(Sender: TObject; ACol, ARow: Integer; var CanSelect: Boolean);
Implicit procedure dgFieldsSetEditText(Sender: TObject; ACol, ARow: Integer; const Value: WideString);
Implicit procedure edImportCriterionExit(Sender: TObject);
Implicit procedure FormCreate(Sender: TObject); override;
Implicit procedure FormDestroy(Sender: TObject);
Implicit procedure rgEvaluatedAtClick(Sender: TObject);
Private function CheckDataSets: boolean;
Private procedure CheckFormula(AFormula: string);
Private procedure CreateVariables(Parser: TRbwParser);
Private procedure GetDataSets(const ARow: integer);
Private procedure GetInterpolators(const ARow: integer);
Private function LatLongToPoint(Long, Lat: double): TPoint;
Private function LatLongToUTM_Zone(const LongitudeDegrees, LatitudeDegrees: double): integer;
Private procedure MakeNewDataSets;
Private procedure SetCheckBoxCaptions;
Private procedure SetData;
Private procedure ShapefileProgress(Sender: TObject; FractionDone: double);
Private function SimpleLongToUTM_Zone(const LongitudeDegrees: double): integer;
Public function GetData: boolean;

Description

Fields

Implicit btnAll: TButton;

btnAll: TButton; See btnSelectClick.

Implicit btnCancel: TBitBtn;

btnCancel: TBitBtn; Clicking btnCancel closes the TfrmImportShapefile without changing anything.

Implicit btnHelp: TBitBtn;

btnHelp: TBitBtn; Clicking btnHelp show help on the TfrmImportShapefile.

Implicit btnImportCriterion: TButton;

btnImportCriterion is used to edit the formula in edImportCriterion.

Implicit btnNone: TButton;

btnNone: TButton; See btnSelectClick.

Implicit btnOK: TBitBtn;

btnOK: TBitBtn; See btnOKClick.

Implicit btnToggle: TButton;

btnToggle: TButton; See btnToggleClick.

Implicit cbCoordinateConversion: TCheckBox;

cbCoordinateConversion is used to turn on or off coordinate transformations from decimal degrees to UTM coordinates.

Implicit cbEnclosedCells: TCheckBox;

cbEnclosedCells: TCheckBox; cbEnclosedCells indicates that the value of the imported TScreenObjects should set the value of enclosed cells or elements in the related TDataArray.

Implicit cbInterpolation: TCheckBox;

cbInterpolation: TCheckBox; cbInterpolation indicates that the value of the imported TScreenObjects should set the value of cells or elements in the related TDataArray by interpolation.

Implicit cbIntersectedCells: TCheckBox;

cbIntersectedCells: TCheckBox; cbIntersectedCells indicates that the value of the imported TScreenObjects should set the value of intersected cells or elements in the related TDataArray.

Implicit comboEllipsoid: TComboBox;

comboEllipsoid is used to choose the ellipsoid for the coordinate conversion.

Implicit dgFields: TRbwDataGrid;

dgFields: TRbwDataGrid; dgFields displays the fields in the Shapefile and allows the user to choose which ones to import.

Implicit edImportCriterion: TEdit;

edImportCriterion holds the formula which is the criterion for importing shapes from the shape file.

Implicit imageUtmZones: TImage;

imageUtmZones is an image of the UTM zones.

Implicit lblCoordinateConversionInfo: TLabel;

lblCoordinateConversionInfo tells that 10 points will be plotted on the map if coordinate conversion is to be performed.

Implicit lblCoordinates: TLabel;

lblCoordinates gives the coordinates of the first point.

Implicit lblEllipsoid: TLabel;

lblEllipsoid is the label for comboEllipsoid.

Implicit lblImportCriterion: TLabel;

lblImportCriterion labels edImportCriterion.

Implicit lblUtmZoneNumber: TLabel;

lblUtmZoneNumber is the label for seZoneNumber.

Implicit OpenDialogShape: TOpenDialog;

OpenDialogShape: TOpenDialog; OpenDialogShape is used to select the Shapefile.

Implicit pcImportShape: TPageControl;

pcImportShape is TPageControl used to hold tabData and tabCoordinateConversion.

Implicit pnlButton: TPanel;

pnlButton: TPanel; pnlButton holds the buttons and other controls at the bottom of the TfrmImportShapefile.

Implicit pnlData: TPanel;

pnlData holds controls used to determine how the shapes in the Shapefile will be imported.

Implicit rpShapeCompiler: TRbwParser;

rpShapeCompiler is used to evaluate the formula in edImportCriterion.

Implicit seZoneNumber: TSpinEdit;

seZoneNumber is the UTM zone number.

Implicit Shape1: TShape;

Shape1 shows the first point to be plotted on the map.

Implicit Shape2: TShape;

Shape2 shows the second point to be plotted on the map.

Implicit Shape3: TShape;

Shape3 shows the third point to be plotted on the map.

Implicit Shape4: TShape;

Shape4 shows the fourth point to be plotted on the map.

Implicit Shape5: TShape;

Shape5 shows the fifth point to be plotted on the map.

Implicit Shape6: TShape;

Shape6 shows the sixth point to be plotted on the map.

Implicit Shape7: TShape;

Shape7 shows the seventh point to be plotted on the map.

Implicit Shape8: TShape;

Shape8 shows the eighth point to be plotted on the map.

Implicit Shape9: TShape;

Shape9 shows the ninth point to be plotted on the map.

Implicit Shape10: TShape;

Shape10 shows the tenth point to be plotted on the map.

Implicit tabData: TTabSheet;

tabData holds the controls that determine how the shapes in the Shapefile will be imported.

Implicit tabCoordinateConversion: TTabSheet;

tabCoordinateConversion holds the controls used to convert from decimal degrees to UTM coordinates.

Implicit rgEvaluatedAt: TRadioGroup;

rgEvaluatedAt: TRadioGroup; rgEvaluatedAt determines whether the Shapefile is to be evaluated to nodes or elements.

Implicit xbShapeDataBase: TXBase;

xbShapeDataBase: TXBase; xbShapeDataBase is used to read the database file that is part of the Shapefile.

Private FFieldTypes: array of TRbwDataType;

FFieldTypes stores the TRbwDataType of the fields in the Shapefile.

Private FGeometryFile: TShapeGeometryFile;

FGeometryFile is the geometry file of the Shapefile.

Methods

Implicit procedure btnImportCriterionClick(Sender: TObject);

btnImportCriterionClick edits the formula in edImportCriterion.

Implicit procedure btnSelectClick(Sender: TObject);

btnSelectClick sets all the checkboxes to checked in column 1 of dgFields to True if Sender = btnAll. Otherwise it sets them all to unchecked. btnSelectClick is the OnClick event-handler for btnAll and btnNone.

Implicit procedure btnOKClick(Sender: TObject);

btnOKClick calls SetData.

Implicit procedure btnToggleClick(Sender: TObject);

btnToggleClick toggles the checkboxes in column 1 of dgFields from Checked to Unchecked or the reverse.

Implicit procedure cbCoordinateConversionClick(Sender: TObject);

cbCoordinateConversionClick activates or deactivates controls related to coordinate conversion and shows or hides points on the image of the UTM zones.

Implicit procedure cbEnclosedCellsClick(Sender: TObject);

cbEnclosedCellsClick checks that at least one of cbEnclosedCells, cbIntersectedCells, or cbInterpolation is checked and emphasisizes them if not. It also disables the OK button until at least one of them is checked.

Implicit procedure comboEllipsoidChange(Sender: TObject);

comboEllipsoidChange changes the ellipsoid used for the coordinate conversions.

Implicit procedure dgFieldsDrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState);

dgFieldsDrawCell draws some cells in a disabled state.

Implicit procedure dgFieldsSelectCell(Sender: TObject; ACol, ARow: Integer; var CanSelect: Boolean);

dgFieldsSelectCell assigns interpolators and TDataArrays to the picklist for columns 2 and 3. See GetDataSets and GetInterpolators.

Implicit procedure dgFieldsSetEditText(Sender: TObject; ACol, ARow: Integer; const Value: WideString);

dgFieldsSetEditText displays the interpolator for the selected TDataArray in column 3.

Implicit procedure edImportCriterionExit(Sender: TObject);

edImportCriterionExit checks the formula in edImportCriterion. See CheckFormula.

Implicit procedure FormCreate(Sender: TObject); override;

FormCreate initialized TfrmImportShapefile.

Implicit procedure FormDestroy(Sender: TObject);

FormDestroy destroys FGeometryFile.

Implicit procedure rgEvaluatedAtClick(Sender: TObject);

rgEvaluatedAtClick changes the captions of cbEnclosedCells, cbIntersectedCells, and cbInterpolation.

Private function CheckDataSets: boolean;

CheckDataSets checks for valid data in dgFields.

Private procedure CheckFormula(AFormula: string);

CheckFormula checks that AFormula is a valid formula.

Private procedure CreateVariables(Parser: TRbwParser);

CreateVariables creates variables in Parser for each attribute in the shape file.

Private procedure GetDataSets(const ARow: integer);

GetDataSets stores in dgFields.Columns[2].PickList the names of the TDataSets that can be used with th parameter in ARow.

Private procedure GetInterpolators(const ARow: integer);

GetInterpolators stores in dgFields.Columns[3].PickList the names of the interpolators that can be used with th parameter in ARow.

Private function LatLongToPoint(Long, Lat: double): TPoint;

LatLongToPoint converts a latitude and longitude in degrees to a point on imageUtmZones.

Private function LatLongToUTM_Zone(const LongitudeDegrees, LatitudeDegrees: double): integer;

LatLongToUTM_Zone converts a latitude and longitude in degrees to a UTM zone. LatLongToUTM_Zone takes into account the non-regular UTM zones.

Private procedure MakeNewDataSets;

MakeNewDataSets makes any required new data sets.

Private procedure SetCheckBoxCaptions;

Set the captions of cbEnclosedCells, cbIntersectedCells, and cbInterpolation based on rgEvaluatedAt.ItemIndex.

Private procedure SetData;

SetData imports the Shapes into GoPhast.

Private procedure ShapefileProgress(Sender: TObject; FractionDone: double);

ShapefileProgress is used to display a progress indication when reeding the Shapefile.

Private function SimpleLongToUTM_Zone(const LongitudeDegrees: double): integer;

SimpleLongToUTM_Zone converts a latitude and longitude in degrees to a UTM zone for the non-special UTM zones. .

See also
LatLongToUTM_Zone
LatLongToUTM_Zone converts a latitude and longitude in degrees to a UTM zone.
Public function GetData: boolean;

GetData returns True if the Shapefile is selected.


Generated by PasDoc 0.10.0 on 2006-10-31 09:56:36